A three-layer AI-powered architecture that detects, processes, stores, and visualizes real-time camera data using edge computing and cloud technologies.
Each layer is independently deployable, communicates via REST APIs, and handles a specific responsibility in the detection pipeline.
Camera-based person detection using AI models. Sends CameraId, DetectionTime, and detection count to the Edge layer via HTTP POST.
Lightweight gateway that receives detection data and immediately forwards it to the Cloud. Stateless, no local storage required.
FastAPI backend processes incoming data, stores in MariaDB, and serves a real-time dashboard with Chart.js line graphs.
Watch data flow from cameras through each layer of the architecture. Every node represents a real component in the system.
Click "Start Simulation" to watch cameras detect people in real-time. Detection events flow through the pipeline and populate the chart below.
The complete request-response flow between all system components, from camera detection to dashboard rendering.
The dashboard and architecture views as deployed.
The Cloud layer exposes these endpoints for data ingestion and retrieval. All communication is JSON over HTTP.
Retrieves all detection data grouped by CameraId. Returns an array of objects with camId and timestamped detection counts.
Accepts dynamic JSON payload with camera-detection pairs. Parses and inserts each entry into the MariaDB camera table.
Accepts a Pydantic BaseModel with fixed 5-camera structure (cam1-cam5). Type-safe validation before database insertion.
Flexible endpoint accepting both dict and JSON string payloads. Auto-detects format and inserts detection records.
MariaDB stores all detection events in a single optimized table. Auto-increment PK, auto-timestamping, and indexed by CameraId.
| Column | Type | Description |
|---|---|---|
| Id PK | INT AUTO_INCREMENT | Primary key. Unique identifier for each detection event. |
| CameraId | VARCHAR(50) | Unique identifier of the camera (e.g., cam1, cam2). |
| DetectionTime | DATETIME DEFAULT NOW() | Timestamp when the detection occurred. Auto-set on insert. |
| Detections | INT DEFAULT 0 | Number of people detected in the camera frame. |
The entire Cloud layer runs as two Docker containers on a shared bridge network. One command to deploy: docker-compose up.
FastAPI application built from Python 3.10-slim. Serves the REST API and static dashboard files. Auto-restarts with Uvicorn.
MariaDB 10.5 with auto-initialized schema. Database and tables created on first boot via mounted init.sql script.
Bridge network connecting both containers. Services communicate via Docker DNS using service names as hostnames.
Built as a collaborative project at FH Kärnten, combining expertise from Cloud, Edge, and ML teams.
I build end-to-end systems from edge devices to cloud dashboards. Let's discuss your architecture.