Overview
The SecurAtlas web application is deployed on Vercel. The Supabase backend (database, Edge Functions, storage) is managed separately through the Supabase platform and CLI.Project Setup
Import the repository
In the Vercel dashboard, click “Add New Project” and import the SecurAtlas repository from GitHub.
Configure build settings
| Setting | Value |
|---|---|
| Build Command | pnpm build |
| Output Directory | .next |
| Install Command | pnpm install |
| Node.js Version | 20.x |
Add environment variables
Add all required environment variables. See Environment Variables for the complete list.
Environment Variables
Add all variables from the Environment Variables reference to Vercel project settings. Key considerations:- Production
- Preview
NEXT_PUBLIC_APP_URL=https://app.securatlas.com- All redirect URIs point to the production domain
- Use production Stripe keys (
sk_live_...)
Build Configuration
The monorepo build uses pnpm workspaces. Vercel’s build process:- Installs all workspace dependencies via
pnpm install - Runs
pnpm buildwhich buildsapps/weband its workspace dependencies - The output is a standard Next.js
.nextdirectory
maxDuration
For API routes that make external calls (OAuth callbacks, Stripe webhooks), set appropriate timeouts:The default Vercel function timeout on the Pro plan is 15 seconds. OAuth token exchanges with slow providers may need up to 30 seconds.
Domain Configuration
Configure custom domains in Vercel project settings:| Domain | Purpose |
|---|---|
app.securatlas.com | Production application |
preview.securatlas.com | Stable preview environment |
Preview Deployments
Every pull request automatically gets a preview deployment. These are useful for:- Testing UI changes before merging
- QA review of new features
- Stakeholder demos
Preview deployments use the “Preview” environment variables. Ensure test API keys and separate OAuth app registrations are configured for preview.
Edge Function Deployment
Supabase Edge Functions are deployed separately from the Vercel deployment:Deployment Checklist
Before deploying to production:- All environment variables are set in Vercel
- Edge Functions are deployed to Supabase
- Database migrations have been applied
- OAuth redirect URIs are registered with providers
- Stripe webhook endpoint is configured for the production domain
- DNS records are verified for custom domains
Rollbacks
Vercel supports instant rollbacks to any previous deployment:- Go to the Vercel dashboard > Deployments
- Find the last known good deployment
- Click the three-dot menu and select “Promote to Production”