Skip to content

Deploying to Vercel

Vercel is the creators of Next.js and provides the best out-of-the-box experience for deploying the Atlas ERP frontend (apps/web).

Prerequisites

  • A GitHub/GitLab/Bitbucket repository containing the Atlas ERP code.
  • A Vercel account.
  • Your Backend API must already be deployed and accessible via a public URL (e.g., https://api.yourdomain.com).

Deployment Steps

  1. Import Project:
  2. Log into Vercel and click Add New Project.
  3. Import the Atlas ERP repository.

  4. Configure Project:

  5. Framework Preset: Vercel should automatically detect Next.js.
  6. Root Directory: Edit this and set it to apps/web.
  7. Build Command: pnpm build (or leave default if Turborepo is detected).
  8. Install Command: pnpm install (or leave default).

  9. Set Environment Variables: Add the necessary environment variables for the frontend:

  10. NEXT_PUBLIC_API_URL: The URL of your deployed backend (e.g., https://api.yourdomain.com).
  11. NEXT_PUBLIC_TURNSTILE_SITE_KEY: Your Cloudflare Turnstile public key.

  12. Deploy:

  13. Click Deploy. Vercel will build the apps/web package and assign you a URL.

Custom Domains

Once deployed, you can navigate to the Settings > Domains tab in Vercel to add a custom domain (e.g., app.yourdomain.com). Ensure you update the TRUSTED_ORIGINS on your backend API to accept requests from this new domain.