Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/luiss811/Backend-Airguide/llms.txt

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

AirGuide runs as six independent Node.js processes managed together by concurrently. In development, each process uses tsx watch for hot reload. In production, you compile TypeScript to JavaScript first, then start the compiled output. This page covers what you need to do to go from a fresh clone to a running production deployment.

Development vs production

DevelopmentProduction
Commandnpm run devnpm run build && npm start
Runtimetsx watch (TypeScript, hot reload)node (compiled JavaScript)
Sourcesrc/dist/
NODE_ENVdevelopmentproduction
Error detail in responsesVerboseSuppressed

Production deployment

1

Set environment variables

Configure your .env file (or your hosting platform’s environment variable settings) with production values:
NODE_ENV="production"
DATABASE_URL="postgres://<user>:<password>@<host>:5432/<db>?sslmode=require"
API_URL="https://api.yourdomain.com/api"
API_KEY="<your-google-api-key>"
JWT_SECRET="<long-random-secret>"
JWT_EXPIRES_IN="1d"
CORS_ORIGIN="https://app.yourdomain.com"
SMTP_HOST="smtp.gmail.com"
SMTP_PORT="587"
SMTP_SECURE="false"
SMTP_USER="no-reply@yourdomain.com"
SMTP_PASS="<app-password>"
SMTP_FROM="AirGuide <no-reply@yourdomain.com>"
Always set a unique, randomly generated JWT_SECRET in production. The example value in the README is public and must not be used in any real deployment. Tokens signed with a known secret can be forged.
Set CORS_ORIGIN to your deployed frontend domain. Any browser request from a different origin will be rejected by the gateway.
2

Build the TypeScript source

Compile all services to JavaScript:
npm run build
This runs tsc using the project’s tsconfig.json and outputs compiled files to the dist/ directory, preserving the same folder structure as src/.
3

Run database migrations

Before starting the services, make sure your production database is up to date:
npm run prisma:migrate
If you’re deploying to an environment where prisma migrate dev is not available (e.g. a locked-down CI pipeline), use npx prisma migrate deploy instead — it applies pending migrations without prompting.
4

Start all services

Launch all six services concurrently:
npm start
concurrently starts each compiled entry point as a separate process and streams all logs to stdout with color-coded prefixes. The gateway is available at http://localhost:3001 once all processes are running.

Service processes and ports

The npm start command runs all six processes simultaneously:
ProcessEntry pointPort
API Gatewaydist/gateway/index.js3001
Auth Servicedist/services/auth-service/index.js3011
Buildings Servicedist/services/buildings-service/index.js3012
Events Servicedist/services/events-service/index.js3013
Navigation Servicedist/services/navigation-service/index.js3014
Analytics Servicedist/services/analytics-service/index.js3015
All client traffic should go through the API Gateway on port 3001. The individual service ports are available for direct access during development and debugging, but you should not expose them publicly in production.

Health check

The API Gateway exposes a health check endpoint you can use with load balancers and uptime monitors:
GET /health
A successful response looks like:
{
  "status": "ok",
  "timestamp": "2026-05-21T00:00:00.000Z",
  "service": "API Gateway"
}
Use this endpoint to confirm the gateway started correctly after deployment.

npm script reference

ScriptCommandDescription
Developmentnpm run devStarts all services with tsx watch and hot reload
Buildnpm run buildCompiles TypeScript source to dist/
Production startnpm startRuns all compiled services with concurrently

Build docs developers (and LLMs) love