# nvaltryek-001/edulens architecture

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

- Interactive diagram: https://gitdiagram.com/nvaltryek-001/edulens
- Repository: https://github.com/nvaltryek-001/edulens

## Overview

EduLens manages student enrollment and classroom attendance using facial recognition, with an Android client and Flask backend. Teachers capture a classroom image, the backend recognizes enrolled students and records attendance, and administrators manage student records and review reports. The backend also provides authentication, attendance-session handling, and notification support; the Android app documents local Room storage. Android implementation excerpts were not provided, so its internal connections are shown only where documented or left unverified.

Main entry points: [`backend/app.py`](https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/app.py) (API routes), [`app/src/main/java/com/example/ui/screens`](https://github.com/nvaltryek-001/edulens/tree/clean-main/app/src/main/java/com/example/ui/screens) (App screens), [`backend/services/notification_service.py`](https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/services/notification_service.py) (Push notifications), [`app/src/main/java/com/example/ui/screens/AttendanceViewModel.kt`](https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/ui/screens/AttendanceViewModel.kt) (Attendance state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_android["Android client"]
  node_android_ui["App screens"]
  node_camera["Camera preview<br/>[CameraPreview.kt]"]
  node_viewmodel["Attendance state"]
  node_android_api["API client<br/>[ApiClient.kt]"]
  node_api_service["Flask API service<br/>[FlaskApiService.kt]"]
  node_room_repo["Local repository<br/>[AppRepository.kt]"]
  node_room_db[("Room database<br/>[AppDatabase.kt]")]
  node_entities["Local entities<br/>[Entities.kt]"]
end

subgraph group_backend["Backend services"]
  node_flask["API routes<br/>[app.py]"]
  node_auth["JWT authentication<br/>[auth.py]"]
end

subgraph group_recognition["Recognition and enrollment"]
  node_ml["Face recognition core<br/>[ml_core.py]"]
  node_training["Model training<br/>[train_model.py]"]
end

subgraph group_data["Persistence and integrations"]
  node_students[("Student records<br/>[database.py]")]
  node_config["Service configuration<br/>[config.py]"]
  node_notifications["Push notifications"]
end

node_teacher(("Teacher or admin"))
node_firebase["Firebase Cloud Messaging"]

node_teacher -->|"uses"| node_android_ui
node_android_ui -.->|"captures with"| node_camera
node_android_ui -.->|"uses"| node_viewmodel
node_viewmodel -.->|"requests"| node_api_service
node_api_service -.->|"uses"| node_android_api
node_android_api -.->|"calls API"| node_flask
node_android_ui -.->|"uses"| node_room_repo
node_room_repo -.->|"reads and writes"| node_room_db
node_room_db -.->|"stores"| node_entities
node_teacher -->|"administers attendance"| node_flask
node_flask -->|"authenticates with"| node_auth
node_flask -->|"reads and writes"| node_students
node_flask -->|"invokes recognition"| node_ml
node_training -->|"trains with"| node_ml
node_flask -->|"sends through"| node_notifications
node_notifications -->|"loads settings"| node_config
node_notifications -->|"sends messages"| node_firebase

click node_android_ui "https://github.com/nvaltryek-001/edulens/tree/clean-main/app/src/main/java/com/example/ui/screens"
click node_camera "https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/ui/screens/CameraPreview.kt"
click node_viewmodel "https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/ui/screens/AttendanceViewModel.kt"
click node_android_api "https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/api/ApiClient.kt"
click node_api_service "https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/api/FlaskApiService.kt"
click node_room_repo "https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/data/AppRepository.kt"
click node_room_db "https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/data/AppDatabase.kt"
click node_entities "https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/data/Entities.kt"
click node_flask "https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/app.py"
click node_auth "https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/auth.py"
click node_ml "https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/ml_core.py"
click node_training "https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/train_model.py"
click node_students "https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/database.py"
click node_config "https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/config/config.py"
click node_notifications "https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/services/notification_service.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_android_ui,node_camera,node_viewmodel,node_android_api,node_api_service,node_room_repo,node_room_db,node_entities toneBlue
class node_flask,node_auth toneAmber
class node_ml,node_training toneMint
class node_students,node_config,node_notifications toneRose
class node_teacher,node_firebase toneIndigo
```

## Components

### Android client

- [App screens](https://github.com/nvaltryek-001/edulens/tree/clean-main/app/src/main/java/com/example/ui/screens): `app/src/main/java/com/example/ui/screens`
- [Camera preview](https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/ui/screens/CameraPreview.kt): `app/src/main/java/com/example/ui/screens/CameraPreview.kt`
- [Attendance state](https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/ui/screens/AttendanceViewModel.kt): `app/src/main/java/com/example/ui/screens/AttendanceViewModel.kt`
- [API client](https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/api/ApiClient.kt): `app/src/main/java/com/example/api/ApiClient.kt`
- [Flask API service](https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/api/FlaskApiService.kt): `app/src/main/java/com/example/api/FlaskApiService.kt`
- [Local repository](https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/data/AppRepository.kt): `app/src/main/java/com/example/data/AppRepository.kt`
- [Room database](https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/data/AppDatabase.kt): `app/src/main/java/com/example/data/AppDatabase.kt`
- [Local entities](https://github.com/nvaltryek-001/edulens/blob/clean-main/app/src/main/java/com/example/data/Entities.kt): `app/src/main/java/com/example/data/Entities.kt`

### Backend services

- [API routes](https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/app.py): `backend/app.py`
- [JWT authentication](https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/auth.py): `backend/auth.py`

### Recognition and enrollment

- [Face recognition core](https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/ml_core.py): `backend/ml_core.py`
- [Model training](https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/train_model.py): `backend/train_model.py`

### Persistence and integrations

- [Student records](https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/database.py): `backend/database.py`
- [Service configuration](https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/config/config.py): `backend/config/config.py`
- [Push notifications](https://github.com/nvaltryek-001/edulens/blob/clean-main/backend/services/notification_service.py): `backend/services/notification_service.py`

### Other components

- **Teacher or admin**
- **Firebase Cloud Messaging**

## Connections

- Teacher or admin → App screens: uses (evidence: `README.md`)
- App screens → Camera preview: captures with
- App screens → Attendance state: uses
- Attendance state → Flask API service: requests
- Flask API service → API client: uses
- API client → API routes: calls API
- App screens → Local repository: uses
- Local repository → Room database: reads and writes
- Room database → Local entities: stores
- Teacher or admin → API routes: administers attendance (evidence: `README.md`)
- API routes → JWT authentication: authenticates with (evidence: `backend/app.py`)
- API routes → Student records: reads and writes (evidence: `backend/app.py`)
- API routes → Face recognition core: invokes recognition (evidence: `backend/app.py`)
- Model training → Face recognition core: trains with (evidence: `backend/train_model.py`)
- API routes → Push notifications: sends through (evidence: `backend/app.py`)
- Push notifications → Service configuration: loads settings (evidence: `backend/services/notification_service.py`)
- Push notifications → Firebase Cloud Messaging: sends messages (evidence: `backend/services/notification_service.py`)
