📡 IoT + Cloud Project

Edge-to-Cloud Detection Pipeline

A three-layer AI-powered architecture that detects, processes, stores, and visualizes real-time camera data using edge computing and cloud technologies.

3
Layer Architecture
5
Camera Feeds
RT
Real-Time Dashboard
🐳
Fully Containerized

Three-Layer Architecture

Each layer is independently deployable, communicates via REST APIs, and handles a specific responsibility in the detection pipeline.

1 🧠

AI / ML Layer

Camera-based person detection using AI models. Sends CameraId, DetectionTime, and detection count to the Edge layer via HTTP POST.

2

Edge Layer

Lightweight gateway that receives detection data and immediately forwards it to the Cloud. Stateless, no local storage required.

3 ☁️

Cloud Layer

FastAPI backend processes incoming data, stores in MariaDB, and serves a real-time dashboard with Chart.js line graphs.

Animated Detection Pipeline

Watch data flow from cameras through each layer of the architecture. Every node represents a real component in the system.

📡 Edge-to-Cloud Data Pipeline
Real-time detection data flowing through the architecture
Layer 1: AI / ML Detection
📷
IP Cameras
5 Feeds
🧠
AI Person Detection
ML Model
📊
Count & Timestamp
JSON Payload
📤
HTTP POST
REST API
Layer 2: Edge Gateway
Edge Receiver
Stateless
🔄
Data Forwarding
Pass-through
📡
Cloud Push
HTTP POST
Layer 3: Cloud Processing & Visualization
🚀
FastAPI Backend
Port 8000
🗄️
MariaDB Storage
Port 3309
🔌
REST API /getAll
JSON Response
📈
Live Dashboard
Chart.js
AI / ML
Edge
Cloud
Dashboard
Data / Storage

Live Detection Simulator

Click "Start Simulation" to watch cameras detect people in real-time. Detection events flow through the pipeline and populate the chart below.

📡 Camera Detection Feed

Idle
📷
CAM-01
0
detections
📷
CAM-02
0
detections
📷
CAM-03
0
detections
📷
CAM-04
0
detections
📷
CAM-05
0
detections
📊 Detection Timeline (last 20 events)
Waiting for simulation to start...

Sequence Diagram

The complete request-response flow between all system components, from camera detection to dashboard rendering.

Sequence Diagram - Edge to Cloud Detection Pipeline
Sequence diagram showing data flow: Camera → AI Model → Edge → Cloud API → MariaDB → Dashboard

System in Action

The dashboard and architecture views as deployed.

Dashboard Overview - Edge to Cloud
Real-time detection dashboard with Chart.js line graph
Architecture Diagram - Edge to Cloud
Component architecture showing Docker containers and network topology

FastAPI Endpoints

The Cloud layer exposes these endpoints for data ingestion and retrieval. All communication is JSON over HTTP.

GET
/getAll

Retrieves all detection data grouped by CameraId. Returns an array of objects with camId and timestamped detection counts.

POST
/pushDetections

Accepts dynamic JSON payload with camera-detection pairs. Parses and inserts each entry into the MariaDB camera table.

POST
/pushDetectionsStatic

Accepts a Pydantic BaseModel with fixed 5-camera structure (cam1-cam5). Type-safe validation before database insertion.

POST
/pushDetections2

Flexible endpoint accepting both dict and JSON string payloads. Auto-detects format and inserts detection records.

Database Schema

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.

Docker Compose Architecture

The entire Cloud layer runs as two Docker containers on a shared bridge network. One command to deploy: docker-compose up.

🚀

cloud-app-2.0

FastAPI application built from Python 3.10-slim. Serves the REST API and static dashboard files. Auto-restarts with Uvicorn.

Port: 8000:8000
Image: Custom (Dockerfile)
Depends: maria_db_2.0
🗄️

cloud-db-2.0

MariaDB 10.5 with auto-initialized schema. Database and tables created on first boot via mounted init.sql script.

Port: 3309:3306
Image: mariadb:10.5
Volume: ./mariadb_data
🔗

cloud-network_2.0

Bridge network connecting both containers. Services communicate via Docker DNS using service names as hostnames.

Driver: bridge
DNS: maria_db_2.0 → :3306
DNS: app → :8000

Built With

🐍 Python ⚡ FastAPI 🐳 Docker 🐳 Docker Compose 🗄️ MariaDB 📈 Chart.js 📡 REST API 🌐 HTML / CSS / JS 📦 jQuery AJAX 🔧 Pydantic 🐧 Linux 🔀 Git

Contributors

Built as a collaborative project at FH Kärnten, combining expertise from Cloud, Edge, and ML teams.

👨‍💻
Hamza Ghaffar
Cloud & Backend Lead
👩‍💻
Ruth Dunthuluri
Team Member
👨‍💻
Atash Afzon Ahmad
Team Member
👨‍💻
Metaliaj Maleni
Team Member

Interested in IoT & Cloud Pipelines?

I build end-to-end systems from edge devices to cloud dashboards. Let's discuss your architecture.