Deployment
Step-by-step guide to deploy your ShipAhead project on Vercel or Cloudflare for fast, reliable, and scalable hosting.
Pre-Commit and Deployment Checklist
Before committing or deploying, complete these steps:
- Run `npm run lint-fix` to check and fix code errors.
- Run `npm run format` to ensure consistent code style.
- Test locally with `npm run dev` to verify functionality.
- Check `.env.local` file for correct environment variables (e.g., API keys).
- Don’t commit sensitive files (e.g., .env / .env.local)
- Commit changes with a clear commit message.
- Push changes to your GitHub repository.
- Verify environment variables are set in your deployment platform.
Vercel
Deploy your project to Vercel with these steps:
- Push your project to a private GitHub repository.
- Sign up / Log in to Vercel and click New Project.
- Import your GitHub repository.
- Set Framework Preset to Nuxt.js.
- Add environment variables (from
.env) if needed. - Click Deploy to build and launch your app.
- Access your live site at the provided Vercel URL.
Cloudflare Workers
Deploy your project to Cloudflare Workers with these steps:
Sign up / Log in to Cloudflare.
Set up Hyperdrive (for database connections):
- In the Cloudflare dashboard, go to Workers & Pages → Hyperdrive.
- Click Create Hyperdrive and connect it to your database (e.g., Postgres, MySQL).
- Once created, copy the Hyperdrive ID.
- Run the following command in your project
terminal
mv wrangler.example.toml wrangler.toml - Set it to wrangler.toml:
wrangler.toml
[[hyperdrive]] binding = "HYPERDRIVE" id = "your-hyperdrive-id"
Set nitro preset in environment variable:
.env.localNITRO_PRESET="cloudflare_module"Commit changes and push to your repository.
Deploy via Cloudflare:
- Go to Workers & Pages → Create Application → Create Worker.
- Connect your GitHub repository.
- Set the build command to:
npm run build - Add environment variables (
.env.localvalues). - Click Deploy to build and launch
Access your live site at the Cloudflare Workers URL.
Usage
- Vercel/Cloudflare: Both platforms auto-deploy on every push to the main branch.
- Verify Deployment: Visit your live URL to confirm the app works.
- Check Logs: Monitor logs in the Vercel or Cloudflare dashboards if errors occur.
- For more details, see the Nuxt Deployment Documentation.