Deployment Guide
Frontend (Vercel)
The Next.js frontend is deployed on Vercel.
Configuration
- Build Command:
next build - Output Directory:
.next(handled automatically by Vercel) - Environment Variables:
NEXT_PUBLIC_API_URL: The URL of the backend API (e.g.,https://guejmi-backend.up.railway.app).
Deployment Steps
- Push changes to the
mainbranch. - Vercel automatically triggers a new build.
- Verify the deployment URL.
Backend (Railway)
The Django backend is deployed on Railway.
Configuration
- Build Command:
pip install -r requirements.txt && python manage.py collectstatic --noinput && python manage.py migrate - Start Command:
gunicorn config.wsgi:application - Environment Variables:
DEBUG:FalseSECRET_KEY: Production secret key.DATABASE_URL: Provided by Railway (PostgreSQL).REDIS_URL: Provided by Railway (Redis).CORS_ALLOWED_ORIGINS:https://guejmi-website.vercel.appCSRF_TRUSTED_ORIGINS:https://guejmi-website.vercel.app
Database (PostgreSQL)
- Managed by Railway.
- Requires
pg_trgmextension for search functionality.- Run:
CREATE EXTENSION IF NOT EXISTS pg_trgm;
- Run:
Deployment Steps
- Push changes to the
mainbranch. - Railway detects changes and rebuilds the service.
- Migrations are applied automatically during the build/start process.
Domain Configuration
- Frontend Domain:
guejmi.tn(Configured in Vercel). - Backend Domain:
api.guejmi.tn(Optional, or use Railway default).