Web-based student attendance tracking using QR codes on student ID cards. Built with MERN stack (MongoDB, Express, React, Node.js) and Tailwind CSS.
- URL: https://attendifyqr.vercel.app
- Backend API base: https://attendifyqr.vercel.app/api
- Admin Portal: Add students, generate QR-enabled ID cards, mark attendance via scanner
- Student Portal: View attendance summary with percentage and detailed history
- QR Scanner: Real-time QR code scanning with sound feedback for instant attendance marking
- Once-per-day Attendance: Prevents duplicate attendance entries for the same day
- Responsive UI: Modern, clean interface built with Tailwind CSS
- Backend: Node.js, Express.js, MongoDB with Mongoose
- Frontend: React 18, Vite, React Router, Zustand (state management)
- Authentication: JWT with role-based access control
- QR Code:
qrcodelibrary for generation,@yudiel/react-qr-scannerfor scanning (React 18 compatible) - Styling: Tailwind CSS
- Node.js >= 18
- npm or yarn
- MongoDB (local or cloud instance like MongoDB Atlas)
cd c:\Users\malik\Downloads\AttendifyQR# Install all dependencies (backend + frontend)
npm run install:allCreate .env file in the backend folder:
MONGODB_URI=mongodb://localhost:27017/qr_attendance
JWT_SECRET=your-super-secret-jwt-key-here
PORT=5000Run the admin creation script:
Push-Location "C:\Users\malik\Downloads\AttendifyQR\backend"
npm install
node create-admin.js
Pop-LocationThe script will:
- Prompt for admin name, email, and password
- Connect to your MongoDB database (ensure
MONGODB_URIis set inbackend/.env) - Create the admin account with secure password hashing
- Display login credentials and the site URL
Note: Default student password is student123 (students can change it after first login)
npm run dev:fullThis starts:
- Backend server on http://localhost:5000
- Frontend dev server on http://localhost:5173
Terminal 1 (Backend):
cd backend
npm run devTerminal 2 (Frontend):
cd frontend
npm run dev- Add and manage students
- Generate student ID cards with QR codes
- Mark attendance by scanning QR codes
- View today's attendance list
- View attendance summary (total days, present, absent, percentage)
- Filter attendance history by date range
- View detailed attendance records
Admin Account:
- Create using
backend/create-admin.jsscript (see setup step 4) - Use a strong, unique password when prompted
Student Accounts:
- Created by admin with default password:
student123 - Students can change their password from "My Profile" section after first login
- Login with admin credentials
- Add Students:
- Go to "Students" tab
- Fill in student details (email, name, roll number, department, semester, section)
- Click "Add Student"
- Note the auto-generated QR token
- Generate ID Cards:
- Click "ID Card" button next to any student
- Download and print the ID card with QR code
- Mark Attendance:
- Go to "Mark Attendance" tab
- Allow camera permissions
- Scan student QR code from their ID card
- Attendance is automatically marked for the day
- View Today's Attendance:
- Go to "Today's Attendance" tab
- See all students who attended today
- Login at
https://attendifyqr.vercel.appwith student email and default password (student123) - View Summary: See total days, present days, absent days, and percentage
- Filter History: Use date filters to view attendance for specific periods
- Change Password:
- Open the "My Profile" section at the top
- Enter current and new password
- Click "Change Password" to update securely
- Check Status: Green background indicates β₯75% attendance, red indicates <75%
AttendifyQR/
βββ backend/
β βββ src/
β β βββ models/ # MongoDB schemas
β β βββ routes/ # API endpoints
β β βββ middleware/ # Auth middleware
β β βββ server.js # Express server
β βββ .env # Environment variables
β βββ package.json
βββ frontend/
β βββ src/
β β βββ pages/ # React components
β β βββ store/ # Zustand state management
β β βββ App.jsx # Main app component
β βββ package.json
βββ README.md
POST /api/auth/register- Register new userPOST /api/auth/login- Login user
GET /api/admin/students- Get all studentsPOST /api/admin/students- Add new studentGET /api/admin/students/:id/id-card- Generate ID card with QRPOST /api/admin/mark-attendance- Mark attendance via QR scanGET /api/admin/attendance/today- Get today's attendance
GET /api/student/attendance- Get attendance summary and recordsPOST /api/student/change-password- Change password (requirescurrentPassword,newPassword)
- Ensure backend server is running
- Check that JWT token is valid (try logging out and in again)
- Verify MongoDB connection is active
- Grant camera permissions in browser
- Use HTTPS or localhost (required for camera access)
- Ensure camera is not being used by another application
- Run
npm run install:allto reinstall dependencies - Delete
node_modulesfolders andpackage-lock.json, then reinstall
- email, password (hashed), name, role (admin/student)
- userId (ref to User), rollNumber, department, semester, section, photo, qrToken
- studentId (ref to StudentProfile), date, status (present/absent), markedAt
- Unique constraint: one attendance record per student per day
This project was developed as a mini project for MCA 3rd Semester. It demonstrates:
- Full-stack web development with MERN
- JWT authentication and authorization
- QR code integration
- Real-time camera access and processing
- RESTful API design
- State management in React
- Responsive UI/UX design
This is an academic project for educational purposes.
Developed by: Shaili & Bhawana
Project: QR Attendance System