Deployment Guide
Infrastructure Stack
The system is fully containerized using Docker. All services are orchestrated via docker-compose.yml.
Services
- server-nest: Main backend API (Node.js 20).
- client: React Admin Dashboard (Nginx).
- mongodb: Primary database (v6.0).
- redis: Cache and Pub/Sub (v7.0).
- mosquitto: MQTT Broker for device communication (v2.0).
- nginx-proxy: Reverse proxy handling SSL and routing (ports 80/443).
- monitoring: Grafana + Prometheus stack.
Railway Deployment
For the documentation sites specifically, we use Railway.
- Public Docs: Deployed as a static site (build output).
- Internal Docs: Deployed as a Docker container using the
docs/internal/deploy/Dockerfilewhich includes Nginx Basic Auth.
Environment Variables
Key variables required for production:
DATABASE_URL: MongoDB connection string.REDIS_URL: Redis connection string.JWT_SECRET: Secret for signing tokens.MQTT_BROKER_URL: Internal MQTT URL.CLOUDINARY_*: For file uploads.
Backup & Recovery
Automated backups run daily.
- Database:
mongodumpruns via a scheduled cron job container. - Configuration: System settings are exported to JSON in
server-nest/backups/.