Skip to content

About

PHP + MySQL attendance system for XAMPP with local browser-based face enrollment and secure localhost setup

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Attendance Hub

This project runs entirely without AWS. It uses PHP + MySQL on XAMPP for the main app and a local browser-based face recognition flow powered by @vladmandic/face-api.

What It Does

  • Teacher and student login
  • Student registration with hashed passwords
  • Attendance sessions with 6-character live codes
  • Teacher-side face enrollment with multiple webcam samples per student
  • Student attendance through code + local browser face verification
  • Manual teacher attendance fallback
  • Attendance history, metrics, and CSV export

Quick Start

  1. Start Apache and MySQL in XAMPP.
  2. Open http://localhost/phpmyadmin.
  3. Import database/schema.sql into the attendance_system database.
  4. Open https://localhost/attendance-app/.

Default teacher credentials:

Username: admin
Password: admin123

Local HTTPS Setup

The app is configured for secure local use over https://localhost.

  • Apache uses a local localhost certificate.
  • Session cookies are sent with HttpOnly, SameSite=Lax, and Secure over HTTPS.
  • The app sends security headers including Content-Security-Policy, X-Frame-Options, and X-Content-Type-Options.
  • Sensitive face image storage under storage/ is blocked from direct web access.

Important:

  • Use https://localhost/attendance-app/, not https://127.0.0.1/..., because the certificate is issued for localhost.
  • If the browser still shows an old warning after certificate changes, fully restart the browser.
  • On other devices or Windows accounts, the local certificate must be trusted separately.

Local Face Setup

No AWS account is needed.

The local face system uses:

  • assets/dist/face-recognition.js
  • assets/models/face-api/
  • webcam access in the browser

If you rebuild frontend assets later, run:

npm.cmd install
npm.cmd run build:face

The model files must exist in assets/models/face-api. They are already included in this workspace.

Optional Face Tuning

The local face settings live in config/app.php.

Useful options:

FACE_REQUIRED_SAMPLES=3
FACE_MIN_CAPTURE_QUALITY=78
FACE_MIN_DETECTION_CONFIDENCE=0.82
FACE_MAX_DESCRIPTOR_DISTANCE=0.48
FACE_CAPTURE_BURST_FRAMES=3

You can either:

  1. Set them as environment variables before Apache starts.
  2. Or edit the default values directly in config/app.php.

How To Use It

Teacher workflow:

  1. Sign in as teacher.
  2. Create student accounts in Students.
  3. Click Manage Face for each student.
  4. Capture at least 3 clean webcam samples per student.
  5. Create an attendance session and share its 6-character code.
  6. Monitor records or export CSV.

Student workflow:

  1. Sign in with the student ID and password created by the teacher.
  2. Enter the 6-character attendance code.
  3. Complete the webcam face check.
  4. Attendance is marked if the local descriptor match passes.

Important Notes

  • Allow camera access in the browser when testing on localhost.
  • The teacher must finish face enrollment before student self-attendance will work.
  • This no-AWS version is intended for local deployment on XAMPP and is now hardened for secure local HTTPS use.
  • Face verification is still browser-based descriptor matching, so it is not equivalent to a dedicated enterprise liveness platform.
  • Good lighting, one visible face, and a steady front-facing pose matter a lot for reliable matches.
  • Manual teacher attendance is still available as a fallback.
  • Internal folders such as src, config, views, and database are protected by Apache access rules.
  • database/schema.sql matches the current application code and can be re-imported to rebuild the database from scratch.

About

PHP + MySQL attendance system for XAMPP with local browser-based face enrollment and secure localhost setup

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages