You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A web-based attendance management system for educational institutions that uses RFID technology to track student attendance in real time. It integrates an ESP32-based RFID scanner with a PHP web backend, MySQL database, email notifications, and PDF reporting.
System Overview
┌─────────────────────┐ ┌──────────────────────┐ ┌──────────────┐
│ ESP32 RFID Scanner │────▶│ PHP Web Application │────▶│ MySQL DB │
│ (MFRC522 + LCD) │HTTP │ (rfid_api.php) │ │ (studentdb) │
└─────────────────────┘ └──────────────────────┘ └──────────────┘
│
├──▶ Email Reports (PHPMailer)
├──▶ PDF Reports (Dompdf)
├──▶ CSV Exports
└──▶ MQTT (Adafruit IO)
Tech Stack
Component
Technology
Backend
PHP (plain, no framework)
Database
MySQL 8.x
Frontend
HTML5, CSS3, JavaScript, Chart.js, Font Awesome 6
RFID Hardware
ESP32, MFRC522 RFID module, 16x2 I2C LCD
IoT/MQTT
Adafruit IO
PDF
Dompdf
Email
PHPMailer via Gmail SMTP
Environment
vlucas/phpdotenv
Testing
PHPUnit, Playwright PHP
Package Manager
Composer
File-by-File Guide
Configuration & Setup
File
What it does
.env
Contains secrets. Stores SMTP credentials (Gmail), database connection details. Never commit this to GitHub.
.env.example
Template showing what variables go in .env. Safe to share.
Password change form for all users. Admins also see "Create User" form + system info summary.
Student Management
File
What it does
add_student.php
Register a single student. Auto-generates roll number (<year><dept><3-digit-seq>).
bulk_upload.php
Upload many students at once via CSV. Shows preview before importing.
view_students.php
Searchable student table with delete. Filters by department for non-admin roles.
students_template.csv
CSV template with header row + 2 sample rows for bulk upload.
Attendance
File
What it does
mark_attendance.php
Manually mark attendance: enter RFID UID, select IN/OUT. Shows last 20 marks.
attendance.php
Analytics dashboard with Chart.js charts: pie (IN/OUT split), bar (by department), line (7-day trend), bar (hourly distribution). Date filtering.
rfid_api.php
JSON API for ESP32 scanner. Accepts RFID tag + API key, toggles IN/OUT, returns student info.
Reports & Exports
File
What it does
reports.php
Report generation hub: Daily, Weekly, Monthly, Department, Student reports. Exports to CSV or PDF.
send_email.php
Email attendance reports via SMTP. Supports daily/monthly/yearly periods, personalized PDFs per student, bulk send.
export_csv.php
Quick CSV export of all attendance records.
export_pdf.php
Quick PDF export of all attendance records via Dompdf.
Users & Permissions
File
What it does
rbac.php
Role-Based Access Control config: defines 4 roles (admin, hod, teacher, staff) with ~40 permissions and helper functions.
rbac_helper.php
Utility functions: CSRF protection, permission checks, safe redirects, department scoping.
manage_users.php
Admin-only: list all users with role badges, delete users.
create_user.php
Admin-only: create new user, auto-generates strong 12-char password.
Department Management
File
What it does
manage_departments.php
Admin-only: CRUD for departments. Add/edit/delete with student count tracking.
Arduino / RFID Hardware
File
What it does
Final_IRIS.ino
Contains secrets. ESP32 firmware: connects to WiFi, reads RFID tags via MFRC522, POSTs to rfid_api.php, shows name on LCD, publishes to Adafruit IO MQTT, auto-emails hourly. Never commit this.
Final_IRIS.example.ino
Template version with placeholder credentials. Safe to share.
Database / SQL Files
File
What it does
schema.sql
Full production schema dump of studentdb database
database_schema.sql
Deployment-ready schema with triggers + seed data (departments, users, books)
setup_users.sql
Original users table + sample users
update_users_for_hod.sql
Migration: adds hod role, inserts HOD users
update_users_for_library.sql
Placeholder, no longer relevant
update_departments.sql
Adds ENUM departments to students/attendance tables
department_master_setup.sql
Department table creation + seed + triggers
department_master_optimized.sql
Optimized version with ENUM dept_code + analytical queries
department_queries.sql
7 handy analytical queries for department reporting
IRIS is a smart, modular student management and automation system that uses RFID, sensors, and a XAMPP server to handle attendance, library book tracking, event logging, and offline data storage. It ensures fast, accurate records with seamless sync and standalone operation.