Full-stack ILES application using Django REST, React, and Neon Postgres.
Browser → Vercel (frontend/dist)
↓ /api/*
Render (Gunicorn → Django)
↓
Neon Postgres
Production deployments require Neon Postgres. Local debug runs can fall back to SQLite when NEON_DATABASE_URL is not set, but Render must have NEON_DATABASE_URL configured.
- Create a Neon project.
- Open Connect and copy the Postgres connection string.
- Prefer the pooled connection string for serverless hosts like Render.
- Set it as
NEON_DATABASE_URL.
The URL should look like:
postgresql://USER:PASSWORD@HOST.neon.tech/neondb?sslmode=require
- GitHub repository connected to Render
- Neon Postgres connection string ready
-
In the Render dashboard, create a Blueprint from this repo (uses
render.yaml), or create a Web Service manually with:- Root directory:
backend - Runtime: Python 3.12
- Build command:
pip install -r requirements.txt python manage.py collectstatic --noinput python manage.py migrate --noinput
- Start command:
gunicorn config.wsgi:application --bind 0.0.0.0:$PORT --workers 2 --threads 4 --timeout 120 --access-logfile - --error-logfile -
- Root directory:
-
Set the required environment variable in Render:
NEON_DATABASE_URL— your Neon Postgres URL (required)
-
Render auto-generates
DJANGO_SECRET_KEYfromrender.yaml. Confirm these production settings are present:DJANGO_DEBUG=falseDJANGO_SKIP_ENV_FILES=trueDJANGO_ALLOWED_HOSTSincludes your Render hostname and Vercel domainDJANGO_CORS_ALLOWED_ORIGINSincludes your Vercel domainDJANGO_CORS_ALLOWED_ORIGIN_REGEXES=^https://.*\.vercel\.app$(covers preview deployments)
-
Deploy and verify:
GET https://<your-render-service>.onrender.com/api/health/Expected response:
{"status":"ok","service":"internship-logging-evaluation","database":"ok"} -
Optional: seed demo data from the Render shell:
python manage.py seed_demo
Update these files to match the new hostname:
vercel.json—/apirewrite destinationrender.yaml—DJANGO_ALLOWED_HOSTS,DJANGO_CORS_ALLOWED_ORIGINS,DJANGO_CSRF_TRUSTED_ORIGINS.env.example— documentation defaults
-
Import the GitHub repository into Vercel.
-
Vercel reads
vercel.jsonat the repo root automatically:- Installs dependencies in
frontend/ - Builds with
npm run build - Serves
frontend/dist - Proxies
/api/*to the Render backend
- Installs dependencies in
-
No build-time environment variables are required if you use the
/apiproxy (the default infrontend/src/api/client.js). -
Optional: bypass the Vercel proxy and call Render directly by setting this in the Vercel project settings:
VITE_API_BASE_URL=https://<your-render-service>.onrender.com/apiCORS is already configured on the backend for Vercel domains.
- Production domain: add it to
DJANGO_CORS_ALLOWED_ORIGINSandDJANGO_CSRF_TRUSTED_ORIGINSon Render. - Preview deployments (
*.vercel.app): already allowed viaDJANGO_CORS_ALLOWED_ORIGIN_REGEXES.
Update the /api rewrite destination in vercel.json.
cd backend
$env:NEON_DATABASE_URL="postgresql://USER:PASSWORD@HOST.neon.tech/neondb?sslmode=require"
python manage.py migrate
python manage.py seed_demo
python manage.py runserver 127.0.0.1:8000API root: http://127.0.0.1:8000/api/
cd frontend
npm install
npm run dev -- --host 127.0.0.1 --port 5174App URL: http://127.0.0.1:5174/
The Vite dev server proxies /api to http://127.0.0.1:8000 by default. Override with VITE_DEV_API_PROXY in frontend/.env if needed.
Sign up first, then sign in with the created account. Account records are stored in Neon through Django.
| Variable | Where | Purpose |
|---|---|---|
NEON_DATABASE_URL |
Render (required) | Neon Postgres connection string |
DJANGO_SECRET_KEY |
Render | Django secret (auto-generated by Blueprint) |
DJANGO_DEBUG |
Render | Must be false in production |
DJANGO_ALLOWED_HOSTS |
Render | Comma-separated hostnames |
DJANGO_CORS_ALLOWED_ORIGINS |
Render | Allowed frontend origins |
VITE_API_BASE_URL |
Vercel (optional) | Direct backend URL; default is /api proxy |
VITE_DEV_API_PROXY |
Local frontend only | Vite dev proxy target |
See .env.example (backend) and frontend/.env.example (frontend) for the full list.