Installation
Prerequisites
- Node.js 20+
- Docker (for Database and Redis services)
Local Development
1. Start Infrastructure
We provide a docker-compose.yml that spins up the entire ecosystem:
- MySQL 8 (Primary DB)
- Redis (Cache & PubSub)
- RTSPtoWeb (Stream proxy options)
- MediaMTX (RTSP Server for testing with fake streams)
- Prometheus & Grafana (Monitoring)
cd Control-Hub-Back
docker-compose up -d --build
2. Configure Environment
Copy .env.example -> .env.
Key Variables:
APP_KEY: 32-char generic secret.DB_MAIN_*: Database credentials (default:root/rootin docker-compose).REDIS_*: Redis connection (default:localhost/6379).RTSP_TO_WEB_URL: URL of the Go service (e.g.http://localhost:8083).TWILIO_*: (Optional) For SMS alerts.VAPID_*: (Optional) For Web/Mobile Push notifications.
3. Run Migrations & Seed
Initialize the DB schema:
# If running locally via Node
node ace migration:run
node ace db:seed
# If running inside Docker
docker exec -it adonis-dev node ace migration:run
docker exec -it adonis-dev node ace db:seed
4. Available Scripts
| Command | Description |
|---|---|
npm run dev | Start dev server with HMR. |
npm run docs | Generate TypeDoc (API reference). OpenAPI/Swagger is exposed at runtime by the API. |
npm run typecheck | Run TypeScript validation without emitting. |
npm run format | Prettier fix. |