# isfandiyor0112-star/-attendancesrv architecture

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

- Interactive diagram: https://gitdiagram.com/isfandiyor0112-star/-attendancesrv
- Repository: https://github.com/isfandiyor0112-star/-attendancesrv

## Overview

This is a school attendance web app: teachers sign in, submit absence reports, and review or edit their class records; administrators review attendance, manage teacher accounts, and export reports. The browser clients call an Express API, which stores records in MongoDB and sends report notifications through Telegram. The API excerpt also shows a Telegram-based teacher-management bot. The tree and excerpts do not establish all page wiring or the backing database connection, so the graph omits those uncertain links and focuses on evidenced calls.

Main entry points: [`api/index.js`](https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/api/index.js) (HTTP endpoints), [`public/script.js`](https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/public/script.js) (Login and routing), [`public/teacher.js`](https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/public/teacher.js) (Teacher attendance), [`public/admin.js`](https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/public/admin.js) (Admin dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Web clients"]
  node_login["Login and routing<br/>[script.js]"]
  node_teacher["Teacher attendance<br/>[teacher.js]"]
  node_admin["Admin dashboard<br/>[admin.js]"]
end

subgraph group_service["Attendance API"]
  node_api["HTTP endpoints<br/>[index.js]"]
end

subgraph group_data["Persistence"]
  node_attendance[("Absence records<br/>[index.js]")]
  node_teachers[("Teacher accounts<br/>[index.js]")]
end

subgraph group_integrations["External services"]
  node_telegram["Telegram API"]
end

node_user(("School user"))

node_user -->|"signs in"| node_login
node_login -->|"requests login"| node_api
node_login -->|"routes teacher"| node_teacher
node_login -->|"routes admin"| node_admin
node_teacher -->|"submits and edits"| node_api
node_teacher -->|"loads absences"| node_api
node_admin -->|"loads and clears"| node_api
node_api -->|"reads and writes"| node_attendance
node_api -->|"authenticates and manages"| node_teachers
node_api -->|"sends reports"| node_telegram
node_telegram -.->|"posts bot updates"| node_api

click node_login "https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/public/script.js"
click node_teacher "https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/public/teacher.js"
click node_admin "https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/public/admin.js"
click node_api "https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/api/index.js"
click node_attendance "https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/api/index.js"
click node_teachers "https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/api/index.js"

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_login,node_teacher,node_admin,node_user toneBlue
class node_api toneAmber
class node_attendance,node_teachers toneMint
class node_telegram toneRose
```

## Components

### Web clients

- [Login and routing](https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/public/script.js): `public/script.js`
- [Teacher attendance](https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/public/teacher.js): `public/teacher.js`
- [Admin dashboard](https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/public/admin.js): `public/admin.js`

### Attendance API

- [HTTP endpoints](https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/api/index.js): `api/index.js`

### Persistence

- [Absence records](https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/api/index.js): `api/index.js`
- [Teacher accounts](https://github.com/isfandiyor0112-star/-attendancesrv/blob/main/api/index.js): `api/index.js`

### External services

- **Telegram API**

### Other components

- **School user**

## Connections

- School user → Login and routing: signs in (evidence: `public/script.js`)
- Login and routing → HTTP endpoints: requests login (evidence: `public/script.js`)
- Login and routing → Teacher attendance: routes teacher (evidence: `public/script.js`)
- Login and routing → Admin dashboard: routes admin (evidence: `public/script.js`)
- Teacher attendance → HTTP endpoints: submits and edits (evidence: `public/teacher.js`)
- Teacher attendance → HTTP endpoints: loads absences (evidence: `public/teacher.js`)
- Admin dashboard → HTTP endpoints: loads and clears (evidence: `public/admin.js`)
- HTTP endpoints → Absence records: reads and writes (evidence: `api/index.js`)
- HTTP endpoints → Teacher accounts: authenticates and manages (evidence: `api/index.js`)
- HTTP endpoints → Telegram API: sends reports (evidence: `api/index.js`)
- Telegram API → HTTP endpoints: posts bot updates
