Deployment Guide
Deployment Guide
Section titled “Deployment Guide”Deploy your Orion Kit application to production in 15 minutes.
🚀 Quick Deploy (Vercel)
Section titled “🚀 Quick Deploy (Vercel)”Prerequisites
Section titled “Prerequisites”- Vercel account (free)
- GitHub repository with your code
- Production API keys (see Setup Services below)
Step 1: Setup Production Services
Section titled “Step 1: Setup Production Services”Neon Database:
- Go to neon.tech → Create project
- Copy Pooled Connection URL
- Run:
export DATABASE_URL="postgresql://..." && pnpm db:push
Stripe Payments:
- Go to stripe.com → Toggle to Live Mode
- Create products → Copy Price IDs
- Get live API keys
Other Services:
Step 2: Deploy API
Section titled “Step 2: Deploy API”- Go to Vercel Dashboard
- Import your GitHub repository
- Root Directory:
apps/api
← IMPORTANT - Add Environment Variables:
AUTH_JWT_SECRET=your-super-secret-key-min-32-chars
DATABASE_URL=postgresql://your-production-neon-url...
STRIPE_SECRET_KEY=sk_live_...
STRIPE_PRICE_ID_PRO=price_...
STRIPE_PRICE_ID_ENTERPRISE=price_...
RESEND_API_KEY=re_...
FROM_EMAIL=hello@yourdomain.com
NEXT_PUBLIC_APP_URL=https://placeholder.vercel.app
AXIOM_TOKEN=xaat-...
AXIOM_DATASET=your-app-production
- Deploy → Copy URL (e.g.,
https://your-api-abc123.vercel.app
)
Step 3: Setup Stripe Webhook
Section titled “Step 3: Setup Stripe Webhook”- In Stripe → Webhooks → Add Endpoint
- URL:
https://your-api-abc123.vercel.app/webhooks/stripe
- Events:
checkout.session.completed
,customer.subscription.*
- Copy Signing Secret → Update
STRIPE_WEBHOOK_SECRET
in Vercel → Redeploy
Step 4: Deploy App
Section titled “Step 4: Deploy App”- Import same GitHub repo
- Root Directory:
apps/app
- Add Environment Variables:
DATABASE_URL=postgresql://your-production-neon-url...
NEXT_PUBLIC_API_URL=https://your-api-abc123.vercel.app
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_live_...
STRIPE_PRICE_ID_PRO=price_...
STRIPE_PRICE_ID_ENTERPRISE=price_...
NEXT_PUBLIC_POSTHOG_KEY=phc_...
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
- Deploy → Copy URL (e.g.,
https://your-app-xyz789.vercel.app
) - Update API: Set
NEXT_PUBLIC_APP_URL
to your app URL → Redeploy API
Step 5: Deploy Web (Optional)
Section titled “Step 5: Deploy Web (Optional)”- Import same GitHub repo
- Root Directory:
apps/web
- Add Environment Variables:
NEXT_PUBLIC_POSTHOG_KEY=phc_...
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
- Deploy → Copy URL (e.g.,
https://your-web-def456.vercel.app
)
✅ Test Production
Section titled “✅ Test Production”- Visit your app:
https://your-app-xyz789.vercel.app
- Sign up → Should redirect to dashboard
- Test billing: Go to
/dashboard/billing
→ Upgrade to Pro - Use test card:
4242 4242 4242 4242
🌐 Custom Domain (Optional)
Section titled “🌐 Custom Domain (Optional)”- Buy domain (e.g.,
yourdomain.com
) - Add domains in Vercel:
- App:
app.yourdomain.com
- API:
api.yourdomain.com
- Web:
yourdomain.com
- App:
- Update environment variables:
- API:
NEXT_PUBLIC_APP_URL=https://app.yourdomain.com
- App:
NEXT_PUBLIC_API_URL=https://api.yourdomain.com
- API:
- Update Stripe webhook to
https://api.yourdomain.com/webhooks/stripe
- Redeploy all apps
🆘 Troubleshooting
Section titled “🆘 Troubleshooting”Issue | Fix |
---|---|
Build fails | Set Root Directory to apps/api , apps/app , or apps/web |
”DATABASE_URL not defined” | Add DATABASE_URL in Vercel → Environment Variables |
”AUTH_JWT_SECRET not defined” | Add AUTH_JWT_SECRET with 32+ chars |
API 500 on webhook | Update STRIPE_WEBHOOK_SECRET → redeploy |
CORS error | Update NEXT_PUBLIC_APP_URL to match actual app URL |
📋 Production Checklist
Section titled “📋 Production Checklist”- All apps deployed (
api
,app
,web
) - Database schema pushed:
pnpm db:push
- Stripe webhook endpoint created
- All environment variables set with production keys
- Tested signup flow
- Tested billing flow
- Logs appearing in Axiom
- Analytics appearing in PostHog
Estimated time: ~15 minutes for first deployment
Need help? Check our Complete Deployment Guide or open an issue.