Skip to main content

πŸŽ›οΈ Control Hub Back

The core Backend API and Infrastructure provider for the FirstBreath platform. Built with AdonisJS (Node.js), it manages the primary database (MySQL), caching (Redis), and real-time Websocket communications.

πŸ— Architecture​

This subsystem acts as the central hub:

  1. API Server (AdonisJS): REST API for Frontend and Mobile apps.
  2. Websockets: Real-time events (alerts, status updates) to clients.
  3. Infrastructure:
    • MySQL: Main relational database for the entire platform.
    • Redis: Message broker and cache (used by Vision services for pub/sub).

πŸš€ Getting Started​

Prerequisites​

  • Node.js & Yarn
  • Docker & Docker Compose

Installation​

  1. Clone the repository:

    git clone git@github.com:FirstBreath/Control-Hub-Back.git
    cd Control-Hub-Back
  2. Run with Docker (Recommended):

    docker-compose up --build

    This launches:

    • MySQL
    • Redis
    • AdonisJS API
    • CloudBeaver (DB GUI)

πŸ› οΈ Deployment (Dokploy)​

Configured for Dokploy via docker-compose.dokploy.yml.

  • Network: Connects to monitor-net (external) for monitoring integration.
  • Database: Both MySQL and Redis are exposed to the internal Docker network so other stacks (Vision, Monitoring) can access them.