chualinwei3 commited on
Commit
98cc1aa
Β·
verified Β·
1 Parent(s): 2a44ecb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +380 -338
README.md CHANGED
@@ -1,338 +1,380 @@
1
- # Attendr - Smart Attendance System πŸŽ“
2
-
3
- An AI-powered smart attendance system for Universiti Teknologi Malaysia (UTM) that combines **facial recognition**, **geolocation verification**, and **auto-refresh attendance codes** to eliminate proxy attendance and streamline the attendance process.
4
-
5
- ![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)
6
- ![Flask](https://img.shields.io/badge/Flask-3.0-green.svg)
7
- ![License](https://img.shields.io/badge/License-MIT-yellow.svg)
8
-
9
- ## ✨ Features
10
-
11
- ### For Students
12
- - 🎭 **Biometric Face Recognition** - Secure identity verification using AI
13
- - πŸ“ **GPS Location Validation** - Confirms physical presence in classroom
14
- - πŸ” **Auto-Refresh Codes** - Time-limited codes prevent sharing
15
- - ⚑ **Real-time Feedback** - Instant attendance confirmation
16
- - πŸ“± **Mobile Friendly** - Works on smartphones and tablets
17
-
18
- ### For Lecturers
19
- - 🎯 **One-Click Session Creation** - Quick setup for any class
20
- - πŸ”„ **Auto-Refreshing Codes** - New code every 2 minutes
21
- - πŸ“Š **Real-time Monitoring** - Live attendance updates
22
- - πŸ“₯ **Export Reports** - Download CSV for record-keeping
23
- - πŸ“ˆ **Attendance Analytics** - View statistics at a glance
24
-
25
- ### Security Features
26
- - βœ… Prevents proxy attendance through face + location verification
27
- - βœ… Time-limited codes expire automatically
28
- - βœ… All verifications logged with timestamps
29
- - βœ… Distance tracking from classroom center
30
-
31
- ## 🧠 AI Logic & Knowledge Representation
32
-
33
- Attendr implements **5 Knowledge Representation (KR) rules** using First-Order Logic:
34
-
35
- 1. **Face Recognition**: `βˆ€x ((CapturedFace(x) ∧ MatchStored(x)) β†’ FaceMatch(x))`
36
- 2. **Location Verification**: `βˆ€x[(Student(x) ∧ IsWithinAllowedArea(x)) β†’ VerifiedLocation(x)]`
37
- 3. **Device Readiness**: `βˆ€d ((CameraOn(d) ∧ GPSOn(d)) β†’ StartVerification(d))`
38
- 4. **Attendance Validation**: `βˆ€x ((FaceMatch(x) ∧ LocationValid(x)) β†’ GrantCodeAccess(x))`
39
- 5. **Code Confirmation**: `βˆ€x ((ValidCodeEntry(User,x) ∧ WithinCycle(Code,x)) β†’ MarkPresent(System,x))`
40
-
41
- ## πŸš€ Installation
42
-
43
- ### Prerequisites
44
- - Python 3.8 or higher
45
- - Webcam for face capture
46
- - GPS-enabled device (or browser location services)
47
-
48
- ### Step 1: Clone Repository
49
- ```bash
50
- git clone <repository-url>
51
- cd smartAttandence
52
- ```
53
-
54
- ### Step 2: Install Dependencies
55
-
56
- #### Windows (Recommended Method)
57
- ```powershell
58
- # Install Visual C++ Build Tools first (required for dlib)
59
- # Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
60
-
61
- # Create virtual environment
62
- python -m venv venv
63
- venv\Scripts\activate
64
-
65
- # Install dependencies
66
- pip install -r requirements.txt
67
- ```
68
-
69
- #### Alternative: Use Pre-compiled Wheels
70
- If you encounter issues installing `face_recognition`, use pre-compiled wheels:
71
- ```powershell
72
- pip install https://github.com/jloh02/dlib/releases/download/v19.22/dlib-19.22.99-cp38-cp38-win_amd64.whl
73
- pip install face_recognition
74
- ```
75
-
76
- ### Step 3: Initialize Database
77
- ```bash
78
- python init_db.py
79
- ```
80
-
81
- This creates:
82
- - SQLite database with all tables
83
- - Sample UTM classrooms (N28, V01, C22)
84
- - Test student account
85
-
86
- ### Step 4: Run Application
87
- ```bash
88
- python app.py
89
- ```
90
-
91
- The application will be available at: **http://localhost:5000**
92
-
93
- ## πŸ“– Usage Guide
94
-
95
- ### For Students
96
-
97
- 1. **Register Your Face**
98
- - Visit `/register`
99
- - Enter Student ID and Name
100
- - Capture your face using webcam
101
- - System stores your biometric encoding
102
-
103
- 2. **Mark Attendance**
104
- - Visit `/student`
105
- - Enter Student ID and select active session
106
- - Enable camera and GPS permissions
107
- - System verifies your face and location
108
- - Enter attendance code displayed by lecturer
109
- - Attendance marked instantly!
110
-
111
- ### For Lecturers
112
-
113
- 1. **Create Session**
114
- - Visit `/lecturer`
115
- - Enter course name and your name
116
- - Select classroom location
117
- - Click "Create Session"
118
-
119
- 2. **Display Code**
120
- - Large attendance code appears on screen
121
- - Code auto-refreshes every 2 minutes
122
- - Show this code to students in class
123
-
124
- 3. **Monitor Attendance**
125
- - View real-time attendance list
126
- - See verification details (distance, time)
127
- - Export CSV report when done
128
-
129
- ## πŸ—‚οΈ Project Structure
130
-
131
- ```
132
- smartAttandence/
133
- β”œβ”€β”€ app.py # Main Flask application
134
- β”œβ”€β”€ config.py # Configuration settings
135
- β”œβ”€β”€ models.py # Database models
136
- β”œβ”€β”€ init_db.py # Database initialization
137
- β”œβ”€β”€ requirements.txt # Python dependencies
138
- β”‚
139
- β”œβ”€β”€ face_recognition_module.py # Face recognition logic (KR Rule #1)
140
- β”œβ”€β”€ geolocation_module.py # GPS verification (KR Rule #2)
141
- β”œβ”€β”€ attendance_code_module.py # Auto-refresh codes (KR Rule #5)
142
- β”œβ”€β”€ utils.py # Helper functions
143
- β”‚
144
- β”œβ”€β”€ static/
145
- β”‚ β”œβ”€β”€ css/
146
- β”‚ β”‚ └── style.css # Premium design system
147
- β”‚ └── js/
148
- β”‚ β”œβ”€β”€ student.js # Student portal logic
149
- β”‚ └── lecturer.js # Lecturer dashboard logic
150
- β”‚
151
- └── templates/
152
- β”œβ”€β”€ index.html # Landing page
153
- β”œβ”€β”€ student.html # Student portal
154
- β”œβ”€β”€ lecturer.html # Lecturer dashboard
155
- └── register.html # Face registration
156
- ```
157
-
158
- ## πŸ”§ Configuration
159
-
160
- Edit `config.py` to customize:
161
-
162
- ```python
163
- # Face recognition settings
164
- FACE_RECOGNITION_TOLERANCE = 0.6 # Lower = more strict (0.4-0.6 recommended)
165
-
166
- # Geolocation settings
167
- GEOLOCATION_RADIUS_METERS = 50 # Classroom detection radius
168
-
169
- # Attendance code settings
170
- CODE_REFRESH_INTERVAL_SECONDS = 120 # Code refresh interval (2 minutes)
171
- CODE_LENGTH = 6 # Length of attendance code
172
- ```
173
-
174
- ## 🌐 API Endpoints
175
-
176
- ### Student Endpoints
177
- - `POST /api/register_face` - Register student face encoding
178
- - `POST /api/verify_face` - Verify face against stored encoding
179
- - `POST /api/verify_location` - Validate GPS location
180
- - `POST /api/mark_attendance` - Mark attendance with code
181
-
182
- ### Lecturer Endpoints
183
- - `POST /api/create_session` - Create attendance session
184
- - `GET /api/get_session/<id>` - Get session details with current code
185
- - `GET /api/get_attendance/<id>` - Get attendance records
186
- - `POST /api/end_session/<id>` - End session
187
-
188
- ### General Endpoints
189
- - `GET /api/get_active_sessions` - List all active sessions
190
- - `GET /api/classrooms` - Get all classrooms
191
-
192
- ## πŸ§ͺ Testing
193
-
194
- ### Manual Testing Checklist
195
-
196
- **Face Recognition:**
197
- - [ ] Register new student face
198
- - [ ] Verify with same person (should succeed)
199
- - [ ] Verify with different person (should fail)
200
- - [ ] Test with poor lighting
201
- - [ ] Test with glasses/mask
202
-
203
- **Geolocation:**
204
- - [ ] Mark attendance from inside classroom (should succeed)
205
- - [ ] Mark attendance from outside radius (should fail)
206
- - [ ] Verify distance calculation accuracy
207
-
208
- **Auto-Refresh Codes:**
209
- - [ ] Code refreshes every 2 minutes
210
- - [ ] Expired code rejected
211
- - [ ] Valid code accepted
212
- - [ ] Code sharing prevented
213
-
214
- **End-to-End Flow:**
215
- - [ ] Complete student registration
216
- - [ ] Lecturer creates session
217
- - [ ] Student marks attendance successfully
218
- - [ ] Attendance appears in real-time
219
- - [ ] Export CSV works
220
-
221
- ## πŸ› Troubleshooting
222
-
223
- ### Face Recognition Issues
224
-
225
- **Problem:** `dlib` installation fails on Windows
226
- **Solution:**
227
- 1. Install Visual C++ Build Tools
228
- 2. Or use pre-compiled wheel: `pip install dlib-19.22.99-cp38-cp38-win_amd64.whl`
229
-
230
- **Problem:** "No face detected"
231
- **Solution:**
232
- - Ensure good lighting
233
- - Face camera directly
234
- - Remove glasses/mask if possible
235
- - Move closer to camera
236
-
237
- ### GPS Issues
238
-
239
- **Problem:** Location permission denied
240
- **Solution:**
241
- - Enable location services in browser settings
242
- - Use HTTPS (required for geolocation API)
243
- - Check device GPS is enabled
244
-
245
- **Problem:** "Location unavailable"
246
- **Solution:**
247
- - Ensure GPS is enabled on device
248
- - Try outdoors for better signal
249
- - Check browser location permissions
250
-
251
- ### Code Validation Issues
252
-
253
- **Problem:** "Code has expired"
254
- **Solution:**
255
- - Enter code within 2-minute window
256
- - Check lecturer's displayed code
257
- - Ensure system clocks are synchronized
258
-
259
- ## πŸ“Š Database Schema
260
-
261
- ### Students Table
262
- - `id` - Primary key
263
- - `student_id` - Unique student identifier
264
- - `name` - Student name
265
- - `email` - Email address
266
- - `face_encoding` - Biometric data (JSON)
267
- - `registered_at` - Registration timestamp
268
-
269
- ### Classrooms Table
270
- - `id` - Primary key
271
- - `name` - Classroom name (e.g., N28-01-01)
272
- - `building` - Building name
273
- - `latitude` - GPS latitude
274
- - `longitude` - GPS longitude
275
- - `radius_meters` - Geofencing radius
276
-
277
- ### AttendanceSessions Table
278
- - `id` - Primary key
279
- - `course_name` - Course name
280
- - `lecturer_name` - Lecturer name
281
- - `classroom_id` - Foreign key to Classrooms
282
- - `current_code` - Active attendance code
283
- - `code_generated_at` - Code generation time
284
- - `is_active` - Session status
285
-
286
- ### AttendanceRecords Table
287
- - `id` - Primary key
288
- - `session_id` - Foreign key to AttendanceSessions
289
- - `student_id` - Foreign key to Students
290
- - `marked_at` - Attendance timestamp
291
- - `face_verified` - Face verification status
292
- - `location_verified` - Location verification status
293
- - `code_verified` - Code verification status
294
- - `distance_from_classroom` - Distance in meters
295
-
296
- ## 🎨 Design Philosophy
297
-
298
- Attendr features a **premium dark mode design** with:
299
- - 🌈 Vibrant gradient accents
300
- - ✨ Glassmorphism effects
301
- - 🎭 Smooth micro-animations
302
- - πŸ“± Fully responsive layout
303
- - 🎯 Modern typography (Inter + Outfit fonts)
304
-
305
- ## 🀝 Contributing
306
-
307
- Contributions are welcome! Please follow these steps:
308
- 1. Fork the repository
309
- 2. Create a feature branch
310
- 3. Make your changes
311
- 4. Test thoroughly
312
- 5. Submit a pull request
313
-
314
- ## πŸ“„ License
315
-
316
- This project is licensed under the MIT License.
317
-
318
- ## πŸ‘₯ Authors
319
-
320
- Developed for Universiti Teknologi Malaysia (UTM) as part of an AI Smart Attendance System project.
321
-
322
- ## πŸ™ Acknowledgments
323
-
324
- - **OpenCV** - Computer vision library
325
- - **face_recognition** - Face recognition library by Adam Geitgey
326
- - **Flask** - Web framework
327
- - **UTM** - Project inspiration and requirements
328
-
329
- ## πŸ“ž Support
330
-
331
- For issues or questions:
332
- 1. Check the Troubleshooting section
333
- 2. Review API documentation
334
- 3. Open an issue on GitHub
335
-
336
- ---
337
-
338
- **Made with ❀️ for UTM Students and Lecturers**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Attendr UTM Smart Attendance
3
+ emoji: πŸŽ“
4
+ colorFrom: red
5
+ colorTo: yellow
6
+ sdk: docker
7
+ pinned: false
8
+ ---
9
+
10
+ # Attendr - Smart Attendance System πŸŽ“
11
+
12
+ An AI-powered smart attendance system for Universiti Teknologi Malaysia (UTM) that combines **facial recognition**, **geolocation verification**, and **auto-refresh attendance codes** to eliminate proxy attendance and streamline the attendance process.
13
+
14
+ ![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)
15
+ ![Flask](https://img.shields.io/badge/Flask-3.0-green.svg)
16
+ ![License](https://img.shields.io/badge/License-MIT-yellow.svg)
17
+
18
+ ## ✨ Features
19
+
20
+ ### For Students
21
+
22
+ - 🎭 **Biometric Face Recognition** - Secure identity verification using AI
23
+ - πŸ“ **GPS Location Validation** - Confirms physical presence in classroom
24
+ - πŸ” **Auto-Refresh Codes** - Time-limited codes prevent sharing
25
+ - ⚑ **Real-time Feedback** - Instant attendance confirmation
26
+ - πŸ“± **Mobile Friendly** - Works on smartphones and tablets
27
+
28
+ ### For Lecturers
29
+
30
+ - 🎯 **One-Click Session Creation** - Quick setup for any class
31
+ - πŸ”„ **Auto-Refreshing Codes** - New code every 2 minutes
32
+ - πŸ“Š **Real-time Monitoring** - Live attendance updates
33
+ - πŸ“₯ **Export Reports** - Download CSV for record-keeping
34
+ - πŸ“ˆ **Attendance Analytics** - View statistics at a glance
35
+
36
+ ### Security Features
37
+
38
+ - βœ… Prevents proxy attendance through face + location verification
39
+ - βœ… Time-limited codes expire automatically
40
+ - βœ… All verifications logged with timestamps
41
+ - βœ… Distance tracking from classroom center
42
+
43
+ ## 🧠 AI Logic & Knowledge Representation
44
+
45
+ Attendr implements **5 Knowledge Representation (KR) rules** using First-Order Logic:
46
+
47
+ 1. **Face Recognition**: `βˆ€x ((CapturedFace(x) ∧ MatchStored(x)) β†’ FaceMatch(x))`
48
+ 2. **Location Verification**: `βˆ€x[(Student(x) ∧ IsWithinAllowedArea(x)) β†’ VerifiedLocation(x)]`
49
+ 3. **Device Readiness**: `βˆ€d ((CameraOn(d) ∧ GPSOn(d)) β†’ StartVerification(d))`
50
+ 4. **Attendance Validation**: `βˆ€x ((FaceMatch(x) ∧ LocationValid(x)) β†’ GrantCodeAccess(x))`
51
+ 5. **Code Confirmation**: `βˆ€x ((ValidCodeEntry(User,x) ∧ WithinCycle(Code,x)) β†’ MarkPresent(System,x))`
52
+
53
+ ## πŸš€ Installation
54
+
55
+ ### Prerequisites
56
+
57
+ - Python 3.8 or higher
58
+ - Webcam for face capture
59
+ - GPS-enabled device (or browser location services)
60
+
61
+ ### Step 1: Clone Repository
62
+
63
+ ```bash
64
+ git clone <repository-url>
65
+ cd smartAttandence
66
+ ```
67
+
68
+ ### Step 2: Install Dependencies
69
+
70
+ #### Windows (Recommended Method)
71
+
72
+ ```powershell
73
+ # Install Visual C++ Build Tools first (required for dlib)
74
+ # Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
75
+
76
+ # Create virtual environment
77
+ python -m venv venv
78
+ venv\Scripts\activate
79
+
80
+ # Install dependencies
81
+ pip install -r requirements.txt
82
+ ```
83
+
84
+ #### Alternative: Use Pre-compiled Wheels
85
+
86
+ If you encounter issues installing `face_recognition`, use pre-compiled wheels:
87
+
88
+ ```powershell
89
+ pip install https://github.com/jloh02/dlib/releases/download/v19.22/dlib-19.22.99-cp38-cp38-win_amd64.whl
90
+ pip install face_recognition
91
+ ```
92
+
93
+ ### Step 3: Initialize Database
94
+
95
+ ```bash
96
+ python init_db.py
97
+ ```
98
+
99
+ This creates:
100
+
101
+ - SQLite database with all tables
102
+ - Sample UTM classrooms (N28, V01, C22)
103
+ - Test student account
104
+
105
+ ### Step 4: Run Application
106
+
107
+ ```bash
108
+ python app.py
109
+ ```
110
+
111
+ The application will be available at: **http://localhost:5000**
112
+
113
+ ## πŸ“– Usage Guide
114
+
115
+ ### For Students
116
+
117
+ 1. **Register Your Face**
118
+
119
+ - Visit `/register`
120
+ - Enter Student ID and Name
121
+ - Capture your face using webcam
122
+ - System stores your biometric encoding
123
+
124
+ 2. **Mark Attendance**
125
+ - Visit `/student`
126
+ - Enter Student ID and select active session
127
+ - Enable camera and GPS permissions
128
+ - System verifies your face and location
129
+ - Enter attendance code displayed by lecturer
130
+ - Attendance marked instantly!
131
+
132
+ ### For Lecturers
133
+
134
+ 1. **Create Session**
135
+
136
+ - Visit `/lecturer`
137
+ - Enter course name and your name
138
+ - Select classroom location
139
+ - Click "Create Session"
140
+
141
+ 2. **Display Code**
142
+
143
+ - Large attendance code appears on screen
144
+ - Code auto-refreshes every 2 minutes
145
+ - Show this code to students in class
146
+
147
+ 3. **Monitor Attendance**
148
+ - View real-time attendance list
149
+ - See verification details (distance, time)
150
+ - Export CSV report when done
151
+
152
+ ## πŸ—‚οΈ Project Structure
153
+
154
+ ```
155
+ smartAttandence/
156
+ β”œοΏ½οΏ½β”€ app.py # Main Flask application
157
+ β”œβ”€β”€ config.py # Configuration settings
158
+ β”œβ”€β”€ models.py # Database models
159
+ β”œβ”€β”€ init_db.py # Database initialization
160
+ β”œβ”€β”€ requirements.txt # Python dependencies
161
+ β”‚
162
+ β”œβ”€β”€ face_recognition_module.py # Face recognition logic (KR Rule #1)
163
+ β”œβ”€β”€ geolocation_module.py # GPS verification (KR Rule #2)
164
+ β”œβ”€β”€ attendance_code_module.py # Auto-refresh codes (KR Rule #5)
165
+ β”œβ”€β”€ utils.py # Helper functions
166
+ β”‚
167
+ β”œβ”€β”€ static/
168
+ β”‚ β”œβ”€β”€ css/
169
+ β”‚ β”‚ └── style.css # Premium design system
170
+ β”‚ └── js/
171
+ β”‚ β”œβ”€β”€ student.js # Student portal logic
172
+ β”‚ └── lecturer.js # Lecturer dashboard logic
173
+ β”‚
174
+ └── templates/
175
+ β”œβ”€β”€ index.html # Landing page
176
+ β”œβ”€β”€ student.html # Student portal
177
+ β”œβ”€β”€ lecturer.html # Lecturer dashboard
178
+ └── register.html # Face registration
179
+ ```
180
+
181
+ ## πŸ”§ Configuration
182
+
183
+ Edit `config.py` to customize:
184
+
185
+ ```python
186
+ # Face recognition settings
187
+ FACE_RECOGNITION_TOLERANCE = 0.6 # Lower = more strict (0.4-0.6 recommended)
188
+
189
+ # Geolocation settings
190
+ GEOLOCATION_RADIUS_METERS = 50 # Classroom detection radius
191
+
192
+ # Attendance code settings
193
+ CODE_REFRESH_INTERVAL_SECONDS = 120 # Code refresh interval (2 minutes)
194
+ CODE_LENGTH = 6 # Length of attendance code
195
+ ```
196
+
197
+ ## 🌐 API Endpoints
198
+
199
+ ### Student Endpoints
200
+
201
+ - `POST /api/register_face` - Register student face encoding
202
+ - `POST /api/verify_face` - Verify face against stored encoding
203
+ - `POST /api/verify_location` - Validate GPS location
204
+ - `POST /api/mark_attendance` - Mark attendance with code
205
+
206
+ ### Lecturer Endpoints
207
+
208
+ - `POST /api/create_session` - Create attendance session
209
+ - `GET /api/get_session/<id>` - Get session details with current code
210
+ - `GET /api/get_attendance/<id>` - Get attendance records
211
+ - `POST /api/end_session/<id>` - End session
212
+
213
+ ### General Endpoints
214
+
215
+ - `GET /api/get_active_sessions` - List all active sessions
216
+ - `GET /api/classrooms` - Get all classrooms
217
+
218
+ ## πŸ§ͺ Testing
219
+
220
+ ### Manual Testing Checklist
221
+
222
+ **Face Recognition:**
223
+
224
+ - [ ] Register new student face
225
+ - [ ] Verify with same person (should succeed)
226
+ - [ ] Verify with different person (should fail)
227
+ - [ ] Test with poor lighting
228
+ - [ ] Test with glasses/mask
229
+
230
+ **Geolocation:**
231
+
232
+ - [ ] Mark attendance from inside classroom (should succeed)
233
+ - [ ] Mark attendance from outside radius (should fail)
234
+ - [ ] Verify distance calculation accuracy
235
+
236
+ **Auto-Refresh Codes:**
237
+
238
+ - [ ] Code refreshes every 2 minutes
239
+ - [ ] Expired code rejected
240
+ - [ ] Valid code accepted
241
+ - [ ] Code sharing prevented
242
+
243
+ **End-to-End Flow:**
244
+
245
+ - [ ] Complete student registration
246
+ - [ ] Lecturer creates session
247
+ - [ ] Student marks attendance successfully
248
+ - [ ] Attendance appears in real-time
249
+ - [ ] Export CSV works
250
+
251
+ ## πŸ› Troubleshooting
252
+
253
+ ### Face Recognition Issues
254
+
255
+ **Problem:** `dlib` installation fails on Windows
256
+ **Solution:**
257
+
258
+ 1. Install Visual C++ Build Tools
259
+ 2. Or use pre-compiled wheel: `pip install dlib-19.22.99-cp38-cp38-win_amd64.whl`
260
+
261
+ **Problem:** "No face detected"
262
+ **Solution:**
263
+
264
+ - Ensure good lighting
265
+ - Face camera directly
266
+ - Remove glasses/mask if possible
267
+ - Move closer to camera
268
+
269
+ ### GPS Issues
270
+
271
+ **Problem:** Location permission denied
272
+ **Solution:**
273
+
274
+ - Enable location services in browser settings
275
+ - Use HTTPS (required for geolocation API)
276
+ - Check device GPS is enabled
277
+
278
+ **Problem:** "Location unavailable"
279
+ **Solution:**
280
+
281
+ - Ensure GPS is enabled on device
282
+ - Try outdoors for better signal
283
+ - Check browser location permissions
284
+
285
+ ### Code Validation Issues
286
+
287
+ **Problem:** "Code has expired"
288
+ **Solution:**
289
+
290
+ - Enter code within 2-minute window
291
+ - Check lecturer's displayed code
292
+ - Ensure system clocks are synchronized
293
+
294
+ ## πŸ“Š Database Schema
295
+
296
+ ### Students Table
297
+
298
+ - `id` - Primary key
299
+ - `student_id` - Unique student identifier
300
+ - `name` - Student name
301
+ - `email` - Email address
302
+ - `face_encoding` - Biometric data (JSON)
303
+ - `registered_at` - Registration timestamp
304
+
305
+ ### Classrooms Table
306
+
307
+ - `id` - Primary key
308
+ - `name` - Classroom name (e.g., N28-01-01)
309
+ - `building` - Building name
310
+ - `latitude` - GPS latitude
311
+ - `longitude` - GPS longitude
312
+ - `radius_meters` - Geofencing radius
313
+
314
+ ### AttendanceSessions Table
315
+
316
+ - `id` - Primary key
317
+ - `course_name` - Course name
318
+ - `lecturer_name` - Lecturer name
319
+ - `classroom_id` - Foreign key to Classrooms
320
+ - `current_code` - Active attendance code
321
+ - `code_generated_at` - Code generation time
322
+ - `is_active` - Session status
323
+
324
+ ### AttendanceRecords Table
325
+
326
+ - `id` - Primary key
327
+ - `session_id` - Foreign key to AttendanceSessions
328
+ - `student_id` - Foreign key to Students
329
+ - `marked_at` - Attendance timestamp
330
+ - `face_verified` - Face verification status
331
+ - `location_verified` - Location verification status
332
+ - `code_verified` - Code verification status
333
+ - `distance_from_classroom` - Distance in meters
334
+
335
+ ## 🎨 Design Philosophy
336
+
337
+ Attendr features a **premium dark mode design** with:
338
+
339
+ - 🌈 Vibrant gradient accents
340
+ - ✨ Glassmorphism effects
341
+ - 🎭 Smooth micro-animations
342
+ - πŸ“± Fully responsive layout
343
+ - 🎯 Modern typography (Inter + Outfit fonts)
344
+
345
+ ## 🀝 Contributing
346
+
347
+ Contributions are welcome! Please follow these steps:
348
+
349
+ 1. Fork the repository
350
+ 2. Create a feature branch
351
+ 3. Make your changes
352
+ 4. Test thoroughly
353
+ 5. Submit a pull request
354
+
355
+ ## πŸ“„ License
356
+
357
+ This project is licensed under the MIT License.
358
+
359
+ ## πŸ‘₯ Authors
360
+
361
+ Developed for Universiti Teknologi Malaysia (UTM) as part of an AI Smart Attendance System project.
362
+
363
+ ## πŸ™ Acknowledgments
364
+
365
+ - **OpenCV** - Computer vision library
366
+ - **face_recognition** - Face recognition library by Adam Geitgey
367
+ - **Flask** - Web framework
368
+ - **UTM** - Project inspiration and requirements
369
+
370
+ ## πŸ“ž Support
371
+
372
+ For issues or questions:
373
+
374
+ 1. Check the Troubleshooting section
375
+ 2. Review API documentation
376
+ 3. Open an issue on GitHub
377
+
378
+ ---
379
+
380
+ **Made with ❀️ for UTM Students and Lecturers**