SmartAttend-IoT is an automated attendance system that leverages facial recognition technology on an edge IoT device. Running on a Raspberry Pi (or desktop for development), it captures video, identifies registered students in real time, displays status on an I2C OLED screen with buzzer feedback, and syncs attendance data with a central FastAPI backend. A Nuxt.js web dashboard allows administrators to manage students and view attendance reports.
The system follows a client-server architecture where the IoT device acts as a smart edge client โ performing face detection and matching locally for speed, while syncing records to the cloud for persistence and administration.
face_recognition library, matched against a local database in a dedicated background thread for zero UI blockingVideoCapture)โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ IoT Edge Device (Raspberry Pi) โ
โ โ
โ Camera โ Recognition Engine โ Matcher โ
โ โ โ โ
โ OLED Display API Client โ
โ + Buzzer โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
HTTP REST API
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Server Side โ
โ โ
โ FastAPI Backend โโ SQLite/PostgreSQL โ
โ โ โ
โ Nuxt.js Dashboard (Admin) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
GET /students/sync to download all face encodingsPOST /attendanceaiosqlite (dev) and PostgreSQL (prod)SmartAttend-IoT/
โโโ backend/ # FastAPI Server
โ โโโ main.py # API entry point & endpoints
โ โโโ models.py # SQLAlchemy DB models (Student, Attendance)
โ โโโ schemas.py # Pydantic validation schemas
โโโ core/ # IoT Device Logic
โ โโโ api_client.py # HTTP client for backend sync
โ โโโ camera.py # Camera hardware abstraction (Factory pattern)
โ โโโ recognition.py # Face detection & matching (threaded)
โ โโโ database.py # Local SQLAlchemy DB connection
โโโ frontend/ # Nuxt.js Web Dashboard
โ โโโ app/ # Vue components & pages
โ โโโ nuxt.config.ts # Nuxt configuration
โโโ tests/ # Unit tests with mock camera
โโโ main.py # IoT device entry point
โโโ train.py # Batch face encoding trainer
โโโ requirements.txt # Python dependencies
The system supports dual deployment:
main.py on Raspberry Pi with camera, OLED, and buzzer connected โ performs local face recognition and syncs to backend