# amanvermaportfolio/ai-attendence-system architecture

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

- Interactive diagram: https://gitdiagram.com/amanvermaportfolio/ai-attendence-system
- Repository: https://github.com/amanvermaportfolio/ai-attendence-system

## Overview

SnapClass is a Streamlit attendance app for teachers and students. Users enter through the home screen or a shared join code; teachers manage subjects and run face- or voice-based attendance, while students authenticate by face, enroll, and review attendance. Attendance is presented for confirmation and saved to Supabase. The graph preserves the major screen and dialog capabilities indicated by the source index; unsampled component internals are represented at their exact file paths, with only documented or indexed connections shown.

Main entry points: [`src/screens/teacher_screen.py`](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/screens/teacher_screen.py) (Teacher screen), [`src/screens/student_screen.py`](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/screens/student_screen.py) (Student screen), [`src/database/db.py`](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/database/db.py) (Data access), [`app.py`](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/app.py) (Streamlit app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_app["Streamlit app<br/>[app.py]"]
end

subgraph group_screens["User screens"]
  node_home["Home screen<br/>[home_screen.py]"]
  node_teacher["Teacher screen<br/>[teacher_screen.py]"]
  node_student["Student screen<br/>[student_screen.py]"]
  node_layout["Base layout<br/>[base_layout.py]"]
  node_header["Header<br/>[header.py]"]
  node_footer["Footer<br/>[footer.py]"]
  node_subject_card["Subject card<br/>[subject_card.py]"]
  node_subject_create["Create subject"]
  node_subject_share["Share subject"]
  node_enroll["Student enrollment<br/>[dialog_enroll.py]"]
  node_auto_enroll["Join-code enrollment"]
end

subgraph group_attendance["Attendance workflows"]
  node_photo_add["Attendance photos"]
  node_voice_dialog["Voice attendance"]
  node_results["Attendance review"]
end

subgraph group_identity["Identity pipelines"]
  node_face_pipe["Face attendance<br/>[face_pipeline.py]"]
  node_voice_pipe["Voice recognition<br/>[voice_pipeline.py]"]
end

subgraph group_data["Data services"]
  node_db["Data access<br/>[db.py]"]
  node_config["Supabase client<br/>[config.py]"]
end

node_user(("User"))
node_supabase[("Supabase")]

node_user -->|"opens"| node_app
node_app -->|"routes"| node_home
node_app -->|"routes"| node_teacher
node_app -->|"routes"| node_student
node_app -->|"opens join"| node_auto_enroll
node_home -->|"renders"| node_header
node_home -->|"renders"| node_footer
node_home -->|"uses styles"| node_layout
node_teacher -->|"renders"| node_header
node_teacher -->|"renders"| node_footer
node_teacher -->|"uses styles"| node_layout
node_teacher -->|"renders"| node_subject_card
node_teacher -->|"opens"| node_subject_create
node_teacher -->|"opens"| node_subject_share
node_teacher -->|"opens"| node_photo_add
node_teacher -->|"recognizes faces"| node_face_pipe
node_teacher -->|"opens"| node_voice_dialog
node_teacher -->|"reviews attendance"| node_results
node_student -->|"renders"| node_header
node_student -->|"renders"| node_footer
node_student -->|"uses styles"| node_layout
node_student -->|"renders"| node_subject_card
node_student -->|"opens"| node_enroll
node_student -->|"authenticates"| node_face_pipe
node_student -->|"creates voice profile"| node_voice_pipe
node_voice_dialog -->|"processes audio"| node_voice_pipe
node_voice_dialog -->|"shows results"| node_results
node_results -->|"saves logs"| node_db
node_face_pipe -->|"loads students"| node_db
node_subject_create -->|"creates subject"| node_db
node_subject_share -.->|"manages sharing"| node_db
node_photo_add -->|"stores photos"| node_db
node_enroll -->|"enrolls student"| node_db
node_auto_enroll -->|"enrolls student"| node_db
node_student -->|"reads profile and records"| node_db
node_teacher -->|"reads teacher data"| node_db
node_voice_dialog -->|"queries enrollment"| node_config
node_photo_add -->|"uses client"| node_config
node_results -->|"uses client"| node_config
node_db -->|"imports client"| node_config
node_config -->|"connects"| node_supabase

click node_app "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/app.py"
click node_home "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/screens/home_screen.py"
click node_teacher "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/screens/teacher_screen.py"
click node_student "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/screens/student_screen.py"
click node_layout "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/ui/base_layout.py"
click node_header "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/header.py"
click node_footer "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/footer.py"
click node_subject_card "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/subject_card.py"
click node_subject_create "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_create_subject.py"
click node_subject_share "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_share_subject.py"
click node_enroll "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_enroll.py"
click node_auto_enroll "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_auto_enroll.py"
click node_photo_add "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_add_photo.py"
click node_face_pipe "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/pipelines/face_pipeline.py"
click node_voice_dialog "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_voice_attendance.py"
click node_voice_pipe "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/pipelines/voice_pipeline.py"
click node_results "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_attendance_results.py"
click node_db "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/database/db.py"
click node_config "https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/database/config.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_user toneBlue
class node_home,node_teacher,node_student,node_layout,node_header,node_footer,node_subject_card,node_subject_create,node_subject_share,node_enroll,node_auto_enroll,node_supabase toneAmber
class node_photo_add,node_voice_dialog,node_results toneMint
class node_face_pipe,node_voice_pipe toneRose
class node_db,node_config toneIndigo
```

## Components

### App entry

- [Streamlit app](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/app.py): `app.py`

### User screens

- [Home screen](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/screens/home_screen.py): `src/screens/home_screen.py`
- [Teacher screen](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/screens/teacher_screen.py): `src/screens/teacher_screen.py`
- [Student screen](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/screens/student_screen.py): `src/screens/student_screen.py`
- [Base layout](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/ui/base_layout.py): `src/ui/base_layout.py`
- [Header](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/header.py): `src/components/header.py`
- [Footer](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/footer.py): `src/components/footer.py`
- [Subject card](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/subject_card.py): `src/components/subject_card.py`
- [Create subject](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_create_subject.py): `src/components/dialog_create_subject.py`
- [Share subject](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_share_subject.py): `src/components/dialog_share_subject.py`
- [Student enrollment](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_enroll.py): `src/components/dialog_enroll.py`
- [Join-code enrollment](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_auto_enroll.py): `src/components/dialog_auto_enroll.py`

### Attendance workflows

- [Attendance photos](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_add_photo.py): `src/components/dialog_add_photo.py`
- [Voice attendance](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_voice_attendance.py): `src/components/dialog_voice_attendance.py`
- [Attendance review](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/components/dialog_attendance_results.py): `src/components/dialog_attendance_results.py`

### Identity pipelines

- [Face attendance](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/pipelines/face_pipeline.py): `src/pipelines/face_pipeline.py`
- [Voice recognition](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/pipelines/voice_pipeline.py): `src/pipelines/voice_pipeline.py`

### Data services

- [Data access](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/database/db.py): `src/database/db.py`
- [Supabase client](https://github.com/amanvermaportfolio/ai-attendence-system/blob/main/src/database/config.py): `src/database/config.py`

### Other components

- **User**
- **Supabase**

## Connections

- User → Streamlit app: opens (evidence: `app.py`)
- Streamlit app → Home screen: routes (evidence: `app.py`)
- Streamlit app → Teacher screen: routes (evidence: `app.py`)
- Streamlit app → Student screen: routes (evidence: `app.py`)
- Streamlit app → Join-code enrollment: opens join (evidence: `app.py`)
- Home screen → Header: renders (evidence: `src/screens/home_screen.py`)
- Home screen → Footer: renders (evidence: `src/screens/home_screen.py`)
- Home screen → Base layout: uses styles (evidence: `src/screens/home_screen.py`)
- Teacher screen → Header: renders (evidence: `src/screens/teacher_screen.py`)
- Teacher screen → Footer: renders (evidence: `src/screens/teacher_screen.py`)
- Teacher screen → Base layout: uses styles (evidence: `src/screens/teacher_screen.py`)
- Teacher screen → Subject card: renders (evidence: `src/screens/teacher_screen.py`)
- Teacher screen → Create subject: opens (evidence: `src/screens/teacher_screen.py`)
- Teacher screen → Share subject: opens (evidence: `src/screens/teacher_screen.py`)
- Teacher screen → Attendance photos: opens (evidence: `src/screens/teacher_screen.py`)
- Teacher screen → Face attendance: recognizes faces (evidence: `src/screens/teacher_screen.py`)
- Teacher screen → Voice attendance: opens (evidence: `src/screens/teacher_screen.py`)
- Teacher screen → Attendance review: reviews attendance (evidence: `src/screens/teacher_screen.py`)
- Student screen → Header: renders (evidence: `src/screens/student_screen.py`)
- Student screen → Footer: renders (evidence: `src/screens/student_screen.py`)
- Student screen → Base layout: uses styles (evidence: `src/screens/student_screen.py`)
- Student screen → Subject card: renders (evidence: `src/screens/student_screen.py`)
- Student screen → Student enrollment: opens (evidence: `src/screens/student_screen.py`)
- Student screen → Face attendance: authenticates (evidence: `src/screens/student_screen.py`)
- Student screen → Voice recognition: creates voice profile (evidence: `src/screens/student_screen.py`)
- Voice attendance → Voice recognition: processes audio (evidence: `src/components/dialog_voice_attendance.py`)
- Voice attendance → Attendance review: shows results (evidence: `src/components/dialog_voice_attendance.py`)
- Attendance review → Data access: saves logs (evidence: `src/components/dialog_attendance_results.py`)
- Face attendance → Data access: loads students (evidence: `src/pipelines/face_pipeline.py`)
- Create subject → Data access: creates subject (evidence: `src/components/dialog_create_subject.py`)
- Share subject → Data access: manages sharing
- Attendance photos → Data access: stores photos (evidence: `src/components/dialog_add_photo.py`)
- Student enrollment → Data access: enrolls student (evidence: `src/components/dialog_enroll.py`)
- Join-code enrollment → Data access: enrolls student (evidence: `src/components/dialog_auto_enroll.py`)
- Student screen → Data access: reads profile and records (evidence: `src/screens/student_screen.py`)
- Teacher screen → Data access: reads teacher data (evidence: `src/screens/teacher_screen.py`)
- Voice attendance → Supabase client: queries enrollment (evidence: `src/components/dialog_voice_attendance.py`)
- Attendance photos → Supabase client: uses client (evidence: `src/components/dialog_add_photo.py`)
- Attendance review → Supabase client: uses client (evidence: `src/components/dialog_attendance_results.py`)
- Data access → Supabase client: imports client (evidence: `src/database/db.py`)
- Supabase client → Supabase: connects (evidence: `src/database/config.py`)
