# cybertony77/pages architecture

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

- Interactive diagram: https://gitdiagram.com/cybertony77/pages
- Repository: https://github.com/cybertony77/pages

## Overview

TopPhysics is an attendance and student-management application for a physics academy, with assistant accounts, center management, attendance tracking, and parent messaging. The main user journey is assistant sign-in followed by dashboard tasks such as managing students, recording attendance, and reviewing session information. The graph preserves the major page-level capabilities and sampled API responsibilities. Source excerpts show MongoDB access and a WhatsApp-sending invocation, but do not expose most page-to-API wiring, so those relationships are omitted; README documentation was not provided.

Main entry points: [`pages/api/students/[id]/send-whatsapp.js`](https://github.com/cybertony77/pages/blob/main/pages/api/students/%5Bid%5D/send-whatsapp.js) (WhatsApp dispatch), [`pages/api/students/index.js`](https://github.com/cybertony77/pages/blob/main/pages/api/students/index.js) (Student collection API), [`pages/api/centers/index.js`](https://github.com/cybertony77/pages/blob/main/pages/api/centers/index.js) (Centers API), [`pages/api/auth/me.js`](https://github.com/cybertony77/pages/blob/main/pages/api/auth/me.js) (Profile API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Assistant access"]
  node_login["Assistant login<br/>[index.jsx]"]
  node_dashboard["Dashboard<br/>[index.jsx]"]
end

subgraph group_students["Student operations"]
  node_student_create["Add student<br/>[add_student.jsx]"]
  node_student_list["Student list<br/>[all_students.jsx]"]
  node_student_edit["Edit student<br/>[edit_student.jsx]"]
  node_student_delete["Delete student<br/>[delete_student.jsx]"]
  node_student_detail["Student details<br/>[student_info.jsx]"]
end

subgraph group_attendance["Attendance workflows"]
  node_history["Attendance history<br/>[history.jsx]"]
  node_session_info["Session information<br/>[session_info.jsx]"]
  node_scanner["QR scanner<br/>[QRScanner.jsx]"]
  node_scan_page["Scan attendance<br/>[scan_page.jsx]"]
  node_qr_generator["QR generator<br/>[qr_generator.jsx]"]
end

subgraph group_management["Account and center management"]
  node_centers_ui["Center management<br/>[centers.jsx]"]
  node_assistants_home["Assistant management<br/>[index.jsx]"]
  node_assistant_add["Add assistant<br/>[add_assistant.jsx]"]
  node_assistant_list["Assistant list<br/>[all_assistants.jsx]"]
  node_assistant_edit["Edit assistant<br/>[edit_assistant.jsx]"]
  node_assistant_delete["Delete assistant"]
  node_profile_edit["Edit profile"]
end

subgraph group_services["Application services"]
  node_student_api["Student collection API<br/>[index.js]"]
  node_centers_api["Centers API<br/>[index.js]"]
  node_profile_api["Profile API<br/>[me.js]"]
  node_whatsapp_api["WhatsApp dispatch<br/>[send-whatsapp.js]"]
end

node_assistant(("Assistant"))
node_mongo[("MongoDB")]
node_whatsapp["WhatsApp"]

node_assistant -->|"signs in"| node_login
node_student_api -->|"reads and writes"| node_mongo
node_centers_api -->|"reads and writes"| node_mongo
node_profile_api -->|"reads and writes"| node_mongo
node_whatsapp_api -->|"reads and updates"| node_mongo
node_whatsapp_api -.->|"dispatches message"| node_whatsapp

click node_login "https://github.com/cybertony77/pages/blob/main/pages/index.jsx"
click node_dashboard "https://github.com/cybertony77/pages/blob/main/pages/dashboard/index.jsx"
click node_student_create "https://github.com/cybertony77/pages/blob/main/pages/dashboard/add_student.jsx"
click node_student_list "https://github.com/cybertony77/pages/blob/main/pages/dashboard/all_students.jsx"
click node_student_edit "https://github.com/cybertony77/pages/blob/main/pages/dashboard/edit_student.jsx"
click node_student_delete "https://github.com/cybertony77/pages/blob/main/pages/dashboard/delete_student.jsx"
click node_student_detail "https://github.com/cybertony77/pages/blob/main/pages/dashboard/student_info.jsx"
click node_history "https://github.com/cybertony77/pages/blob/main/pages/dashboard/history.jsx"
click node_session_info "https://github.com/cybertony77/pages/blob/main/pages/dashboard/session_info.jsx"
click node_scanner "https://github.com/cybertony77/pages/blob/main/QRScanner.jsx"
click node_scan_page "https://github.com/cybertony77/pages/blob/main/pages/dashboard/scan_page.jsx"
click node_qr_generator "https://github.com/cybertony77/pages/blob/main/pages/dashboard/qr_generator.jsx"
click node_centers_ui "https://github.com/cybertony77/pages/blob/main/pages/dashboard/centers.jsx"
click node_assistants_home "https://github.com/cybertony77/pages/blob/main/pages/manage_assistants/index.jsx"
click node_assistant_add "https://github.com/cybertony77/pages/blob/main/pages/manage_assistants/add_assistant.jsx"
click node_assistant_list "https://github.com/cybertony77/pages/blob/main/pages/manage_assistants/all_assistants.jsx"
click node_assistant_edit "https://github.com/cybertony77/pages/blob/main/pages/manage_assistants/edit_assistant.jsx"
click node_assistant_delete "https://github.com/cybertony77/pages/blob/main/pages/manage_assistants/delete_assistant.jsx"
click node_profile_edit "https://github.com/cybertony77/pages/blob/main/pages/manage_assistants/edit_my_profile.jsx"
click node_student_api "https://github.com/cybertony77/pages/blob/main/pages/api/students/index.js"
click node_centers_api "https://github.com/cybertony77/pages/blob/main/pages/api/centers/index.js"
click node_profile_api "https://github.com/cybertony77/pages/blob/main/pages/api/auth/me.js"
click node_whatsapp_api "https://github.com/cybertony77/pages/blob/main/pages/api/students/%5Bid%5D/send-whatsapp.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_dashboard toneBlue
class node_student_create,node_student_list,node_student_edit,node_student_delete,node_student_detail,node_mongo toneAmber
class node_history,node_session_info,node_scanner,node_scan_page,node_qr_generator toneMint
class node_centers_ui,node_assistants_home,node_assistant_add,node_assistant_list,node_assistant_edit,node_assistant_delete,node_profile_edit toneRose
class node_student_api,node_centers_api,node_profile_api,node_whatsapp_api,node_assistant,node_whatsapp toneIndigo
```

## Components

### Assistant access

- [Assistant login](https://github.com/cybertony77/pages/blob/main/pages/index.jsx): `pages/index.jsx`
- [Dashboard](https://github.com/cybertony77/pages/blob/main/pages/dashboard/index.jsx): `pages/dashboard/index.jsx`

### Student operations

- [Add student](https://github.com/cybertony77/pages/blob/main/pages/dashboard/add_student.jsx): `pages/dashboard/add_student.jsx`
- [Student list](https://github.com/cybertony77/pages/blob/main/pages/dashboard/all_students.jsx): `pages/dashboard/all_students.jsx`
- [Edit student](https://github.com/cybertony77/pages/blob/main/pages/dashboard/edit_student.jsx): `pages/dashboard/edit_student.jsx`
- [Delete student](https://github.com/cybertony77/pages/blob/main/pages/dashboard/delete_student.jsx): `pages/dashboard/delete_student.jsx`
- [Student details](https://github.com/cybertony77/pages/blob/main/pages/dashboard/student_info.jsx): `pages/dashboard/student_info.jsx`

### Attendance workflows

- [Attendance history](https://github.com/cybertony77/pages/blob/main/pages/dashboard/history.jsx): `pages/dashboard/history.jsx`
- [Session information](https://github.com/cybertony77/pages/blob/main/pages/dashboard/session_info.jsx): `pages/dashboard/session_info.jsx`
- [QR scanner](https://github.com/cybertony77/pages/blob/main/QRScanner.jsx): `QRScanner.jsx`
- [Scan attendance](https://github.com/cybertony77/pages/blob/main/pages/dashboard/scan_page.jsx): `pages/dashboard/scan_page.jsx`
- [QR generator](https://github.com/cybertony77/pages/blob/main/pages/dashboard/qr_generator.jsx): `pages/dashboard/qr_generator.jsx`

### Account and center management

- [Center management](https://github.com/cybertony77/pages/blob/main/pages/dashboard/centers.jsx): `pages/dashboard/centers.jsx`
- [Assistant management](https://github.com/cybertony77/pages/blob/main/pages/manage_assistants/index.jsx): `pages/manage_assistants/index.jsx`
- [Add assistant](https://github.com/cybertony77/pages/blob/main/pages/manage_assistants/add_assistant.jsx): `pages/manage_assistants/add_assistant.jsx`
- [Assistant list](https://github.com/cybertony77/pages/blob/main/pages/manage_assistants/all_assistants.jsx): `pages/manage_assistants/all_assistants.jsx`
- [Edit assistant](https://github.com/cybertony77/pages/blob/main/pages/manage_assistants/edit_assistant.jsx): `pages/manage_assistants/edit_assistant.jsx`
- [Delete assistant](https://github.com/cybertony77/pages/blob/main/pages/manage_assistants/delete_assistant.jsx): `pages/manage_assistants/delete_assistant.jsx`
- [Edit profile](https://github.com/cybertony77/pages/blob/main/pages/manage_assistants/edit_my_profile.jsx): `pages/manage_assistants/edit_my_profile.jsx`

### Application services

- [Student collection API](https://github.com/cybertony77/pages/blob/main/pages/api/students/index.js): `pages/api/students/index.js`
- [Centers API](https://github.com/cybertony77/pages/blob/main/pages/api/centers/index.js): `pages/api/centers/index.js`
- [Profile API](https://github.com/cybertony77/pages/blob/main/pages/api/auth/me.js): `pages/api/auth/me.js`
- [WhatsApp dispatch](https://github.com/cybertony77/pages/blob/main/pages/api/students/%5Bid%5D/send-whatsapp.js): `pages/api/students/[id]/send-whatsapp.js`

### Other components

- **Assistant**
- **MongoDB**
- **WhatsApp**

## Connections

- Assistant → Assistant login: signs in
- Student collection API → MongoDB: reads and writes (evidence: `pages/api/students/index.js`)
- Centers API → MongoDB: reads and writes (evidence: `pages/api/centers/index.js`)
- Profile API → MongoDB: reads and writes (evidence: `pages/api/auth/me.js`)
- WhatsApp dispatch → MongoDB: reads and updates (evidence: `pages/api/students/[id]/send-whatsapp.js`)
- WhatsApp dispatch → WhatsApp: dispatches message
