Frontend variables
Create a.env.local file in the project root (next to package.json).
.env.local
| Variable | Required | Default | Description |
|---|---|---|---|
NEXT_PUBLIC_API_URL | Yes | http://localhost:5000/api | Full URL of the Express backend API, including the /api prefix. Change this to your hosted backend URL in production. |
NEXT_PUBLIC_SUPABASE_URL | Yes | — | Your Supabase project URL. Found in Project Settings → API in the Supabase dashboard. |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Yes | — | Your Supabase project’s anon/public key. Found in Project Settings → API in the Supabase dashboard. |
Variables prefixed with
NEXT_PUBLIC_ are exposed to the browser bundle. Do not put secrets in NEXT_PUBLIC_ variables.Backend variables
Create a.env file inside the backend/ directory.
backend/.env
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | Yes | — | PostgreSQL connection string. Format: postgresql://user:password@host:port/database |
JWT_SECRET | Yes | — | Secret key used to sign and verify JWTs. Must be a long random string in production. |
PORT | No | 5000 | Port the Express server listens on. |
NODE_ENV | No | development | Runtime environment. Set to production for deployed instances. |
DATABASE_URL
Prisma readsDATABASE_URL directly from the environment to connect to PostgreSQL:
backend/prisma/schema.prisma
JWT_SECRET
The auth middleware signs and verifies every JWT using this value:backend/src/middleware/auth.ts
PORT
The Express server defaults to5000 if PORT is not set:
backend/src/index.ts
PORT, update NEXT_PUBLIC_API_URL in .env.local to match.