Quick Deployment Setup Guide
This guide will help you set up deployments for HiveJournal to Vercel (frontend) and Railway (backend).
Prerequisites
- GitHub repository connected
- Vercel account (sign up at https://vercel.com)
- Railway account (sign up at https://railway.app)
- Supabase project created
- Stripe account (for payments)
- Resend account (for emails)
Option 1: Auto-Deploy via Platform Dashboards (Recommended)
This is the easiest approach - connect your GitHub repo directly in Vercel and Railway dashboards.
Frontend - Vercel Setup
-
Connect Repository
- Go to Vercel Dashboard
- Click "Add New Project"
- Import your GitHub repository:
jurowski/hivejournal-2026 - Select the repository and click "Import"
-
Configure Project Settings
- Framework Preset: Next.js (auto-detected)
- Root Directory:
apps/frontend - Build Command:
npm run build(auto-detected) - Output Directory:
.next(auto-detected) - Install Command:
npm install(auto-detected)
-
Add Environment Variables Go to Project Settings > Environment Variables and add:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key NEXT_PUBLIC_API_URL=https://your-backend.railway.app -
Deploy
- Click "Deploy"
- Vercel will automatically deploy on every push to
mainbranch
Backend - Railway Setup
-
Connect Repository
- Go to Railway Dashboard
- Click "New Project"
- Select "Deploy from GitHub repo"
- Choose your repository:
jurowski/hivejournal-2026
-
Configure Service
- Railway will auto-detect the backend
- If not, click "New Service" > "GitHub Repo" > Select your repo
- Set the Root Directory to
apps/backendin service settings - Railway will use the
railway.jsonconfiguration automatically
-
Add Environment Variables Go to Service Settings > Variables and add:
PORT=3001 NODE_ENV=production SUPABASE_URL=your_supabase_project_url SUPABASE_SERVICE_ROLE_KEY=your_supabase_service_role_key STRIPE_SECRET_KEY=your_stripe_secret_key STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret RESEND_API_KEY=your_resend_api_key RESEND_FROM_EMAIL=noreply@hivejournal.com ALLOWED_ORIGINS=https://your-frontend.vercel.app,https://hivejournal.com JWT_SECRET=your_secure_random_string -
Get Backend URL
- After deployment, go to Settings > Networking
- Railway will generate a domain like
your-backend.railway.app - Copy this URL and update:
- Frontend's
NEXT_PUBLIC_API_URLin Vercel ALLOWED_ORIGINSin Railway to include your frontend URL
- Frontend's
-
Deploy
- Railway will automatically deploy on every push to
mainbranch - To trigger a manual redeploy, see RAILWAY_REDEPLOY.md
- Railway will automatically deploy on every push to
Option 2: GitHub Actions Deployment
If you prefer to use GitHub Actions for deployment, you'll need to set up additional secrets.
Required GitHub Secrets
Go to your repository Settings > Secrets and variables > Actions, and add:
For Vercel:
VERCEL_TOKEN- Get from Vercel Account Settings > TokensVERCEL_ORG_ID- Get from Vercel project settingsVERCEL_PROJECT_ID- Get from Vercel project settings
For Railway:
RAILWAY_TOKEN- Get by runningrailway loginandrailway linklocally, then check.railway/tokenRAILWAY_SERVICE_ID- Get from Railway service settings
For Build:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEYNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYNEXT_PUBLIC_API_URL
Getting Vercel IDs
- Install Vercel CLI:
npm i -g vercel - Run
vercel linkin theapps/frontenddirectory - Check
.vercel/project.jsonfororgIdandprojectId
Getting Railway Token and Service ID
- Install Railway CLI:
npm i -g @railway/cli - Run
railway login - Run
railway linkin theapps/backenddirectory - Get token from
~/.railway/tokenor Railway dashboard - Get service ID from Railway service settings URL or dashboard
Post-Deployment Steps
1. Update Environment Variables
After both are deployed:
-
Get Backend URL from Railway
- Copy the Railway-generated domain
-
Update Frontend Environment Variables in Vercel
- Update
NEXT_PUBLIC_API_URLto your Railway backend URL
- Update
-
Update Backend Environment Variables in Railway
- Update
ALLOWED_ORIGINSto include your Vercel frontend URL
- Update
2. Configure Webhooks
Stripe Webhook:
- URL:
https://your-backend.railway.app/api/payment/webhook - Events:
checkout.session.completed,customer.subscription.updated,customer.subscription.deleted
Resend Webhook (if needed):
- URL:
https://your-backend.railway.app/api/email/webhook - Event:
email.received
3. Test Deployment
- Visit your Vercel frontend URL
- Test sign up/sign in
- Test API health endpoint:
https://your-backend.railway.app/health - Test a full user flow
Troubleshooting
Frontend Issues
- Check Vercel build logs in the dashboard
- Verify all
NEXT_PUBLIC_*environment variables are set - Check that
NEXT_PUBLIC_API_URLpoints to your Railway backend
Backend Issues
- Check Railway logs in the dashboard
- Verify all environment variables are set
- Check CORS configuration - ensure
ALLOWED_ORIGINSincludes your frontend URL - Test health endpoint:
curl https://your-backend.railway.app/health
Common Issues
CORS Errors:
- Make sure
ALLOWED_ORIGINSin Railway includes your Vercel frontend URL - Format:
https://your-app.vercel.app,https://hivejournal.com(comma-separated, no spaces)
Build Failures:
- Check Node.js version matches (should be 18+)
- Verify all dependencies are in
package.json - Check build logs for specific errors
Environment Variable Issues:
- Remember:
NEXT_PUBLIC_*variables are exposed to the browser - Never put secrets in
NEXT_PUBLIC_*variables - Redeploy after adding new environment variables
Next Steps
- Set up custom domains (see DEPLOYMENT.md)
- Configure monitoring and alerts
- Set up database backups in Supabase
- Configure email domain in Resend