Environment Variables

Complete reference of all environment variables across ZapTicket services — backend, dashboard, widget, marketing, and docs.

Overview

ZapTicket is a monorepo with multiple services, each requiring its own set of environment variables. This page lists every variable for every service with descriptions and example values.

🚨Never commit secrets to version control. Use environment variable injection via your hosting provider (Coolify UI, Docker secrets, etc.) for production deployments.

Backend (.NET API)

backend/.env
# Database
ConnectionStrings__DefaultConnection=Host=localhost;Database=zapticket_dev;Username=zapticket;Password=zapticket_local

# Authentication
JWT_SECRET=your-secret-key-must-be-at-least-32-characters-long
JWT_ISSUER=zapticket-api
JWT_AUDIENCE=zapticket-clients
JWT_EXPIRY_HOURS=1

# Application
ASPNETCORE_ENVIRONMENT=Development|Production
ASPNETCORE_URLS=http://+:5000

# Migrations
RUN_MIGRATIONS_ON_STARTUP=true|false

# CORS
CORS_ORIGINS=http://localhost:3000,http://localhost:3001

# Email (optional — for verification emails)
SMTP_HOST=smtp.resend.com
SMTP_PORT=587
SMTP_USERNAME=resend
SMTP_PASSWORD=re_xxxxxxxxxxxx
[email protected]
SMTP_FROM_NAME=ZapTicket

# Rate Limiting
RATE_LIMIT_PER_IP=100
RATE_LIMIT_PER_SITE_KEY=60
RATE_LIMIT_AUTH=10

Variable Details — Backend

Reference Table
Variable                              │ Required │ Default     │ Description
──────────────────────────────────────┼──────────┼─────────────┼─────────────────────────────
ConnectionStrings__DefaultConnection  │ Yes      │ —           │ PostgreSQL connection string
JWT_SECRET                            │ Yes      │ —           │ HMAC signing key for JWTs (min 32 chars)
JWT_ISSUER                            │ No       │ zapticket   │ JWT iss claim value
JWT_AUDIENCE                          │ No       │ zapticket   │ JWT aud claim value
JWT_EXPIRY_HOURS                      │ No       │ 1           │ Token lifetime in hours
ASPNETCORE_ENVIRONMENT                │ No       │ Production  │ Runtime environment
ASPNETCORE_URLS                       │ No       │ http://+:5000 │ Listening URLs
RUN_MIGRATIONS_ON_STARTUP             │ No       │ false       │ Auto-run EF migrations on startup
CORS_ORIGINS                          │ No       │ *           │ Comma-separated allowed origins
SMTP_HOST                             │ No       │ —           │ SMTP server for email sending
SMTP_PORT                             │ No       │ 587         │ SMTP port
SMTP_USERNAME                         │ No       │ —           │ SMTP auth username
SMTP_PASSWORD                         │ No       │ —           │ SMTP auth password
SMTP_FROM_EMAIL                       │ No       │ —           │ Sender email address
SMTP_FROM_NAME                        │ No       │ ZapTicket   │ Sender display name
RATE_LIMIT_PER_IP                     │ No       │ 100         │ Requests/min per IP
RATE_LIMIT_PER_SITE_KEY               │ No       │ 60          │ Requests/min per site key
RATE_LIMIT_AUTH                        │ No       │ 10          │ Auth attempts per 5 min per IP

Dashboard (Next.js)

dashboard/.env.local
# API Connection
NEXT_PUBLIC_API_URL=http://localhost:5000
NEXT_PUBLIC_SIGNALR_URL=http://localhost:5000/hubs/chat

# App
NEXT_PUBLIC_APP_NAME=ZapTicket
NEXT_PUBLIC_APP_URL=http://localhost:3000

# Port (used by Coolify/Railpack)
PORT=3000

Variable Details — Dashboard

Reference Table
Variable                  │ Required │ Default                │ Description
──────────────────────────┼──────────┼────────────────────────┼──────────────────────────────
NEXT_PUBLIC_API_URL       │ Yes      │ —                      │ Backend API base URL
NEXT_PUBLIC_SIGNALR_URL   │ Yes      │ —                      │ SignalR hub URL
NEXT_PUBLIC_APP_NAME      │ No       │ ZapTicket              │ Display name in UI
NEXT_PUBLIC_APP_URL       │ No       │ http://localhost:3000   │ Dashboard URL (for links)
PORT                      │ No       │ 3000                   │ HTTP listen port

Widget (Next.js)

widget/.env.local
# API Connection
NEXT_PUBLIC_API_URL=http://localhost:5000
NEXT_PUBLIC_SIGNALR_URL=http://localhost:5000/hubs/chat

# Widget
NEXT_PUBLIC_WIDGET_URL=http://localhost:3001

# Port
PORT=3000

Variable Details — Widget

Reference Table
Variable                  │ Required │ Default                │ Description
──────────────────────────┼──────────┼────────────────────────┼──────────────────────────────
NEXT_PUBLIC_API_URL       │ Yes      │ —                      │ Backend API base URL
NEXT_PUBLIC_SIGNALR_URL   │ Yes      │ —                      │ SignalR hub URL
NEXT_PUBLIC_WIDGET_URL    │ No       │ http://localhost:3001   │ Widget iframe/CDN URL
PORT                      │ No       │ 3000                   │ HTTP listen port

Marketing Site (Next.js)

marketing/.env.local
# Links
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_DOCS_URL=http://localhost:3002

# Port
PORT=3000

Docs Site (Next.js)

docs-site/.env.local
# Links
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:5000

# Port
PORT=3000

Production Example

In production, all NEXT_PUBLIC_* URLs should point to your actual domains:

Production URLs
NEXT_PUBLIC_API_URL=https://api.zapticket.app
NEXT_PUBLIC_SIGNALR_URL=https://api.zapticket.app/hubs/chat
NEXT_PUBLIC_APP_URL=https://app.zapticket.app
NEXT_PUBLIC_WIDGET_URL=https://widget.zapticket.app
NEXT_PUBLIC_DOCS_URL=https://docs.zapticket.app
āš ļøVariables prefixed with NEXT_PUBLIC_ are bundled into the client-side JavaScript. Never put secrets in NEXT_PUBLIC_ variables — they are visible to anyone who views source.