Backend Case Study

Classroom IoT Management System

A backend platform that unifies bookings, live room state, and IoT device events into a single system.

BackendIoTAPIsReal-time

Problem

Universities manage bookings, room availability, and access control across disconnected systems, leading to inconsistent data and no real-time visibility of room usage.

Goal

Design a unified backend that centralises bookings, tracks live room state, and integrates IoT devices while supporting real-time updates efficiently.

System Architecture

The system was built as a modular backend combining synchronous APIs with asynchronous real-time and IoT communication.

  • REST APIs for bookings, schedules, and user management
  • WebSocket layer for real-time dashboard updates
  • MQTT integration for IoT devices (RFID, sensors)
  • Cloud-hosted relational database for persistent state

API & Data Design

  • POST /bookings – create and manage classroom bookings
  • GET /rooms/status – retrieve live room availability
  • POST /rfid/validate – validate physical access requests
  • Normalized relational schema for users, rooms, and schedules
  • JWT-based authentication and role-based access control
  • Event data stored separately from booking data to reduce coupling

Key Decisions & Trade-offs

  • Chose a modular monolith over microservices to reduce operational overhead while keeping clear service boundaries
  • Used WebSockets instead of polling to minimise latency and server load
  • Deferred advanced observability tooling to focus on correctness and system flow at MVP stage

Tech Stack

Python · Flask · REST APIs · WebSockets · MQTT · Google Cloud SQL · Docker · Raspberry Pi

Links

Live demo (WIP)