How danhtran07/ai-enterprise-management-attendance-system works
FaceAttend AI is an employee attendance application: users authenticate, capture a face for recognition and liveness verification, and the backend records attendance; administrators also manage employees, users, shifts, and schedules. The React app calls a FastAPI domain API, which uses PostgreSQL and delegates biometric work to a separate AI service. The AI service combines recognition, liveness, and related analysis. Several backend relationships are visible in indexed source references; links based only on the README architecture are labeled as documented rather than inferred from unsampled code.
Main entry points: backend/main.py AI service API · attendance.py Attendance workflow · app/main.py FastAPI application · main.tsx Web routes and shell
Components 29
Web application
- Web routes and shell
apps/frontend/src/main.tsx - Face capture
apps/frontend/src/pages/App.tsx - Attendance dashboard
apps/frontend/src/pages/Dashboard.tsx - Employee management
apps/frontend/src/pages/Employees.tsx - API client
apps/frontend/src/api/client.ts
Attendance API
- FastAPI application
apps/backend/app/main.py - Authentication
apps/backend/app/api/routes/auth.py - Request authorization
apps/backend/app/api/dependencies/auth.py - Attendance workflow
apps/backend/app/api/routes/attendance.py - Employee endpoints
apps/backend/app/api/routes/employees.py - Schedules and shifts
apps/backend/app/api/routes/schedules.py - Attendance policy
apps/backend/app/services/attendance_policy.py - Shift resolution
apps/backend/app/services/shift_resolver.py - Attendance recognition
apps/backend/app/services/attendance_recognition.py - AI service client
apps/backend/app/services/ai_client.py - Database sessions
apps/backend/app/core/database.py
Biometric service
- AI service API
apps/ai-service/backend/main.py - Face recognition
apps/ai-service/backend/face_recognition_engine.py - Liveness analysis
apps/ai-service/backend/liveness_engine.py - Photo validation
apps/ai-service/backend/photo_validator.py - Liveness sessions
apps/ai-service/backend/session_manager.py - Heartbeat liveness
apps/ai-service/backend/rppg_engine.py - Emotion analysis
apps/ai-service/backend/emotion_engine.py - Face embedding store
apps/ai-service/backend/face_db.py
Persistent data
- PostgreSQL
- Attendance records
apps/backend/app/models/attendance.py - Employee records
apps/backend/app/models/employee.py - User accounts
apps/backend/app/models/user.py
Other components
- Employee or admin
Connections 33
- Employee or admin → Web routes and shell: uses
apps/frontend/src/main.tsx - Web routes and shell → Face capture: routes to
apps/frontend/src/main.tsx - Web routes and shell → Attendance dashboard: routes to
apps/frontend/src/main.tsx - Web routes and shell → Employee management: routes to
apps/frontend/src/main.tsx - Face capture → API client: requests through
apps/frontend/src/pages/App.tsx - Attendance dashboard → API client: requests through
apps/frontend/src/pages/Dashboard.tsx - Employee management → API client: requests through
apps/frontend/src/pages/Employees.tsx - API client → FastAPI application: calls REST API
README.md - FastAPI application → Authentication: registers
apps/backend/app/main.py - FastAPI application → Attendance workflow: registers
apps/backend/app/main.py - FastAPI application → Employee endpoints: registers
apps/backend/app/main.py - FastAPI application → Schedules and shifts: registers
apps/backend/app/main.py - Authentication → User accounts: queries
apps/backend/app/api/routes/auth.py - Request authorization → User accounts: loads account
apps/backend/app/api/dependencies/auth.py - Attendance workflow → AI service client: requests recognition
apps/backend/app/api/routes/attendance.py - Attendance workflow → Attendance policy: uses policy
apps/backend/app/api/routes/attendance.py - Attendance workflow → Shift resolution: resolves shift
apps/backend/app/api/routes/attendance.py - Attendance workflow → Attendance recognition: uses recognition
apps/backend/app/api/routes/attendance.py - Attendance workflow → Attendance records: reads and writes
apps/backend/app/api/routes/attendance.py - Employee endpoints → AI service client: enrolls face
apps/backend/app/api/routes/employees.py - AI service client → AI service API: calls recognition API
apps/backend/app/services/ai_client.py - AI service API → Face recognition: uses
apps/ai-service/backend/main.py - AI service API → Liveness analysis: uses
apps/ai-service/backend/main.py - AI service API → Photo validation: uses
apps/ai-service/backend/main.py - AI service API → Liveness sessions: uses
apps/ai-service/backend/main.py - AI service API → Heartbeat liveness: uses
apps/ai-service/backend/main.py - AI service API → Emotion analysis: uses
apps/ai-service/backend/main.py - AI service API → Face embedding store: uses
apps/ai-service/backend/main.py - Database sessions → PostgreSQL: connects
README.md - Attendance records → PostgreSQL: persists in
README.md - Employee records → PostgreSQL: persists in
README.md - User accounts → PostgreSQL: persists in
README.md - AI service API → PostgreSQL: stores embeddings