Skip to content

About

Secure attendance management system with RFID, TOTP authentication, web applications, and IoT attendance terminals

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” SecureAttend

Secure attendance management with RFID-based identification, TOTP verification, role-based access control, and IoT attendance terminals.

SecureAttend is a full-stack attendance management system designed to address a fundamental weakness in traditional RFID attendance systems: an RFID card alone does not prove that the person holding it is the legitimate student.

The system combines RFID identification with Time-based One-Time Password (TOTP) verification and a centralized backend to provide a more reliable attendance workflow across both web and IoT-based terminals.


πŸ“Œ The Problem

Traditional RFID attendance systems generally treat the RFID card as the identity of the student.

That creates a simple problem:

If someone else has your RFID card, the system may have no way of knowing that they are not you.

SecureAttend approaches the problem differently.

Instead of treating an RFID card as complete authentication, it uses the card to identify the student and TOTP to provide an additional verification factor.

RFID Card
    ↓
Student Identification
    ↓
Temporary Attendance Session
    ↓
TOTP Verification
    ↓
Attendance Recorded

The same backend can serve both browser-based clients and dedicated IoT attendance terminals.


✨ Features

πŸ‘¨β€πŸ’Ό Administration

Administrators can manage users and attendance-related operations, including:

  • Create and manage students
  • Create and manage teachers
  • Assign RFID cards to students
  • View attendance information
  • Monitor attendance eligibility
  • Manage system-level configuration

πŸ‘¨β€πŸ« Teachers

Teachers can:

  • Authenticate through protected login
  • View students
  • Mark attendance manually
  • Generate TOTP setup information for students
  • Monitor attendance records

πŸ‘¨β€πŸŽ“ Students

Students can:

  • Authenticate through the system
  • Configure TOTP-based verification
  • Mark attendance through the web interface
  • Use RFID-based attendance
  • View attendance percentage
  • Check attendance eligibility

πŸ“‘ IoT Attendance Terminal

SecureAttend can interface with an Arduino-based attendance terminal containing:

  • Arduino UNO
  • RC522 RFID reader
  • 16Γ—2 I2C LCD
  • 4Γ—4 matrix keypad
  • Optional buzzer
  • Optional status LEDs

The terminal communicates with the centralized backend over a local network.


πŸ” Authentication Architecture

SecureAttend separates identification from verification.

An RFID card identifies the student associated with the card, while TOTP provides an additional verification factor.

Attendance authentication flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   RFID Card  β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Identify Student   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚
          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Create Temporary   β”‚
β”‚ Attendance Session β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚
          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Request TOTP Code  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚
          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Verify TOTP        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
          β”‚
       Valid?
       /    \
     No      Yes
     β”‚        β”‚
     β–Ό        β–Ό
  Reject    Record
            Attendance

The temporary session prevents the RFID identification step from directly recording attendance.


🌐 Web Attendance Flow

The browser-based workflow follows the same authentication concept:

Student
   β”‚
   β–Ό
RFID / Student Identification
   β”‚
   β–Ό
Backend creates temporary session
   β”‚
   β–Ό
Student enters TOTP
   β”‚
   β–Ό
Backend verifies TOTP
   β”‚
   β–Ό
Attendance recorded

πŸ€– IoT Attendance Flow

The IoT terminal performs the same process through dedicated hardware.

RFID Card
   β”‚
   β–Ό
RC522 Reader
   β”‚
   β–Ό
Arduino
   β”‚
   β–Ό
Backend API
   β”‚
   β–Ό
Temporary Attendance Session
   β”‚
   β–Ό
OTP entered through Keypad
   β”‚
   β–Ό
Backend verifies TOTP
   β”‚
   β–Ό
Attendance recorded
   β”‚
   β–Ό
LCD displays result

The Arduino terminal acts as a client of the backend, rather than maintaining an independent attendance database.

This keeps attendance processing centralized and allows multiple terminals to operate against the same system.


πŸ—οΈ System Architecture

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚      MongoDB        β”‚
                    β”‚      Database       β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–²β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ React Web App │──────▢│   Express   │◀──────│ Arduino Terminalβ”‚
β”‚               β”‚ HTTP  β”‚   Backend   β”‚ HTTP  β”‚                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚                       β”‚
                         β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”
                         β”‚ Auth / TOTP β”‚          β”‚   RC522   β”‚
                         β”‚ JWT / RBAC  β”‚          β”‚   RFID    β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Main components

Component Responsibility
React frontend User interface and web workflows
Express backend API, authentication and business logic
MongoDB Persistent application data
Arduino terminal Physical attendance interface
RC522 RFID card identification
TOTP Additional verification factor
JWT Protected web API authentication

🧰 Technology Stack

Backend

  • Node.js
  • Express.js
  • MongoDB
  • Mongoose
  • JWT
  • bcrypt
  • Speakeasy
  • dotenv

Frontend

  • React
  • Vite
  • JavaScript
  • Fetch API
  • CSS

IoT

  • Arduino UNO
  • RC522 RFID reader
  • 16Γ—2 LCD with I2C
  • 4Γ—4 matrix keypad
  • Optional buzzer / LEDs

Development

  • Git
  • GitHub
  • Arduino IDE

πŸ“ Project Structure

SecureAttend/
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ middleware/
β”‚   β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ routes/
β”‚   β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ server.js
β”‚   └── package.json
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ Admin/
β”‚   β”‚   β”‚   β”œβ”€β”€ Student/
β”‚   β”‚   β”‚   └── Teacher/
β”‚   β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   └── main.jsx
β”‚   β”œβ”€β”€ index.html
β”‚   └── package.json
β”‚
β”œβ”€β”€ iot/
β”‚   └── ...
β”‚
β”œβ”€β”€ .env.example
β”œβ”€β”€ .gitignore
└── README.md

The exact structure may change as the project evolves. The repository should reflect the current implementation rather than planned architecture.


πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm
  • MongoDB database
  • Git
  • Arduino IDE for IoT development

1. Clone the repository

git clone https://github.com/shubham-kain07/SecureAttend.git
cd SecureAttend

βš™οΈ Backend Setup

cd backend
npm install

Create a .env file based on .env.example.

Example:

PORT=5000

MONGO_URI=your_mongodb_connection_string

JWT_SECRET=replace_with_a_long_random_secret

ADMIN_USERNAME=your_admin_username
ADMIN_PASSWORD=your_admin_password

TOTAL_WORKING_DAYS=90

Environment Variables

Variable Purpose
PORT Port used by the backend
MONGO_URI MongoDB connection string
JWT_SECRET Secret used for JWT authentication
ADMIN_USERNAME Initial administrator username
ADMIN_PASSWORD Initial administrator password
TOTAL_WORKING_DAYS Number of working days used by attendance calculations

Never commit your real .env file.

Credentials, database connection strings, JWT secrets, and other sensitive configuration must remain outside version control.

Start the development server:

npm run dev

The backend will run on:

http://localhost:5000

🌐 Frontend Setup

Open another terminal:

cd frontend
npm install
npm run dev

Vite will provide the local development URL.

The frontend communicates with the backend through the configured API endpoint.


πŸ“‘ IoT Setup

The Arduino attendance terminal communicates with the backend through HTTP requests.

The terminal is responsible for:

  1. Reading the RFID card
  2. Sending the card identifier to the backend
  3. Receiving the attendance session response
  4. Collecting the TOTP code
  5. Sending the verification request
  6. Displaying the result on the LCD

Example API flow:

POST /api/rfid/tap
        ↓
Temporary attendance session
        ↓
POST /api/rfid/verify
        ↓
TOTP verification
        ↓
Attendance recorded

The backend must be reachable from the Arduino over the local network.

For local development, this normally means using the host machine's LAN IP rather than:

localhost

For example:

http://192.168.x.x:5000

The exact configuration depends on the network and Arduino connectivity method.


πŸ“Š Attendance Calculation

Attendance percentage is calculated using:

Attendance Percentage =
(Present Days / Total Recorded Days) Γ— 100

The current eligibility threshold is:

β‰₯ 75%  β†’ Eligible
< 75%  β†’ Not Eligible

The calculation logic is handled by the backend so attendance results remain consistent across clients.


πŸ›‘οΈ Security

SecureAttend incorporates several security mechanisms.

Password Protection

User passwords are hashed before storage using bcrypt.

JWT Authentication

Protected backend routes use JSON Web Tokens for authenticated sessions.

Role-Based Access Control

Different user roles have access to different operations.

Admin
 β”œβ”€β”€ User management
 β”œβ”€β”€ RFID management
 └── Attendance management

Teacher
 β”œβ”€β”€ Student access
 └── Attendance operations

Student
 β”œβ”€β”€ Attendance
 └── Personal attendance records

TOTP Verification

Time-based One-Time Passwords provide an additional verification factor for attendance.

TOTP can be used with compatible authenticator applications such as Google Authenticator.

Temporary Attendance Sessions

RFID identification does not directly mark attendance.

A temporary session is created first and must be successfully verified before attendance is recorded.

Duplicate Prevention

The backend prevents duplicate attendance records according to the configured attendance rules.


πŸ§ͺ Development

SecureAttend is being developed incrementally.

The general application flow follows:

Frontend / IoT Client
        ↓
       API
        ↓
Business Logic
        ↓
    Database

Hardware-specific functionality communicates with the backend through defined API endpoints rather than directly manipulating database records.

This keeps the web application, IoT terminals, and database layers separated.


πŸ—ΊοΈ Roadmap

SecureAttend is being developed as the foundation for a larger institutional software platform.

Physical Attendance Infrastructure

The next generation of the physical attendance system is planned around ESP32-based attendance nodes.

Instead of treating each attendance terminal as an isolated Arduino device, future terminals will operate as a connected network of nodes communicating with the central backend.

Planned architecture:

                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚   Central Backend   β”‚
                 β”‚                     β”‚
                 β”‚ Authentication      β”‚
                 β”‚ Attendance          β”‚
                 β”‚ Data Processing     β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚             β”‚             β”‚
              β–Ό             β–Ό             β–Ό
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚ ESP32    β”‚  β”‚ ESP32    β”‚  β”‚ ESP32    β”‚
        β”‚ Node #01 β”‚  β”‚ Node #02 β”‚  β”‚ Node #03 β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
             β”‚              β”‚              β”‚
          RFID            RFID           RFID
          Reader          Reader         Reader

The long-term goal is to create a network of physical attendance nodes that can be centrally managed rather than deploying independent attendance machines.

Planned improvements include:

  • ESP32-based attendance nodes
  • Multiple synchronized attendance terminals
  • Centralized terminal management
  • Improved device-to-server communication
  • Terminal health and status monitoring
  • Offline operation and synchronization
  • Remote configuration of attendance nodes

🏫 Beyond Attendance

SecureAttend is also evolving beyond an attendance-only platform.

A full College Management System is currently under development as the next major stage of the project.

The planned system will expand the platform into a broader institutional management system covering areas such as:

  • Course and program management
  • Department management
  • Academic years and subjects
  • Student management
  • Teacher management
  • Attendance
  • Academic records
  • Administrative workflows
  • Role-based access control
  • Centralized institutional data

The long-term architecture is intended to make attendance one component of a larger college management platform rather than a standalone application.

                         College Management System
                                  β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚                       β”‚                       β”‚
          β–Ό                       β–Ό                       β–Ό
     Administration           Academics              Attendance
          β”‚                       β”‚                       β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
                                  β–Ό
                         Centralized Backend
                                  β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚                           β”‚
                    β–Ό                           β–Ό
              Web Applications            IoT Node Network
                                             β”‚
                                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                   β–Ό         β–Ό         β–Ό
                                 ESP32     ESP32     ESP32

The current SecureAttend project serves as an early foundation for this larger system.


🎯 Intended Use Cases

SecureAttend can be adapted for:

  • Colleges and universities
  • Technical institutes
  • Training centers
  • Educational laboratories
  • RFID attendance kiosks
  • Small-scale institutional attendance systems

The project is primarily intended as a software engineering and IoT systems project, demonstrating how authentication, backend services, web clients, databases, and physical devices can work together as one system.


πŸ“š What This Project Demonstrates

SecureAttend explores problems beyond basic CRUD application development.

The project involves:

  • API design
  • Authentication
  • Authorization
  • Multi-factor verification
  • Database modelling
  • IoT-to-server communication
  • Client/server architecture
  • Session management
  • Security considerations
  • Hardware/software integration
  • Attendance business logic

The goal is to understand how a distributed application behaves when multiple clients interact with the same centralized system.


πŸ‘¨β€πŸ’» Author

Shubham Kain

Computer Science & Technology

GitHub: @shubham-kain07


πŸ“„ License

This project is currently developed as a personal and academic software engineering project.

License information will be added when the project reaches its first public release.

About

Secure attendance management system with RFID, TOTP authentication, web applications, and IoT attendance terminals

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages