Precision Pass is a full-stack employee attendance and operations demo that combines:
- Next.js frontend for HR workflows
- FastAPI + OpenCV backend for face enrollment and recognition
- JSON-based local storage for quick local development
It supports attendance tracking, employee management, leave management, and monthly payroll estimates in one app.
- Real-time attendance dashboard
- Live face recognition monitor
- Employee directory with editable schedules and wages
- Face registration and sample enrollment
- Leave management (approved leave ranges)
- Monthly payroll calculation from attendance + leave data
- Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS, shadcn/ui
- Backend: FastAPI, OpenCV, scikit-learn
- Storage: Local JSON files under
CV/data
app/ Next.js routes/pages
components/ Reusable UI and feature components
lib/cv-api.ts Frontend API client for CV backend
CV/server.py FastAPI entrypoint and API routes
CV/vision.py Face detection, enrollment, recognition logic
CV/data.py JSON data helpers
CV/data/ Local employees, attendance, leave, and face samples
- Node.js 20+ and npm
- Python 3.10+
- A webcam (for face registration and live monitoring)
From the repository root:
-
Install frontend dependencies:
npm install
-
Install backend dependencies:
python3 -m pip install -r CV/requirements.txt
-
Start the CV backend:
npm run dev:server
-
In another terminal, start the frontend:
npm run dev
-
Open the app at:
- Frontend:
http://localhost:3000 - Backend docs:
http://127.0.0.1:8000/docs
- Frontend:
NEXT_PUBLIC_CV_API_BASE_URL(optional)
Defaults tohttp://127.0.0.1:8000
CV_ALLOWED_ORIGINS(optional, comma-separated)
Defaults tohttp://localhost:3000,http://127.0.0.1:3000
npm run dev— start Next.js dev servernpm run dev:server— start FastAPI backend with auto-reloadnpm run lint— run ESLintnpm run build— create production buildnpm run start— run production server
Core endpoints exposed by CV/server.py:
GET /healthGET|POST /employeesPATCH|DELETE /employees/{employee_id}POST /employees/{employee_id}/enrollPOST /recognition/frameGET /recognitions/recentGET /attendance/todayGET|POST /leavesPATCH|DELETE /leaves/{leave_id}GET /payroll/monthly?month=YYYY-MM
- This project currently uses local JSON storage and is intended for demos/prototyping.
- On restricted networks,
npm run buildmay fail if Google Fonts cannot be fetched.