Vercel is the recommended platform for deploying Next.js applications. ShipFree is optimized for Vercel’s deployment workflow with built-in configuration.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/revokslab/shipfree/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- A Vercel account (sign up here)
- A PostgreSQL database (Neon, Supabase, or Vercel Postgres)
- Git repository (GitHub, GitLab, or Bitbucket)
Quick Deploy
1. Deploy to Vercel
The fastest way to deploy is using Vercel’s Git integration:- Push your code to a Git repository
- Import your repository in Vercel Dashboard
- Vercel will automatically detect Next.js and configure build settings
- Configure environment variables (see below)
- Click “Deploy”
2. Set Up PostgreSQL Database
Choose one of these PostgreSQL providers:Option A: Neon (Recommended)
Neon offers serverless PostgreSQL with a generous free tier:- Create a Neon account
- Create a new project
- Copy the connection string (it looks like:
postgres://user:password@host.neon.tech/database)
Option B: Supabase
Supabase provides PostgreSQL with additional features:- Create a Supabase project
- Go to Project Settings → Database
- Copy the connection string (use the “Connection Pooling” URL for better performance)
Option C: Vercel Postgres
Vercel Postgres integrates directly with your Vercel project:- In your Vercel project, go to Storage
- Create a new Postgres database
- Vercel automatically adds
POSTGRES_URLto your environment variables
Environment Variables
In your Vercel project settings, add the following environment variables:Required Variables
BETTER_AUTH_SECRET:
Optional: OAuth Providers
Add these if you’re using social authentication:Optional: Email Provider
Optional: Payment Provider
Optional: Observability
Optional: Storage
Run Database Migrations
After deploying, you need to run database migrations:Option 1: Local Migration (Recommended)
Run migrations from your local machine:Option 2: Vercel CLI
Alternatively, use the Vercel CLI:Vercel Configuration
ShipFree includes avercel.json configuration file:
vercel.json
- Rewrites
/docsroutes to the documentation site - Can be customized for your deployment needs
Build Settings
Vercel automatically detects these settings:- Framework Preset: Next.js
- Build Command:
bun run build(ornpm run build) - Output Directory:
.next - Install Command:
bun install(ifbun.lockis present)
Custom Build Configuration
If needed, you can override these in Vercel project settings:Domain Setup
Add Custom Domain
- Go to your Vercel project → Settings → Domains
- Add your domain (e.g.,
yourdomain.com) - Follow DNS configuration instructions
- Update
NEXT_PUBLIC_APP_URLandBETTER_AUTH_URLto match your domain
OAuth Callback URLs
Update OAuth provider settings with your production URL: Google Console:- Authorized redirect URIs:
https://yourdomain.com/api/auth/callback/google
- Authorization callback URL:
https://yourdomain.com/api/auth/callback/github
- Redirect URI:
https://yourdomain.com/api/auth/callback/microsoft
Deployment Workflow
Automatic Deployments
Vercel automatically deploys when you push to your Git repository:- Production: Pushes to
mainbranch - Preview: Pull requests and other branches
Manual Deployments
Deploy from your local machine:Monitoring & Logs
View Deployment Logs
- Go to Vercel Dashboard → Your Project → Deployments
- Click on any deployment to view build and runtime logs
Real-Time Logs
View live logs using Vercel CLI:Sentry Integration
ShipFree includes Sentry for error tracking. Configure it by adding:Performance Optimization
Edge Functions
ShipFree uses Vercel’s Edge Runtime for optimal performance. No additional configuration needed.Caching
Next.js automatically optimizes caching on Vercel:- Static pages are cached at the edge
- API routes use appropriate cache headers
- ISR (Incremental Static Regeneration) works out of the box
Troubleshooting
Build Fails
Check environment variables:- Go to Deployments → Click failed deployment → View logs
Database Connection Issues
Verify DATABASE_URL:- Ensure the connection string is correct
- Check if your database allows connections from Vercel’s IP ranges
- For Neon/Supabase, use connection pooling URLs
OAuth Not Working
Common issues:- Callback URLs don’t match production domain
BETTER_AUTH_URLdoesn’t match actual domain- OAuth credentials are for wrong environment (dev vs prod)
Next Steps
- Set up database migrations
- Configure Docker deployment (for self-hosting)
- Configure environment variables