Skip to main content

πŸ—οΈ Global Architecture

FirstBreath is a modular, high-performance monitoring platform designed for equine safety. It relies on a distributed microservices architecture to handle real-time video processing, data analysis, and instant user notifications.

System Overview​

The system is composed of 4 main subsystems that communicate asynchronously.

Subsystems Breakdown​

1. πŸ‘οΈ Vision System​

  • Role: The eyes of the platform. It consumes RTSP streams, performs AI inference, and detects anomalies (Horse down, agitation, etc.).
  • Tech Stack: Python 3.11, OpenCV (CUDA), PyTorch, Ultralytics YOLOv11, TensorRT.
  • Key Components:
    • Camera Manager: Handles RTSP connections and frame grabbing (with hardware decoding).
    • Batch Inference: Aggregates frames from multiple cameras into batches for high-throughput GPU processing.
    • Redis Worker: Consumes detection results, applies temporal smoothing logic, and pushes events to the backend.

2. πŸŽ›οΈ Backend Core (Control Hub)​

  • Role: The brain. It manages users, stable configurations, and routes alerts to the right devices.
  • Tech Stack: AdonisJS (Node.js), TypeScript.
  • Key Responsibilities:
    • API REST: Configuration of cameras and user accounts.
    • Websockets: Pushing real-time alerts to the frontend.
    • Data Persistence: Storing historical data and logs in MySQL.

3. πŸ’Ύ Storage & Messaging​

  • Redis: Acts as the central nervous system. It handles:
    • Hot Queue: Transferring video frames and detection results between Vision services (approx. 150MB/s throughput).
    • Pub/Sub: Notifying the API when an alarm is triggered.
    • Caching: Storing ephemeral camera states.
  • MySQL: Relational storage for reliable long-term data (User profiles, Horse medical records, Alert history).

4. πŸ“± User Interfaces​

  • Showcase / Dashboard: Next.js web application for detailed monitoring and stable management.
  • Mobile App: React Native application for field usage and push notifications.