Automated Identification System using Radio Frequency Technology
A comprehensive student attendance tracking system using RFID technology, built with AdonisJS, Next.js, and Arduino.
Originally developed in 2022-2023 as a school project. Updated and refactored in 2025.
rfid-capstone/
βββ RFID API/ # AdonisJS Backend API (Port 3333)
βββ web/ # Unified Next.js Web App (Port 3000) β¨ NEW!
βββ RFID.Arduino/ # Arduino RFID Reader Firmware
βββ docker-compose.yml # Docker orchestration
βββ DOCKER.md # Docker deployment guide
βββ QUICKSTART.md # Quick start guide
Before: Separate backend/ and frontend/ Next.js apps
Now: Single unified web/ application with:
/admin- Admin dashboard (from old backend)/portal- User portal (from old frontend)/login- Unified login page- Automatic role-based routing
- Option 1 (Docker - Recommended): Docker & Docker Compose
- Option 2 (Local): Node.js v18+, PostgreSQL (or MySQL)
- Arduino with MFRC522 RFID reader
Easiest way to get started with PostgreSQL backend included!
# 1. Configure environment
cp .env.example .env
# Edit .env and set your SERIAL_PORT
# 2. Start all services (API + Web + PostgreSQL)
docker-compose up -d
# 3. Run database migrations
docker-compose exec api node ace migration:run
# 4. Access the application
# Web: http://localhost:3000
# API: http://localhost:3333Upload Arduino firmware (same as local setup below)
π Full Docker guide: See DOCKER.md for detailed instructions
-- PostgreSQL (Recommended)
CREATE DATABASE rfid_db;
-- Or MySQL (Legacy)
CREATE DATABASE rfid_db;cd "RFID API"
npm install
cp .env.example .env
# Edit .env with your database credentials
node ace migration:run
npm run dev # Runs on http://localhost:3333cd web
npm install
npm run dev # Runs on http://localhost:3000- Open
RFID.Arduino/RFID.Arduino.inoin Arduino IDE - Upload to Arduino with MFRC522 RFID reader
- Note the COM port (Windows) or /dev/ttyUSB0 (Linux)
Edit RFID API/.env:
SERIAL_PORT=COM3 # Windows: COM3, Linux: /dev/ttyUSB0
SERIAL_BAUD_RATE=9600PORT=3333
HOST=0.0.0.0
# PostgreSQL (Default)
DB_CONNECTION=pg
PG_HOST=localhost
PG_PORT=5432
PG_USER=rfid_user
PG_PASSWORD=rfid_password
PG_DB_NAME=rfid_db
# Or MySQL (Legacy)
# DB_CONNECTION=mysql
MYSQL_HOST=localhost
MYSQL_USER=root
MYSQL_DB_NAME=rfid_db
MYSQL_PASSWORD=
# Arduino Serial Port
SERIAL_PORT=COM3
SERIAL_BAUD_RATE=9600NEXT_PUBLIC_API_URL=http://127.0.0.1:3333- Live activity monitoring
- Student/Employee/Parent management
- Position & Year level management
- Activity records with filtering
- RFID scanning interface
- Report generation
- Student profiles & attendance
- Employee profiles & activity history
- Parent profiles with linked children
- Activity statistics
- Role-based access (Admin, Student, Employee, Parent)
- JWT token authentication
- Automatic route protection
- Student/Employee scans RFID card on Arduino reader
- Arduino sends data via serial port to API (COM3)
- API looks up user by RFID number
- API creates activity record (In/Out toggle)
- Web app displays updates in real-time
Arduino β MFRC522
SDA(10) β SDA
SCK(13) β SCK
MOSI(11)β MOSI
MISO(12)β MISO
RST(9) β RST
3.3V β 3.3V
GND β GND
Backend: AdonisJS 5 (Node.js framework)
AdonisJS 5 offers a Laravel-like experience for Node.js, making it accessible and reliable.
Frontend: Next.js 15 with React 18
Next.js provides server-side rendering, excellent performance, and a thriving community with abundant resources.
Database: PostgreSQL (primary) / MySQL (legacy support) with Lucid ORM UI: Material-UI, Mantine, Tailwind CSS Hardware: Arduino + MFRC522 RFID reader Serial: SerialPort library Deployment: Docker & Docker Compose
β Completed (2025 Refactor):
- β¨ Merged
backend/andfrontend/into unifiedweb/app - π Migrated from MySQL to PostgreSQL (with MySQL legacy support)
- π³ Added Docker & Docker Compose deployment
- π¦ Updated all dependencies to latest versions (Next.js 15, React 18, AdonisJS 5.9)
- βοΈ Improved API configuration with environment variables
- π§ Made serial port configurable via .env
- π Enhanced authentication with unified login system
Old folders (backend/, frontend/) have been removed. β
- Linux:
/dev/ttyUSB0or/dev/ttyACM0 - Windows: Check Device Manager (e.g., COM3)
- Mac:
/dev/cu.usbserial-*
Update SERIAL_PORT in API .env
- Verify MySQL is running
- Check credentials in
.env - Run migrations:
node ace migration:run
POST /api/users/login- User login
GET /rfid- Trigger RFID scanningGET /rfid/show- Activities summaryGET /rfid/scan- Latest scan eventsGET /users/activity/:id- User activity history
GET /users/employeeIndex- List employeesGET /users/studentIndex- List students
School capstone project for student attendance tracking system.
Updated 2025 - Refactored and modernized with latest dependencies.

