Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Antonelli-Tech-Solutions/spades/llms.txt

Use this file to discover all available pages before exploring further.

The Spades Online server reads all of its configuration from environment variables at startup — there are no config files to edit or .env schemas to maintain. Set the variables in your shell, your hosting platform’s dashboard, or a process manager before running npm start. Only DATABASE_URL and REDIS_URL are strictly required; every other variable has a sensible default.

Required

DATABASE_URL
string
required
PostgreSQL connection string. The server uses this to connect the shared pg pool used by all route handlers.Example: postgresql://user:password@localhost:5432/spades
REDIS_URL
string
required
Redis connection string. Used for sessions, lobby state, presence tracking, pub/sub notifications, and the rate limiter.Example: redis://localhost:6379

Server & WebSocket

PORT
number
HTTP server port. Default: 3000
WS_PORT
number
WebSocket server port. Default: same as PORT (the WebSocket server shares the HTTP server).When set to the same value as PORT, the WebSocket server attaches to the existing HTTP server. When set to a different value, the WebSocket server starts on its own dedicated HTTP server.
When WS_PORT differs from PORT, a reverse proxy must be configured to route WebSocket upgrade requests from the public HTTP port to WS_PORT. Without this, browser clients connecting to the standard HTTP port will not be able to establish WebSocket connections.
WS_URL
string
Full WebSocket base URL. Default: derived from the incoming request origin.Set this in split-host deployments where the WebSocket server runs on a different host than the frontend (for example, a Vercel frontend paired with a Railway WebSocket server). When set, the server injects window.__WS_URL__ into the served HTML so the browser client connects to the correct host.Example: wss://my-app.up.railway.app

Application

NODE_ENV
string
Environment name. Typical values: development, production. Default: unset.
APP_URL
string
Public base URL of the application. Used to construct absolute URLs in outbound emails (email verification links, password reset links) and in shareable join/spectator link responses. Default: http://localhost:3000Example: https://spades.example.com

Email (SMTP)

The server uses Nodemailer to send transactional emails (account verification and password reset). If EMAIL_HOST is not set, emails are logged to stdout instead of being delivered — useful for local development without an SMTP server.
EMAIL_HOST
string
SMTP hostname. If unset, verification and password reset emails are printed to stdout instead of being sent.Example: smtp.mailgun.org
EMAIL_PORT
number
SMTP port. Default: 587
EMAIL_SECURE
string
Set to true to enable TLS on port 465. Default: false
EMAIL_USER
string
SMTP username for authentication. Default: unset.
EMAIL_PASS
string
SMTP password for authentication. Default: unset.
EMAIL_FROM
string
The From address used on all outbound emails. Default: noreply@spades.onlineExample: Spades Online <noreply@spades.example.com>

Authentication

AUTH_RATE_LIMIT_MAX
number
Maximum number of requests allowed per window for unauthenticated auth endpoints (/api/auth/*). Default: 10
AUTH_RATE_LIMIT_WINDOW
number
Rate limit window duration in seconds. Default: 900 (15 minutes)
DEV_AUTO_VERIFY
string
Set to true to skip email verification on registration. When active, POST /api/auth/register marks new accounts as verified immediately, creates a session, and returns it — no email is sent and no token is required.The flag is read at request time, so it can be toggled without restarting the server.Default: unset (email verification is enforced).
DEV_AUTO_VERIFY=true bypasses all email verification security. Never set this variable in a production environment. It exists solely as a local development convenience for testing without an SMTP server.

CI / Build Info

GIT_BRANCH
string
The current Git branch name. Typically set by your CI system. Default: unset.
GIT_COMMIT_SHA
string
The full Git commit SHA of the running build. Exposed (as a 7-character short SHA) via GET /api/build-info. Default: unset.If not set, the server automatically checks VERCEL_GIT_COMMIT_SHA (Vercel), then COMMIT_REF (Netlify), then falls back to running git rev-parse HEAD. If none of these are available, GET /api/build-info returns { commitShort: null }.
PUSH_API_KEY
string
API key for the push notification service. Default: unset.

Build docs developers (and LLMs) love