AirGuide runs as six independent Node.js processes managed together by concurrently. In development, each process usesDocumentation 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.
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
| Development | Production | |
|---|---|---|
| Command | npm run dev | npm run build && npm start |
| Runtime | tsx watch (TypeScript, hot reload) | node (compiled JavaScript) |
| Source | src/ | dist/ |
NODE_ENV | development | production |
| Error detail in responses | Verbose | Suppressed |
Production deployment
Set environment variables
Configure your Set
.env file (or your hosting platform’s environment variable settings) with production values:CORS_ORIGIN to your deployed frontend domain. Any browser request from a different origin will be rejected by the gateway.Build the TypeScript source
Compile all services to JavaScript:This runs
tsc using the project’s tsconfig.json and outputs compiled files to the dist/ directory, preserving the same folder structure as src/.Run database migrations
Before starting the services, make sure your production database is up to date: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.Service processes and ports
Thenpm start command runs all six processes simultaneously:
| Process | Entry point | Port |
|---|---|---|
| API Gateway | dist/gateway/index.js | 3001 |
| Auth Service | dist/services/auth-service/index.js | 3011 |
| Buildings Service | dist/services/buildings-service/index.js | 3012 |
| Events Service | dist/services/events-service/index.js | 3013 |
| Navigation Service | dist/services/navigation-service/index.js | 3014 |
| Analytics Service | dist/services/analytics-service/index.js | 3015 |
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:A successful response looks like:Use this endpoint to confirm the gateway started correctly after deployment.
npm script reference
| Script | Command | Description |
|---|---|---|
| Development | npm run dev | Starts all services with tsx watch and hot reload |
| Build | npm run build | Compiles TypeScript source to dist/ |
| Production start | npm start | Runs all compiled services with concurrently |
