# charan610/apy architecture

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

- Interactive diagram: https://gitdiagram.com/charan610/apy
- Repository: https://github.com/charan610/apy

## Overview

APY is a shared attendance ledger and bunk-forecasting product with web and Android clients backed by a FastAPI API and shared database. Students authenticate, choose or build a section timetable, record attendance, and view summaries and forecasts; administrators verify students and reset PINs. Notifications and platform-session tracking are additional capabilities. The web client, Android client, and backend have separate implementation paths; README documents their shared live API/database. Some route and notification links are based on documented capabilities where implementation was not sampled.

Main entry points: [`api/main.py`](https://github.com/charan610/apy/blob/main/api/main.py) (API application), [`frontend/src/App.jsx`](https://github.com/charan610/apy/blob/main/frontend/src/App.jsx) (Web app shell), [`apy-android/src/App.jsx`](https://github.com/charan610/apy/blob/main/apy-android/src/App.jsx) (Android app shell), [`api/database.py`](https://github.com/charan610/apy/blob/main/api/database.py) (Shared database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Student clients"]
  node_webapp["Web app shell<br/>[App.jsx]"]
  node_webclient["Web API client<br/>[api.js]"]
  node_webattendance["Attendance views<br/>[TodayTab.jsx]"]
  node_webforecast["Forecast views<br/>[ForecastTab.jsx]"]
  node_webtimetable["Timetable views<br/>[TimetableTab.jsx]"]
  node_websettings["Settings<br/>[SettingsModal.jsx]"]
  node_webadmin["Admin panel<br/>[AdminModal.jsx]"]
  node_androidapp["Android app shell<br/>[App.jsx]"]
  node_androidclient["Android API client<br/>[api.js]"]
  node_nativeauth["Native storage<br/>[nativeStorage.js]"]
end

subgraph group_api["API and domain"]
  node_attendance["Attendance and forecast"]
  node_authroutes["Registration and login<br/>[auth_routes.py]"]
  node_sections["Section timetables<br/>[section_routes.py]"]
  node_approuter["API application<br/>[main.py]"]
end

subgraph group_state["Persistence and identity"]
  node_database[("Shared database<br/>[database.py]")]
  node_auth["Identity and tokens<br/>[auth.py]"]
  node_seed["Official section data<br/>[seed_data.py]"]
end

subgraph group_ops["Admin and notifications"]
  node_adminroutes["Student verification and PIN reset<br/>[admin_routes.py]"]
  node_notifyroutes["Notification preferences"]
  node_notifications["Push delivery<br/>[notifications.py]"]
end

node_student(("Student"))

node_student -->|"uses"| node_webapp
node_student -->|"uses"| node_androidapp
node_webapp -->|"uses"| node_webclient
node_webapp -->|"renders"| node_webattendance
node_webapp -->|"renders"| node_webforecast
node_webapp -->|"renders"| node_webtimetable
node_webapp -->|"renders"| node_websettings
node_webapp -->|"renders"| node_webadmin
node_androidapp -->|"uses"| node_androidclient
node_androidapp -->|"renders"| node_attendance
node_androidapp -->|"renders"| node_webforecast
node_androidapp -->|"renders"| node_webtimetable
node_androidapp -->|"renders"| node_webadmin
node_androidapp -->|"uses"| node_nativeauth
node_webclient -->|"calls shared API"| node_approuter
node_androidclient -->|"calls shared API"| node_approuter
node_approuter -->|"registers"| node_authroutes
node_approuter -->|"registers"| node_sections
node_approuter -->|"registers"| node_attendance
node_approuter -->|"registers"| node_adminroutes
node_approuter -->|"registers"| node_notifyroutes
node_authroutes -->|"reads and writes"| node_database
node_authroutes -->|"uses"| node_auth
node_attendance -->|"reads and writes"| node_database
node_attendance -->|"authenticates"| node_auth
node_sections -->|"reads and writes"| node_database
node_sections -->|"authenticates"| node_auth
node_approuter -->|"seeds locally"| node_seed
node_seed -->|"populates"| node_database
node_adminroutes -->|"reads and writes"| node_database
node_adminroutes -->|"authorizes admin"| node_auth
node_adminroutes -->|"broadcasts updates"| node_notifications
node_notifyroutes -->|"reads and writes"| node_database
node_notifyroutes -->|"authenticates"| node_auth
node_notifyroutes -->|"configures delivery"| node_notifications
node_notifications -->|"loads subscriptions"| node_database

click node_webapp "https://github.com/charan610/apy/blob/main/frontend/src/App.jsx"
click node_webclient "https://github.com/charan610/apy/blob/main/frontend/src/api.js"
click node_webattendance "https://github.com/charan610/apy/blob/main/frontend/src/components/TodayTab.jsx"
click node_webforecast "https://github.com/charan610/apy/blob/main/frontend/src/components/ForecastTab.jsx"
click node_webtimetable "https://github.com/charan610/apy/blob/main/frontend/src/components/TimetableTab.jsx"
click node_websettings "https://github.com/charan610/apy/blob/main/frontend/src/components/SettingsModal.jsx"
click node_webadmin "https://github.com/charan610/apy/blob/main/frontend/src/components/AdminModal.jsx"
click node_androidapp "https://github.com/charan610/apy/blob/main/apy-android/src/App.jsx"
click node_androidclient "https://github.com/charan610/apy/blob/main/apy-android/src/api.js"
click node_nativeauth "https://github.com/charan610/apy/blob/main/apy-android/src/nativeStorage.js"
click node_attendance "https://github.com/charan610/apy/blob/main/api/routers/attendance_routes.py"
click node_authroutes "https://github.com/charan610/apy/blob/main/api/routers/auth_routes.py"
click node_sections "https://github.com/charan610/apy/blob/main/api/routers/section_routes.py"
click node_approuter "https://github.com/charan610/apy/blob/main/api/main.py"
click node_database "https://github.com/charan610/apy/blob/main/api/database.py"
click node_auth "https://github.com/charan610/apy/blob/main/api/auth.py"
click node_seed "https://github.com/charan610/apy/blob/main/api/seed_data.py"
click node_adminroutes "https://github.com/charan610/apy/blob/main/api/routers/admin_routes.py"
click node_notifyroutes "https://github.com/charan610/apy/blob/main/api/routers/notification_routes.py"
click node_notifications "https://github.com/charan610/apy/blob/main/api/notifications.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_webapp,node_webclient,node_webattendance,node_webforecast,node_webtimetable,node_websettings,node_webadmin,node_androidapp,node_androidclient,node_nativeauth toneBlue
class node_attendance,node_authroutes,node_sections,node_approuter toneAmber
class node_database,node_auth,node_seed toneMint
class node_adminroutes,node_notifyroutes,node_notifications toneRose
class node_student toneIndigo
```

## Components

### Student clients

- [Web app shell](https://github.com/charan610/apy/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Web API client](https://github.com/charan610/apy/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Attendance views](https://github.com/charan610/apy/blob/main/frontend/src/components/TodayTab.jsx): `frontend/src/components/TodayTab.jsx`
- [Forecast views](https://github.com/charan610/apy/blob/main/frontend/src/components/ForecastTab.jsx): `frontend/src/components/ForecastTab.jsx`
- [Timetable views](https://github.com/charan610/apy/blob/main/frontend/src/components/TimetableTab.jsx): `frontend/src/components/TimetableTab.jsx`
- [Settings](https://github.com/charan610/apy/blob/main/frontend/src/components/SettingsModal.jsx): `frontend/src/components/SettingsModal.jsx`
- [Admin panel](https://github.com/charan610/apy/blob/main/frontend/src/components/AdminModal.jsx): `frontend/src/components/AdminModal.jsx`
- [Android app shell](https://github.com/charan610/apy/blob/main/apy-android/src/App.jsx): `apy-android/src/App.jsx`
- [Android API client](https://github.com/charan610/apy/blob/main/apy-android/src/api.js): `apy-android/src/api.js`
- [Native storage](https://github.com/charan610/apy/blob/main/apy-android/src/nativeStorage.js): `apy-android/src/nativeStorage.js`

### API and domain

- [Attendance and forecast](https://github.com/charan610/apy/blob/main/api/routers/attendance_routes.py): `api/routers/attendance_routes.py`
- [Registration and login](https://github.com/charan610/apy/blob/main/api/routers/auth_routes.py): `api/routers/auth_routes.py`
- [Section timetables](https://github.com/charan610/apy/blob/main/api/routers/section_routes.py): `api/routers/section_routes.py`
- [API application](https://github.com/charan610/apy/blob/main/api/main.py): `api/main.py`

### Persistence and identity

- [Shared database](https://github.com/charan610/apy/blob/main/api/database.py): `api/database.py`
- [Identity and tokens](https://github.com/charan610/apy/blob/main/api/auth.py): `api/auth.py`
- [Official section data](https://github.com/charan610/apy/blob/main/api/seed_data.py): `api/seed_data.py`

### Admin and notifications

- [Student verification and PIN reset](https://github.com/charan610/apy/blob/main/api/routers/admin_routes.py): `api/routers/admin_routes.py`
- [Notification preferences](https://github.com/charan610/apy/blob/main/api/routers/notification_routes.py): `api/routers/notification_routes.py`
- [Push delivery](https://github.com/charan610/apy/blob/main/api/notifications.py): `api/notifications.py`

### Other components

- **Student**

## Connections

- Student → Web app shell: uses
- Student → Android app shell: uses
- Web app shell → Web API client: uses (evidence: `frontend/src/App.jsx`)
- Web app shell → Attendance views: renders (evidence: `frontend/src/App.jsx`)
- Web app shell → Forecast views: renders (evidence: `frontend/src/App.jsx`)
- Web app shell → Timetable views: renders (evidence: `frontend/src/App.jsx`)
- Web app shell → Settings: renders (evidence: `frontend/src/App.jsx`)
- Web app shell → Admin panel: renders (evidence: `frontend/src/App.jsx`)
- Android app shell → Android API client: uses (evidence: `apy-android/src/App.jsx`)
- Android app shell → Attendance and forecast: renders (evidence: `apy-android/src/App.jsx`)
- Android app shell → Forecast views: renders (evidence: `apy-android/src/App.jsx`)
- Android app shell → Timetable views: renders (evidence: `apy-android/src/App.jsx`)
- Android app shell → Admin panel: renders (evidence: `apy-android/src/App.jsx`)
- Android app shell → Native storage: uses
- Web API client → API application: calls shared API
- Android API client → API application: calls shared API
- API application → Registration and login: registers (evidence: `api/main.py`)
- API application → Section timetables: registers (evidence: `api/main.py`)
- API application → Attendance and forecast: registers (evidence: `api/main.py`)
- API application → Student verification and PIN reset: registers (evidence: `api/main.py`)
- API application → Notification preferences: registers (evidence: `api/main.py`)
- Registration and login → Shared database: reads and writes (evidence: `api/routers/auth_routes.py`)
- Registration and login → Identity and tokens: uses (evidence: `api/routers/auth_routes.py`)
- Attendance and forecast → Shared database: reads and writes (evidence: `api/routers/attendance_routes.py`)
- Attendance and forecast → Identity and tokens: authenticates (evidence: `api/routers/attendance_routes.py`)
- Section timetables → Shared database: reads and writes (evidence: `api/routers/section_routes.py`)
- Section timetables → Identity and tokens: authenticates (evidence: `api/routers/section_routes.py`)
- API application → Official section data: seeds locally (evidence: `api/main.py`)
- Official section data → Shared database: populates (evidence: `api/seed_data.py`)
- Student verification and PIN reset → Shared database: reads and writes (evidence: `api/routers/admin_routes.py`)
- Student verification and PIN reset → Identity and tokens: authorizes admin (evidence: `api/routers/admin_routes.py`)
- Student verification and PIN reset → Push delivery: broadcasts updates (evidence: `api/routers/admin_routes.py`)
- Notification preferences → Shared database: reads and writes (evidence: `api/routers/notification_routes.py`)
- Notification preferences → Identity and tokens: authenticates (evidence: `api/routers/notification_routes.py`)
- Notification preferences → Push delivery: configures delivery (evidence: `api/routers/notification_routes.py`)
- Push delivery → Shared database: loads subscriptions (evidence: `api/notifications.py`)
