Backend API for license verification, game server querying, translations, products, contributors, donators, and stats.
This branch runs on Fastify.
npm run dev- Start Fastify in watch modenpm run build- Build placeholder (no compile step required)npm run start- Start Fastify servernpm run update:games- Update game definitionsnpm run fetch:gameicons- Fetch game iconsnpm run sync:translations- Sync translation files nownpm run sync:blueprint- Sync blueprint extensions now
- Install dependencies:
npm install-
Configure
.envwith required credentials and optional sync settings. -
Start development server:
npm run dev- Start production runtime:
npm run startFor a Cloudflare -> Nginx -> API chain, set these values in .env:
PROXY_MODE=cloudflare
TRUST_PROXY=true
TRUST_PROXY_HOPS=1
HOST=0.0.0.0
PORT=3000Use this Nginx location block so client IP forwarding works correctly:
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
# Proxy chain headers
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
# Cloudflare origin client IP headers
proxy_set_header CF-Connecting-IP $http_cf_connecting_ip;
proxy_set_header True-Client-IP $http_true_client_ip;
}Notes:
- Keep Cloudflare proxy enabled for the public DNS record.
- Restrict origin traffic so only Cloudflare can reach Nginx.
- Keep
TRUST_PROXY_HOPS=1when Nginx is the direct upstream for the API.
public/blueprint.json is synced at startup and every 24 hours.
Optional .env settings:
BLUEPRINT_EXTENSIONS_URL=https://api.blueprintframe.work/api/extensions
BLUEPRINT_EXTENSIONS_FALLBACK_URL=https://blueprint.zip/api/extensions
BLUEPRINT_SYNC_COOKIE=
BLUEPRINT_SYNC_USER_AGENT=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
BLUEPRINT_SYNC_ORIGIN=https://blueprintframe.work
BLUEPRINT_SYNC_REFERER=https://blueprintframe.work/
BLUEPRINT_SYNC_INTERVAL_MS=86400000
BLUEPRINT_SYNC_TIMEOUT_MS=20000Translations under public/translations are synced at startup and every 24 hours.
Optional .env settings:
TRANSLATIONS_REPO_OWNER=EuphoriaTheme
TRANSLATIONS_REPO_NAME=blueprint-translations
TRANSLATIONS_REPO_REF=main
TRANSLATIONS_SYNC_INTERVAL_MS=86400000
TRANSLATIONS_SYNC_TIMEOUT_MS=20000
TRANSLATIONS_SYNC_GITHUB_TOKEN=GET /GET /healthGET /openapi.jsonGET /docsGET /public/*GET /statsGET /productsGET /donatorsGET /contributorsGET /translationsPOST /translations/translate/bulkGET /gameapiGET /gameapi/:game/ip=:ip&port=:portPOST /license/verify-licensePOST /license/v2/verify-licenseGET /versionsGET /rcon/healthPOST /rcon/variablesPOST /rcon/players
This API now exposes generated OpenAPI docs for public consumers:
- OpenAPI JSON:
GET /openapi.json - Scalar UI:
GET /docs
Optional .env settings:
API_DOCS_ENABLED=true
API_DOCS_PATH=/docs
OPENAPI_JSON_PATH=/openapi.json
API_TITLE=ED API
API_DESCRIPTION=Public API for licensing, game server querying, translations, metadata, and RCON utilities.
API_VERSION=1.0.0
API_CONTACT_EMAIL=support@euphoriadevelopment.ukGlobal request throttling is enabled by default.
Optional .env settings:
RATE_LIMIT_ENABLED=true
RATE_LIMIT_MAX=120
RATE_LIMIT_TIME_WINDOW=1 minute
RATE_LIMIT_ALLOW_LIST=RATE_LIMIT_ALLOW_LIST accepts a comma-separated list of client IPs to bypass limits.
Optional .env overrides:
LICENSE_API_V1_URL=https://license.euphoriadevelopment.uk/api/v1/validate
LICENSE_API_V2_URL=https://licensing.euphoriadevelopment.uk/api/licenses/validate
LICENSE_API_V2_TOKEN=optional-bearer-token-for-v2POST /license/v2/verify-license body example:
{
"productId": "my-product-id",
"licenseKey": "ABCD-EFGH-IJKL-MNOP",
"hwid": "pc-main-rig-01",
"ip": "203.0.113.10"
}