Backend Environment
Set these variables in your local shell or in a local env file before running the backend. Env files must never be committed.
Server
| Variable | Default | Purpose |
|---|---|---|
PORT | 3333 | Listening port. |
HOST | 127.0.0.1 in development, 0.0.0.0 in production | Bind address. |
NODE_ENV | development | Runtime mode. |
CORS_ORIGIN | http://localhost:5173 | Allowed browser origin. |
TRUST_PROXY | false | Set to 1 behind an Nginx/PM2 reverse proxy. |
Database
| Variable | Required | Purpose |
|---|---|---|
DATABASE_URL | yes, for DB access | Postgres connection string, e.g. postgresql://postgres:postgres@localhost:5432/amadeq?schema=public. |
Live demo
| Variable | Default | Purpose |
|---|---|---|
PIXEL_STREAM_URL | unset | Optional; returned by /demo-config. |
DEMO_MAX_CONNECTIONS | 10 | Concurrent demo connection cap. |
DEMO_STATUS | offline | One of online, busy, offline. |
Frontend redirects
| Variable | Default | Purpose |
|---|---|---|
FRONTEND_APP_URL | http://localhost:5173 | Used for Stripe Checkout success/cancel redirects. |
SMTP
Used by the contact form.
| Variable | Default | Purpose |
|---|---|---|
SMTP_HOST | — (required) | SMTP server. |
SMTP_PORT | 587 | Use 465 for implicit TLS. |
SMTP_USER | — (required) | SMTP auth user. |
SMTP_PASS | — (required) | SMTP auth password. |
SMTP_SECURE | true when SMTP_PORT=465, otherwise false | Implicit TLS toggle. |
SMTP_TLS_REJECT_UNAUTHORIZED | Node.js TLS verification default | Set to false only for a local/dev SMTP server with a self-signed certificate chain. Production must use a trusted chain instead. |
SMTP_FROM | AMADEQ Partnerships <SMTP_USER> | Sender address. |
SMTP_TO | partnerships@amadeq.com | Recipient address. |
Stripe
| Variable | Purpose |
|---|---|
STRIPE_SECRET_KEY | Required for payments. |
STRIPE_WEBHOOK_SECRET | Required for webhook verification. |
STRIPE_PRICE_EARLY_ACCESS | Stripe Price ID for the Individual plan. |
STRIPE_PRICE_FOUNDERS | Stripe Price ID for the Founders plan. |
See Stripe Checkout.
Upstream services
| Variable | Default | Purpose |
|---|---|---|
LIS_API_URL / LIS_API_KEY | — | LIS chat gateway. The /api/lis proxy injects the key server-side as X-Api-Key; it is never exposed to the browser. |
RENDER_API_URL | — | Video render worker. The /api/render proxy forwards the user's Bearer JWT. |
WS_AGENT_API_URL | https://ws-agent.nezlamna-online.education | Dynamic-avatars service. The /api/ws-agent proxy derives user_id from the JWT and injects X-Api-Key + X-User-ID server-side. |
WS_AGENT_API_KEY | — | Service secret for ws-agent. Sent as X-Api-Key, never exposed to the browser. |
WS_AGENT_API_KEY is a dedicated key, distinct from LIS_API_KEY. ws-agent protects /api/users/<id>/avatars with its own X-Api-Key and rejects the LIS key with 401.
Prisma workflow
Before changing prisma/schema.prisma, read Database Migrations.
This project uses a shared Neon Postgres database with all app tables in the non-default web schema. Do not run npx prisma migrate dev, --create-only, or npx prisma db push against that database: none of them is a safe migration workflow here.
The approved flow is: update the schema, hand-write a schema-qualified migration, apply it with prisma migrate deploy using the required search_path URL option, run npx prisma generate, then restart the backend. The full commands and verification steps are maintained in Database Migrations.