# sharmakanishka05/ai_attendance architecture

> Architecture diagram of the GitHub repository sharmakanishka05/ai_attendance, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sharmakanishka05/ai_attendance
- Repository: https://github.com/sharmakanishka05/ai_attendance

## Overview

AttendAI is a web-based attendance system for schools and organizations. Teachers create a class session, capture or upload a classroom image, review face matches and unknown faces, then confirm attendance; administrators also manage students, classes, and system settings. The backend combines authenticated API routes, face analysis, and attendance services with persistent records. Reporting and exports provide a separate results branch. The README documents capabilities beyond the sampled backend excerpts; links to those features are shown only where the tree supports a route.

Main entry points: [`frontend/lib/api.ts`](https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/lib/api.ts) (API client), [`backend/app/main.py`](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/db/database.py`](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/db/database.py) (Application database), [`backend/app/api/attendance.py`](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/attendance.py) (Attendance operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_login["Login page<br/>[page.tsx]"]
  node_attendance_ui["Attendance workspace<br/>[page.tsx]"]
  node_review["Attendance review"]
  node_capture["Camera and upload<br/>[CameraCapture.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_reports_ui["Reports page<br/>[page.tsx]"]
  node_students_ui["Students page<br/>[page.tsx]"]
  node_classes_ui["Classes page<br/>[page.tsx]"]
  node_sessions_ui["Sessions page<br/>[page.tsx]"]
  node_settings_ui["Settings page<br/>[page.tsx]"]
end

subgraph group_api["API and access"]
  node_auth_api["Authentication<br/>[auth.py]"]
  node_main["FastAPI application<br/>[main.py]"]
  node_database[("Application database<br/>[database.py]")]
end

subgraph group_attendance["Attendance workflow"]
  node_sessions_api["Session management<br/>[sessions.py]"]
  node_attendance_api["Attendance operations<br/>[attendance.py]"]
  node_face_pipeline["Face recognition<br/>[face_pipeline.py]"]
  node_quality["Image quality checks<br/>[quality_check.py]"]
  node_attendance_svc["Attendance service<br/>[attendance_svc.py]"]
end

subgraph group_admin["Administration and reporting"]
  node_students_api["Student management<br/>[students.py]"]
  node_classes_api["Class management<br/>[classes.py]"]
  node_reports_api["Reports and exports<br/>[reports.py]"]
  node_settings_api["System settings<br/>[settings.py]"]
end

node_teacher(("Teacher / admin"))

node_teacher -->|"signs in"| node_login
node_teacher -->|"uses"| node_dashboard
node_dashboard -->|"requests data"| node_api_client
node_login -->|"authenticates via"| node_api_client
node_api_client -->|"sends API requests"| node_main
node_main -->|"mounts routes"| node_auth_api
node_main -->|"mounts routes"| node_students_api
node_main -->|"mounts routes"| node_classes_api
node_main -->|"mounts routes"| node_sessions_api
node_main -->|"mounts routes"| node_attendance_api
node_main -->|"mounts routes"| node_reports_api
node_main -->|"mounts routes"| node_settings_api
node_auth_api -->|"reads users"| node_database
node_students_api -->|"reads and writes"| node_database
node_classes_api -->|"reads and writes"| node_database
node_sessions_api -->|"reads sessions"| node_database
node_sessions_api -->|"gets or creates session"| node_attendance_svc
node_attendance_api -->|"analyzes faces"| node_face_pipeline
node_attendance_api -->|"checks image quality"| node_quality
node_attendance_api -->|"records attendance"| node_attendance_svc
node_attendance_api -->|"reads and writes"| node_database
node_attendance_svc -->|"reads and writes"| node_database
node_attendance_ui -->|"captures image"| node_capture
node_attendance_ui -->|"presents matches"| node_review
node_attendance_ui -->|"requests session and attendance"| node_api_client
node_review -->|"submits review"| node_attendance_ui
node_students_ui -->|"requests student data"| node_api_client
node_classes_ui -->|"requests class data"| node_api_client
node_sessions_ui -->|"requests session data"| node_api_client
node_reports_ui -->|"requests reports"| node_api_client
node_api_client -->|"requests reports and exports"| node_reports_api
node_settings_ui -->|"requests settings"| node_api_client
node_api_client -->|"requests configuration"| node_settings_api
node_reports_api -->|"queries attendance"| node_database
node_settings_api -->|"reads and writes settings"| node_database

click node_dashboard "https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/page.tsx"
click node_login "https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/login/page.tsx"
click node_attendance_ui "https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/attendance/page.tsx"
click node_review "https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/components/attendance/AttendanceReview.tsx"
click node_capture "https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/components/attendance/CameraCapture.tsx"
click node_api_client "https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/lib/api.ts"
click node_auth_api "https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/auth.py"
click node_main "https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/main.py"
click node_students_api "https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/students.py"
click node_classes_api "https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/classes.py"
click node_sessions_api "https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/sessions.py"
click node_attendance_api "https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/attendance.py"
click node_face_pipeline "https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/services/face_pipeline.py"
click node_quality "https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/services/quality_check.py"
click node_attendance_svc "https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/services/attendance_svc.py"
click node_database "https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/db/database.py"
click node_reports_ui "https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/reports/page.tsx"
click node_reports_api "https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/reports.py"
click node_students_ui "https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/students/page.tsx"
click node_classes_ui "https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/classes/page.tsx"
click node_sessions_ui "https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/sessions/page.tsx"
click node_settings_ui "https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/settings/page.tsx"
click node_settings_api "https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/settings.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_dashboard,node_login,node_attendance_ui,node_review,node_capture,node_api_client,node_reports_ui,node_students_ui,node_classes_ui,node_sessions_ui,node_settings_ui toneBlue
class node_auth_api,node_main,node_database toneAmber
class node_sessions_api,node_attendance_api,node_face_pipeline,node_quality,node_attendance_svc toneMint
class node_students_api,node_classes_api,node_reports_api,node_settings_api toneRose
class node_teacher toneIndigo
```

## Components

### Web application

- [Dashboard](https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/page.tsx): `frontend/app/page.tsx`
- [Login page](https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/login/page.tsx): `frontend/app/login/page.tsx`
- [Attendance workspace](https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/attendance/page.tsx): `frontend/app/attendance/page.tsx`
- [Attendance review](https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/components/attendance/AttendanceReview.tsx): `frontend/components/attendance/AttendanceReview.tsx`
- [Camera and upload](https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/components/attendance/CameraCapture.tsx): `frontend/components/attendance/CameraCapture.tsx`
- [API client](https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`
- [Reports page](https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/reports/page.tsx): `frontend/app/reports/page.tsx`
- [Students page](https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/students/page.tsx): `frontend/app/students/page.tsx`
- [Classes page](https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/classes/page.tsx): `frontend/app/classes/page.tsx`
- [Sessions page](https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/sessions/page.tsx): `frontend/app/sessions/page.tsx`
- [Settings page](https://github.com/sharmakanishka05/ai_attendance/blob/main/frontend/app/settings/page.tsx): `frontend/app/settings/page.tsx`

### API and access

- [Authentication](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [FastAPI application](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/main.py): `backend/app/main.py`
- [Application database](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/db/database.py): `backend/app/db/database.py`

### Attendance workflow

- [Session management](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/sessions.py): `backend/app/api/sessions.py`
- [Attendance operations](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/attendance.py): `backend/app/api/attendance.py`
- [Face recognition](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/services/face_pipeline.py): `backend/app/services/face_pipeline.py`
- [Image quality checks](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/services/quality_check.py): `backend/app/services/quality_check.py`
- [Attendance service](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/services/attendance_svc.py): `backend/app/services/attendance_svc.py`

### Administration and reporting

- [Student management](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/students.py): `backend/app/api/students.py`
- [Class management](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/classes.py): `backend/app/api/classes.py`
- [Reports and exports](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/reports.py): `backend/app/api/reports.py`
- [System settings](https://github.com/sharmakanishka05/ai_attendance/blob/main/backend/app/api/settings.py): `backend/app/api/settings.py`

### Other components

- **Teacher / admin**

## Connections

- Teacher / admin → Login page: signs in
- Teacher / admin → Dashboard: uses
- Dashboard → API client: requests data
- Login page → API client: authenticates via
- API client → FastAPI application: sends API requests
- FastAPI application → Authentication: mounts routes
- FastAPI application → Student management: mounts routes
- FastAPI application → Class management: mounts routes
- FastAPI application → Session management: mounts routes
- FastAPI application → Attendance operations: mounts routes
- FastAPI application → Reports and exports: mounts routes
- FastAPI application → System settings: mounts routes
- Authentication → Application database: reads users
- Student management → Application database: reads and writes
- Class management → Application database: reads and writes
- Session management → Application database: reads sessions
- Session management → Attendance service: gets or creates session
- Attendance operations → Face recognition: analyzes faces
- Attendance operations → Image quality checks: checks image quality
- Attendance operations → Attendance service: records attendance
- Attendance operations → Application database: reads and writes
- Attendance service → Application database: reads and writes
- Attendance workspace → Camera and upload: captures image
- Attendance workspace → Attendance review: presents matches
- Attendance workspace → API client: requests session and attendance
- Attendance review → Attendance workspace: submits review
- Students page → API client: requests student data
- Classes page → API client: requests class data
- Sessions page → API client: requests session data
- Reports page → API client: requests reports
- API client → Reports and exports: requests reports and exports
- Settings page → API client: requests settings
- API client → System settings: requests configuration
- Reports and exports → Application database: queries attendance
- System settings → Application database: reads and writes settings
