# krixn4c/face-attendence-system-new architecture

> Architecture diagram of the GitHub repository krixn4c/face-attendence-system-new, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/krixn4c/face-attendence-system-new
- Repository: https://github.com/krixn4c/face-attendence-system-new

## Overview

This is a web-based student attendance system with administrator management, face enrollment and recognition, attendance records, and reports. The user flow runs from the attendance station or protected admin pages through the frontend API client to the FastAPI backend, where authentication and domain services support student, recognition, attendance, and reporting work against a database. The sampled files show frontend routing, API calls, backend setup, database sessions, and some authentication logic; the README is empty and most domain-service implementations were not sampled, so uncertain internal links are omitted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/App.tsx) (App routing), [`backend/app/main.py`](https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/main.py) (FastAPI app), [`frontend/src/api/client.ts`](https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/api/client.ts) (API client), [`backend/app/models`](https://github.com/krixn4c/face-attendence-system-new/tree/main/backend/app/models) (Domain models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend"]
  node_app["App routing<br/>[App.tsx]"]
  node_auth_context["Auth state<br/>[AuthContext.tsx]"]
  node_protected_route["Protected routes<br/>[ProtectedRoute.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_students_ui["Student management<br/>[Students.tsx]"]
  node_enroll_ui["Face enrollment<br/>[EnrollFace.tsx]"]
  node_station_ui["Attendance station"]
  node_reports_ui["Reports<br/>[Reports.tsx]"]
  node_layout["Dashboard layout"]
end

subgraph group_api["API and authentication"]
  node_api_client["API client<br/>[client.ts]"]
  node_backend["FastAPI app<br/>[main.py]"]
  node_auth_service["Admin authentication<br/>[auth.py]"]
  node_config["Application settings<br/>[config.py]"]
end

subgraph group_domain["Attendance domain"]
  node_student_service["Student operations<br/>[students.py]"]
  node_recognition_service["Face recognition<br/>[recognition.py]"]
  node_face_utils["Face utilities<br/>[face.py]"]
  node_attendance_service["Attendance operations<br/>[attendance.py]"]
  node_reports_service["Report generation<br/>[reports.py]"]
end

subgraph group_data["Persistence"]
  node_models["Domain models"]
  node_db_session["DB sessions<br/>[base.py]"]
  node_database[("Database")]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"provides auth"| node_auth_context
node_app -->|"guards pages"| node_protected_route
node_app -->|"routes through"| node_layout
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_students_ui
node_app -->|"routes to"| node_enroll_ui
node_app -->|"routes to"| node_station_ui
node_app -->|"routes to"| node_reports_ui
node_auth_context -->|"calls"| node_api_client
node_students_ui -.->|"uses"| node_api_client
node_enroll_ui -.->|"uses"| node_api_client
node_station_ui -.->|"uses"| node_api_client
node_reports_ui -.->|"uses"| node_api_client
node_api_client -->|"HTTP requests"| node_backend
node_backend -->|"authenticates"| node_auth_service
node_backend -->|"gets sessions"| node_db_session
node_db_session -->|"reads settings"| node_config
node_db_session -->|"connects"| node_database
node_backend -.->|"dispatches"| node_student_service
node_backend -.->|"dispatches"| node_attendance_service
node_backend -.->|"dispatches"| node_recognition_service
node_backend -.->|"dispatches"| node_reports_service
node_recognition_service -.->|"uses"| node_face_utils
node_student_service -.->|"uses"| node_models
node_attendance_service -.->|"uses"| node_models
node_reports_service -.->|"reads"| node_models
node_auth_service -->|"queries"| node_models

click node_app "https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/App.tsx"
click node_auth_context "https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/contexts/AuthContext.tsx"
click node_protected_route "https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/components/ProtectedRoute.tsx"
click node_dashboard "https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/pages/Dashboard.tsx"
click node_students_ui "https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/pages/Students.tsx"
click node_enroll_ui "https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/pages/EnrollFace.tsx"
click node_station_ui "https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/pages/AttendanceStation.tsx"
click node_reports_ui "https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/pages/Reports.tsx"
click node_layout "https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/layouts/DashboardLayout.tsx"
click node_api_client "https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/api/client.ts"
click node_backend "https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/main.py"
click node_auth_service "https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/services/auth.py"
click node_config "https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/core/config.py"
click node_student_service "https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/services/students.py"
click node_recognition_service "https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/services/recognition.py"
click node_face_utils "https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/utils/face.py"
click node_attendance_service "https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/services/attendance.py"
click node_reports_service "https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/services/reports.py"
click node_models "https://github.com/krixn4c/face-attendence-system-new/tree/main/backend/app/models"
click node_db_session "https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/db/base.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_auth_context,node_protected_route,node_dashboard,node_students_ui,node_enroll_ui,node_station_ui,node_reports_ui,node_layout,node_user toneBlue
class node_api_client,node_backend,node_auth_service,node_config toneAmber
class node_student_service,node_recognition_service,node_face_utils,node_attendance_service,node_reports_service toneMint
class node_models,node_db_session,node_database toneRose
```

## Components

### Frontend

- [App routing](https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Auth state](https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/contexts/AuthContext.tsx): `frontend/src/contexts/AuthContext.tsx`
- [Protected routes](https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/components/ProtectedRoute.tsx): `frontend/src/components/ProtectedRoute.tsx`
- [Dashboard](https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`
- [Student management](https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/pages/Students.tsx): `frontend/src/pages/Students.tsx`
- [Face enrollment](https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/pages/EnrollFace.tsx): `frontend/src/pages/EnrollFace.tsx`
- [Attendance station](https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/pages/AttendanceStation.tsx): `frontend/src/pages/AttendanceStation.tsx`
- [Reports](https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/pages/Reports.tsx): `frontend/src/pages/Reports.tsx`
- [Dashboard layout](https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/layouts/DashboardLayout.tsx): `frontend/src/layouts/DashboardLayout.tsx`

### API and authentication

- [API client](https://github.com/krixn4c/face-attendence-system-new/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [FastAPI app](https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/main.py): `backend/app/main.py`
- [Admin authentication](https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/services/auth.py): `backend/app/services/auth.py`
- [Application settings](https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/core/config.py): `backend/app/core/config.py`

### Attendance domain

- [Student operations](https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/services/students.py): `backend/app/services/students.py`
- [Face recognition](https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/services/recognition.py): `backend/app/services/recognition.py`
- [Face utilities](https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/utils/face.py): `backend/app/utils/face.py`
- [Attendance operations](https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/services/attendance.py): `backend/app/services/attendance.py`
- [Report generation](https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/services/reports.py): `backend/app/services/reports.py`

### Persistence

- [Domain models](https://github.com/krixn4c/face-attendence-system-new/tree/main/backend/app/models): `backend/app/models`
- [DB sessions](https://github.com/krixn4c/face-attendence-system-new/blob/main/backend/app/db/base.py): `backend/app/db/base.py`
- **Database**

### Other components

- **User**

## Connections

- User → App routing: uses (evidence: `frontend/src/App.tsx`)
- App routing → Auth state: provides auth (evidence: `frontend/src/App.tsx`)
- App routing → Protected routes: guards pages (evidence: `frontend/src/App.tsx`)
- App routing → Dashboard layout: routes through (evidence: `frontend/src/App.tsx`)
- App routing → Dashboard: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Student management: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Face enrollment: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Attendance station: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Reports: routes to (evidence: `frontend/src/App.tsx`)
- Auth state → API client: calls (evidence: `frontend/src/contexts/AuthContext.tsx`)
- Student management → API client: uses
- Face enrollment → API client: uses
- Attendance station → API client: uses
- Reports → API client: uses
- API client → FastAPI app: HTTP requests (evidence: `frontend/src/api/client.ts`)
- FastAPI app → Admin authentication: authenticates (evidence: `backend/app/main.py`)
- FastAPI app → DB sessions: gets sessions (evidence: `backend/app/main.py`)
- DB sessions → Application settings: reads settings (evidence: `backend/app/db/base.py`)
- DB sessions → Database: connects (evidence: `backend/app/db/base.py`)
- FastAPI app → Student operations: dispatches (evidence: `backend/app/main.py`)
- FastAPI app → Attendance operations: dispatches (evidence: `backend/app/main.py`)
- FastAPI app → Face recognition: dispatches (evidence: `backend/app/main.py`)
- FastAPI app → Report generation: dispatches (evidence: `backend/app/main.py`)
- Face recognition → Face utilities: uses
- Student operations → Domain models: uses
- Attendance operations → Domain models: uses
- Report generation → Domain models: reads
- Admin authentication → Domain models: queries (evidence: `backend/app/services/auth.py`)
