IR-S is a modern, production-ready microservice-based attendance management system designed for university environments. It replaces traditional paper rolls with a contactless, AI-powered solution using facial recognition and QR codes.
The system eliminates manual attendance marking with an intelligent three-tier architecture: professors manage classes via a real-time dashboard, an AI engine processes biometric verification, and students check in via QR code + selfie authentication.
The project uses a Microservices Architecture with three independent FastAPI applications running on separate ports:
| Service | Port | Purpose | Key Technology |
|---|---|---|---|
| Professor Dashboard | 8000 | Central management hub for class administration and real-time attendance monitoring | FastAPI + Jinja2 + SQLModel |
| AI Engine | 8001 | Biometric processing - face verification using DeepFace FaceNet512 model | FastAPI + DeepFace + CUDA |
| Student Portal | 8002 | Lightweight mobile-friendly check-in interface with QR scanning and selfie capture | FastAPI + Jinja2 |
1. Professor Dashboard (1_prof_dash.py) - Port 8000
- Authentication and session management
- Class creation and student registration
- Live attendance monitoring with real-time updates
- Manual attendance toggle (override capability)
- CSV report generation and export
- Admin controls for system configuration
Grading and Paper Correction - Route: /grading inside the Professor Dashboard
- Create exams for a selected class
- Upload question papers and answer sheets
- Review AI-graded results per student and per question
- Override marks manually when needed
- Export final grades as CSV
2. AI Engine (2_gpu_server.py) - Port 8001
- Heavy computational AI workload isolated from main dashboard
- Facial recognition using DeepFace FaceNet512 embeddings
- Batch processing of student photos for training embeddings
- Real-time selfie verification (1-3 seconds per face)
- GPU acceleration support (NVIDIA CUDA) with CPU fallback
- API endpoints for face verification and database queries
3. Student Portal (3_student_app.py) - Port 8002
- QR code scanner interface (via mobile browser)
- Real-time selfie capture with device camera
- Instant biometric verification feedback
- Enrollment confirmation and status updates
- Lightweight design for low-bandwidth environments
The UI features a modern Apple Keynote-inspired minimalist aesthetic with frosted glass effects and smooth animations:
Design Files:
static/css/iris-design-system.css- Complete CSS framework with variables, components, and animations (550+ lines)static/js/iris-design-system.js- Interactive utilities (modals, sidebar, toast notifications)
Features:
- β¨ Frosted glass effect (backdrop-filter blur)
- π¬ Spring animations for smooth interactions
- π± Responsive sidebar navigation
- π¨ System fonts (SF Pro Display, Segoe UI, -apple-system)
- βΏ WCAG accessible color palette
- π Built-in toast notification system
Zero additional dependencies - all design files included in the project.
IR-S_rev2/
β
βββ 1_prof_dash.py # Professor dashboard (port 8000)
βββ 2_gpu_server.py # AI engine / face verification (port 8001)
βββ 3_student_app.py # Student portal (port 8002)
βββ grading_utils.py # Shared grading helpers
βββ models.py # SQLModel database schemas
βββ migrate_db.py # Database bootstrap / migration helper
βββ update_prof_dash.py # Dashboard update helper
βββ test_grading_system.py # Grading system checks
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variable template
βββ main_app.db # SQLite database (created on first run)
β
βββ core/
β βββ __init__.py
β βββ config.py
β βββ database.py
β βββ models.py
β βββ nv_client.py
β
βββ services/
β βββ __init__.py
β βββ 4_grading_engine.py # Grading pipeline logic
β βββ 5_student_portal.py # Student portal support logic
β βββ grading_runner.py # Background grading runner
β
βββ static/
β βββ css/
β β βββ iris-design-system.css # Main dashboard design system
β β βββ grading.css
β β βββ student_portal.css
β βββ js/
β βββ iris-design-system.js
β
βββ templates/
β βββ attendance.html
β βββ disputes.html
β βββ grading.html # Grading / paper correction interface
β βββ grading_confirm.html
β βββ grading_results.html
β βββ login.html
β βββ manage.html
β βββ register.html
β βββ students.html
β βββ students_import.html
β βββ student_dashboard.html
β βββ student_login.html
β βββ grading/
β β βββ exam_create.html
β β βββ exam_detail.html
β β βββ exams_list.html
β βββ student_portal/
β βββ dashboard.html
β βββ marks.html
β βββ attendance.html
β βββ disputes.html
β
βββ student_db/ # Student training photos
βββ prof_db/ # Professor reports / exports
βββ exam_db/ # Uploaded exam papers
βββ disputes/ # Attendance dispute records
βββ start.sh # Bash startup script
βββ start_all.bat # Windows startup script
βββ design.md
βββ execution.md
βββ todo.md
βββ README.md
- Python 3.9+ (test with
python --version) - pip package manager
- Git for version control
- Webcam/Phone for testing biometric features
- 4GB+ RAM (8GB recommended for AI processing)
- Optional: NVIDIA GPU with CUDA toolkit (for 10x faster face recognition)
# Clone the repository, then open the project folder
cd IR-S_rev2# Windows
python -m venv venv
.\venv\Scripts\activate
# Mac/Linux
python3 -m venv venv
source venv/bin/activatepip install --upgrade pip
pip install -r requirements.txtKey dependencies:
- FastAPI & Uvicorn (web framework)
- SQLModel (ORM database)
- DeepFace (face recognition AI)
- Python-multipart (form file uploads)
- Pillow (image processing)
- QRcode (QR generation)
# Copy template to active configuration
cp .env.example .envEdit .env with your settings:
# Network Configuration (for phone access)
PROF_SERVER=http://192.168.1.15:8000 # Your local IP
STUDENT_URL=http://192.168.1.15:8002 # Your local IP
# Database
DATABASE_URL=sqlite:///./main_app.db
# API Keys (if using external services)
NV_API_KEY=your_nvidia_api_key_here # OptionalFind your local IP:
# Windows
ipconfig | findstr "IPv4"
# Mac/Linux
ifconfig | grep "inet " | grep -v 127.0.0.1Recommended startup order:
- AI Engine on port 8001
- Student Portal on port 8002
- Professor Dashboard on port 8000
Run the one-click launcher from the project root:
.\start_all.batWhat it does:
- Initializes the SQLite database if needed
- Starts the AI Engine
- Starts the Student Portal
- Starts the Professor Dashboard
bash ./start.shThe shell script loads .env, activates venv if available, and starts the same three services.
If you prefer to launch services yourself, open three terminals and run:
Terminal 1 - AI Engine (start first):
.\venv\Scripts\activate
uvicorn 2_gpu_server:app --host 0.0.0.0 --port 8001 --reloadβ
Wait for: Uvicorn running on http://127.0.0.1:8001 or http://0.0.0.0:8001
Terminal 2 - Student Portal:
.\venv\Scripts\activate
uvicorn 3_student_app:app --host 0.0.0.0 --port 8002 --reloadβ
Wait for: Uvicorn running on http://127.0.0.1:8002 or http://0.0.0.0:8002
Terminal 3 - Professor Dashboard (start last):
.\venv\Scripts\activate
uvicorn 1_prof_dash:app --host 0.0.0.0 --port 8000 --reloadβ
Wait for: Uvicorn running on http://127.0.0.1:8000 or http://0.0.0.0:8000
- Local testing: Open
http://127.0.0.1:8000 - Mobile/phone access: Open
http://YOUR_LOCAL_IP:8000(use IP from.env) - Grading page: Open
http://127.0.0.1:8000/gradingafter logging in
Default credentials (if not provided):
- Register a new professor account first
- Set student credentials via the dashboard
- Class Management
- Create a class for a subject and batch.
- Register students with roll number, name, and reference photos.
- Upload a group photo to trigger face verification.
- Live Attendance
- Project the QR code on a screen.
- Students scan the QR, take a selfie, and get verified.
- The attendance table updates live.
- Use manual override switches if you need to correct a row.
- Export the daily attendance report as CSV.
- Grading / Paper Correction
- Open the Grading page from the dashboard sidebar.
- Select a class, then create a new exam.
- Upload the question paper and answer sheets.
- Start grading and wait for the AI pipeline to finish.
- Review results, open per-question breakdowns, override marks if required, and export CSV.
IR-S is split into three user-facing flows:
- Professor Dashboard: manage classes, register students, view live attendance, and run grading.
- AI Engine: handle heavy face verification and photo processing without slowing down the dashboard.
- Student Portal: let students scan a QR code, take a selfie, and check in from a phone browser.
The grading module is not a separate server. It is part of the professor dashboard and uses the shared grading workflow behind /grading, /grading/results/{exam_id}, and /grading/override.
The system uses SQLModel (SQLite) for data and a structured file system for images.
attendance/
β
βββ student_db/ <-- Training Photos Storage
β βββ [Class_Name]/
β βββ stu_[Roll_No]/ <-- Individual Student Photos
β
βββ prof_db/ <-- Reports Storage
β βββ prof_[ID]/
β βββ [Class_Name]/ <-- Generated CSV Reports
β
βββ main_app.db <-- SQLite Database File
βββ templates/ <-- HTML UI Files
βββ static/ <-- Assets Folder
- Modern Design System: Shared dashboard styling across login, class management, attendance, and grading pages
- Responsive Layouts: Sidebar navigation, card-based components, and mobile-friendly forms
- Toast Notifications: Real-time feedback system for user actions
- Keyboard Navigation: Enhanced accessibility with shortcuts and keyboard controls
login.htmlandregister.html- Card-centered authentication interfacestudent_login.html- Selfie check-in page for studentsattendance.html- Live attendance dashboardmanage.html- Class and student management formsgrading.htmlandgrading_results.html- Grading and paper correction pages
static/css/iris-design-system.css- Complete CSS frameworkstatic/js/iris-design-system.js- Component utilities and interactive features
Q: Services fail to start with exit code 1.
- Fix 1: Verify all dependencies are installed:
pip install -r requirements.txt - Fix 2: Check if ports 8000, 8001, 8002 are already in use:
# Windows netstat -ano | findstr ":8000" # Mac/Linux lsof -i :8000
- Fix 3: Ensure
.envexists and has the correct configuration:cp .env.example .env - Fix 4: Try starting services with verbose output:
uvicorn 1_prof_dash:app --host 0.0.0.0 --port 8000 --reload
Q: The QR Code link says "Site Can't Be Reached" on mobile.
- Fix 1: Ensure both laptop and phone are on the same Wi-Fi.
- Fix 2: Use a mobile hotspot if your router blocks local traffic.
- Fix 3: Turn off Windows Firewall temporarily.
- Fix 4: Verify you are using the correct local IP from
.envconfiguration.
Q: "Internal Server Error" when registering.
- Fix: You might be missing a library or have a corrupted DB.
- Run
pip install python-multipart. - Delete
main_app.db. - Restart
1_prof_dash.pyto recreate the database.
- Run
Q: Design system styles not loading (unstyled page).
- Fix 1: Clear browser cache (Ctrl+Shift+Delete).
- Fix 2: Check the browser console for 404 errors on CSS/JS files.
- Fix 3: Verify
static/css/iris-design-system.cssandstatic/js/iris-design-system.jsexist. - Fix 4: Ensure the server is running and accessible at the configured URL.
Q: The AI is slow.
- Fix: Face recognition is heavy. On a CPU, it may take 1-3 seconds per verification. For faster results, run on a machine with an NVIDIA GPU.