Skip to content

Project Architecture

Tim-Smans edited this page May 23, 2025 · 1 revision

Project Architecture

This page describes the high-level architecture of the Student Attendance Tracking System, detailing the data flow from edge devices (Raspberry Pi) to cloud infrastructure (GKE) and frontend presentation.


System Diagram

Architecture High-Level Architecture of the Student Attendance Tracking System


Components

Edge Device: Raspberry Pi

  • Input: Camera module streams live video.
  • Processing: Tesseract OCR reads student id data from image snapshots.
  • Transmission: Parsed data is sent via HTTP POST to the backend API.

Backend: FastAPI (Containerized in Kubernetes)

  • Exposed via an Ingress LoadBalancer.
  • Horizontally scalable using multiple API replicas.
  • Handles HTTP requests, parses data, and stores it using SQLAlchemy into the database.

Database: PostgreSQL

  • Centralized single-instance PostgreSQL server.
  • Stores student records, timestamps, sessions, devices and classgroups

Monitoring Stack

  • Prometheus scrapes API, system metrics and edge device health.
  • Grafana visualizes these metrics through custom dashboards.

Frontend: Vue.js

  • Fetches data from the backend API.
  • Displays student attendance records in an intuitive dashboard interface. Also allows teachers to create new sessions

Data Flow

  1. Camera Input: Streams video to Raspberry Pi.
  2. Tesseract OCR: Detects and decodes student id's in real time.
  3. HTTP POST: Raspberry Pi sends decoded data to the FastAPI backend.
  4. API Layer: Validates and stores the data using SQLAlchemy.
  5. Monitoring: Prometheus gathers metrics, Grafana displays them.
  6. Edge Metrics: Raspberry Pi sends health/resource metrics to Prometheus.
  7. Dashboard: Vue frontend fetches and renders the attendance data.

Infrastructure

  • Hosted on Google Cloud using Google Kubernetes Engine (GKE).
  • Infrastructure managed via Terraform (VPC, node pools, services).
  • Full container orchestration using Kubernetes manifests.

Scalability & Fault Tolerance

  • Backend pods are replicated and stateless.
  • Ingress LoadBalancer enables smooth request routing.
  • Observability with Grafana ensures health insights and rapid troubleshooting.

Security (Planned)

  • HTTPS termination at ingress level.
  • Authentication/Authorization for frontend dashboard.
  • Secure communication between edge devices and API.

Notes

  • This system is modular: backend, frontend, and edge processing can evolve independently.
  • Planned future additions include role-based access controls.

Clone this wiki locally