AI-powered face recognition attendance and meal monitoring system for school demos and competitions.
- Frontend: React + Vite
- Backend: FastAPI
- Database: SQLite
- Face recognition: OpenCV + face_recognition + dlib locally, demo-safe fallback on Vercel
- Auth: JWT
- Reports: Excel, CSV, PDF
cd /d D:\DNV2\dn-face-project
start_backend.cmdcd /d D:\DNV2\dn-face-project
start_frontend.cmd- Frontend: http://localhost:5173
- Backend: http://localhost:8000
- API docs: http://localhost:8000/docs
- Admin username:
admin001 - Admin password:
admin123
Admin can configure:
morning_check_inmorning_late_aftermorning_check_outafternoon_check_inafternoon_late_afterafternoon_check_out
Attendance behavior:
- Before
morning_check_in: scan is rejected as too early morning_check_intomorning_late_after: morning check-in isOn Time- At or after
morning_late_after: morning check-in isLate - At or after
morning_check_out: morning checkout becomes valid afternoon_check_intoafternoon_late_after: afternoon check-in isOn Time- At or after
afternoon_late_after: afternoon check-in isLate - Before
afternoon_check_out: afternoon checkout requires approved early-leave request - At or after
afternoon_check_out: normal afternoon checkout is allowed
This repository is prepared for direct deployment as a single Vercel project.
How it works:
npm run buildbuilds the React frontendscripts/prepare-vercel.mjscopies the built frontend intopublic/app.pyserves:- the API at
/api/* - the frontend SPA at
/ - logo/media files at
/media/*
- the API at
- the frontend automatically calls
/apiin production, so no environment variable is required
cd /d D:\DNV2\dn-face-project
git add .
git commit -m "Update DN FACE for one-click Vercel deploy"
git push- Import the GitHub repository into Vercel
- Keep the root directory as the repository root
- Click
Deploy
That is all. No extra environment variables are required for the default demo deployment.
On Vercel, the app automatically:
- uses same-origin API calls through
/api - seeds demo users if the hosted database starts empty
- falls back to demo-safe face mode if heavy native face packages are unavailable
This makes the hosted version easier to click through in a competition setting.
Vercel Functions do not provide durable local file storage for writes. This project therefore works best on Vercel as a hosted demo version.
Practical impact:
- the hosted frontend works well
- the hosted API works well for demo use
- database writes and uploaded logos are not durable long-term
- full persistent production data still needs external storage
For a real persistent deployment later, move the database and uploaded files to managed storage.
cd /d D:\DNV2\dn-face-project
seed_sample_data.cmd- One-project Vercel entry:
D:\DNV2\dn-face-project\app.py - Backend API:
D:\DNV2\dn-face-project\backend\main.py - Backend DB layer:
D:\DNV2\dn-face-project\backend\database.py - Demo seeding:
D:\DNV2\dn-face-project\backend\seed_sample_data.py - Root build script:
D:\DNV2\dn-face-project\package.json - Public build copier:
D:\DNV2\dn-face-project\scripts\prepare-vercel.mjs - Frontend settings page:
D:\DNV2\dn-face-project\frontend\src\pages\Settings.jsx - Frontend scan page:
D:\DNV2\dn-face-project\frontend\src\pages\ScanAttendance.jsx - Frontend reports page:
D:\DNV2\dn-face-project\frontend\src\pages\Reports.jsx - Frontend API client:
D:\DNV2\dn-face-project\frontend\src\utils\api.js