Deploy to Vercel¶
Vercel is the recommended platform for deploying Learnify.
One-Click Deploy¶
Manual Deployment¶
Step 1: Install Vercel CLI¶
Step 2: Login to Vercel¶
Step 3: Deploy¶
From your project directory:
Follow the prompts to:
- Set up and deploy
- Link to existing project or create new
- Configure project settings
Step 4: Configure Environment Variables¶
In the Vercel dashboard:
- Go to your project
- Navigate to Settings > Environment Variables
- Add all required variables:
DATABASE_URL
AUTH_SECRET
AUTH_URL
AUTH_GOOGLE_ID
AUTH_GOOGLE_SECRET
AUTH_GITHUB_ID
AUTH_GITHUB_SECRET
STRIPE_SECRET_KEY
STRIPE_PUBLISHABLE_KEY
STRIPE_WEBHOOK_SECRET
CLOUDINARY_CLOUD_NAME
CLOUDINARY_API_KEY
CLOUDINARY_API_SECRET
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET
NEXT_PUBLIC_APP_URL
Update AUTH_URL
Set AUTH_URL to your production URL (e.g., https://learnify.vercel.app)
Step 5: Configure Stripe Webhook¶
- Go to Stripe Dashboard > Developers > Webhooks
- Add endpoint:
https://your-domain.vercel.app/api/webhooks/stripe - Select events:
checkout.session.completed - Copy the webhook secret to
STRIPE_WEBHOOK_SECRET
Production Checklist¶
Before going live:
- [ ] Generate strong
AUTH_SECRET - [ ] Set
AUTH_URLto production URL - [ ] Update
NEXT_PUBLIC_APP_URL - [ ] Configure production Stripe keys
- [ ] Set up Stripe webhook for production
- [ ] Verify database connection
- [ ] Test OAuth callbacks
Custom Domain¶
- Go to Settings > Domains
- Add your domain
- Configure DNS records as instructed
- Enable HTTPS (automatic)
Automatic Deployments¶
Vercel automatically deploys:
- Production - Pushes to
mainbranch - Preview - Pull requests
Configure branch settings in Settings > Git.