How samruth07/smart-attendance-guard works
Smart Attendance Guard is a role-based attendance ERP. Users authenticate and enter student, teacher, or admin workflows; teachers open timetable sessions, students scan rotating QR tokens with location checks, and teachers submit attendance for review and analytics. The map preserves documented biometric, timetable, administrative override, audit, and real-time capabilities. Backend route implementations and most feature pages were not sampled, so unsupported links between those subsystems are omitted; documented capabilities remain represented.
Main entry points: App.jsx Role routes · api.js HTTP API client · index.js Express application · database.js Attendance database
Components 34
Role-based web app
- Role routes
client/src/App.jsx - Login screen
client/src/pages/Login.jsx - Role protection
client/src/components/ProtectedRoute.jsx - Student dashboard
client/src/pages/student/Dashboard.jsx - Attendance history
client/src/pages/student/MyAttendance.jsx - Teacher dashboard
client/src/pages/teacher/Dashboard.jsx
Identity and security
- Auth state
client/src/context/AuthContext.jsx - Password login API
server/routes/auth.js - WebAuthn verification
server/routes/webauthn.js - JWT and role checks
server/middleware/auth.js
Attendance operations
- QR attendance scanner
client/src/pages/student/Scanner.jsx - Session management
client/src/pages/teacher/Session.jsx - QR and scan events
server/socket/attendance.js - Geofence checks
server/utils/geo.js
Academic oversight
- Student timetable
client/src/pages/student/WeeklyTimetable.jsx - Teacher analytics
client/src/pages/teacher/Analytics.jsx - Teacher schedule
client/src/pages/teacher/TeacherSchedule.jsx - Admin dashboard
client/src/pages/admin/Dashboard.jsx - Branch analytics
client/src/pages/admin/BranchAnalytics.jsx - Student audit detail
client/src/pages/admin/StudentDetail.jsx - Schedule overrides
client/src/pages/admin/AdminControl.jsx - Database audit viewer
client/src/pages/admin/DatabaseViewer.jsx
API and realtime services
- HTTP API client
client/src/utils/api.js - Socket client
client/src/utils/socket.js - Express application
server/index.js - Teacher API
server/routes/teacher.js - Student API
server/routes/student.js - Admin API
server/routes/admin.js
Persistent records
- Attendance database
server/config/database.js - User records
server/models/User.js - Attendance records
server/models/Attendance.js - Session records
server/models/AttendanceSession.js - Timetable records
server/models/Timetable.js
Other components
- Student / teacher / admin
Connections 48
- Student / teacher / admin → Role routes: opens
client/src/App.jsx - Role routes → Login screen: routes to
client/src/App.jsx - Role routes → Role protection: guards routes
client/src/App.jsx - Role routes → Student dashboard: routes to
client/src/App.jsx - Role routes → QR attendance scanner: routes to
client/src/App.jsx - Role routes → Attendance history: routes to
client/src/App.jsx - Role routes → Student timetable: routes to
client/src/App.jsx - Role routes → Teacher dashboard: routes to
client/src/App.jsx - Role routes → Session management: routes to
client/src/App.jsx - Role routes → Teacher analytics: routes to
client/src/App.jsx - Role routes → Teacher schedule: routes to
client/src/App.jsx - Role routes → Admin dashboard: routes to
client/src/App.jsx - Role routes → Branch analytics: routes to
client/src/App.jsx - Role routes → Student audit detail: routes to
client/src/App.jsx - Role routes → Schedule overrides: routes to
client/src/App.jsx - Role routes → Database audit viewer: routes to
client/src/App.jsx - Login screen → Auth state: signs in via
- Auth state → HTTP API client: requests identity
client/src/context/AuthContext.jsx - Student dashboard → HTTP API client: loads data
- QR attendance scanner → HTTP API client: submits scan
client/src/pages/student/Scanner.jsx - QR attendance scanner → Socket client: joins session
client/src/pages/student/Scanner.jsx - Attendance history → HTTP API client: loads records
- Student timetable → HTTP API client: loads schedule
- Teacher dashboard → HTTP API client: loads schedule
- Session management → HTTP API client: starts and submits
client/src/pages/teacher/Session.jsx - Session management → Socket client: receives events
client/src/pages/teacher/Session.jsx - Teacher analytics → HTTP API client: loads analytics
- Teacher schedule → HTTP API client: loads timetable
- Admin dashboard → HTTP API client: loads metrics
- Branch analytics → HTTP API client: loads reports
- Student audit detail → HTTP API client: loads student data
- Schedule overrides → HTTP API client: changes schedules
- Database audit viewer → HTTP API client: loads audit data
- HTTP API client → Express application: HTTP requests
- Socket client → QR and scan events: Socket events
- Express application → Password login API: mounts routes
server/index.js - Express application → Teacher API: mounts routes
server/index.js - Express application → Student API: mounts routes
server/index.js - Express application → Admin API: mounts routes
server/index.js - Express application → WebAuthn verification: mounts routes
server/index.js - Express application → QR and scan events: initializes sockets
server/index.js - Password login API → Attendance database: reads users
server/routes/auth.js - Password login API → JWT and role checks: protects profile
server/routes/auth.js - WebAuthn verification → Attendance database: stores credentials
server/routes/webauthn.js - WebAuthn verification → JWT and role checks: authenticates registration
server/routes/webauthn.js - JWT and role checks → Attendance database: loads user
server/middleware/auth.js - Teacher API → Attendance database: reads and writes
- Student API → Attendance database: reads and writes