# vtn-911/doan_cdio3 architecture

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

- Interactive diagram: https://gitdiagram.com/vtn-911/doan_cdio3
- Repository: https://github.com/vtn-911/doan_cdio3

## Overview

This is a kindergarten management portal: staff and parents use a role-aware web app to manage or view children, classes, schedules, health, and school operations. The backend exposes REST routes whose controllers delegate to domain services and Prisma. The tree lists additional finance, notification, reporting, and camera-monitoring screens, but the README is empty and those implementations were not sampled; they are represented as frontend capabilities without inferred backend wiring.

Main entry points: [`Backend/src/controllers`](https://github.com/vtn-911/doan_cdio3/tree/main/Backend/src/controllers) (Request controllers), [`Frontend/fe-mamnon/src/pages/Dashboard.jsx`](https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/pages/Dashboard.jsx) (Role dashboard), [`Frontend/fe-mamnon/src/App.jsx`](https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/App.jsx) (App shell), [`Backend/src/server.js`](https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/server.js) (Express server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web portal"]
  node_app["App shell<br/>[App.jsx]"]
  node_auth["Login and auth<br/>[AuthContext.jsx]"]
  node_dashboard["Role dashboard<br/>[Dashboard.jsx]"]
  node_child_views["Child views<br/>[ChildProfile.jsx]"]
  node_admin_views["Management screens"]
  node_operations_views["School operations"]
  node_api_client["API client<br/>[api.js]"]
  node_school_screens["Health, finance, alerts, reports, camera"]
end

subgraph group_api["API runtime"]
  node_server["Express server<br/>[server.js]"]
  node_routes["REST routes"]
  node_controllers["Request controllers"]
  node_services["Domain services"]
  node_prisma["Prisma client<br/>[prisma.js]"]
  node_database[("Application database")]
end

subgraph group_people["People and classes"]
  node_users["Users and roles<br/>[user.service.js]"]
  node_students["Student records<br/>[student.service.js]"]
  node_parents["Parent and child access<br/>[parent.service.js]"]
  node_teachers["Teacher management<br/>[teacher.service.js]"]
  node_classes["Class management<br/>[class.service.js]"]
end

subgraph group_school["School operations"]
  node_schedule["Schedules"]
  node_health["Health records<br/>[health.service.js]"]
end

node_user(("Staff or parent"))

node_user -->|"uses"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"shows when signed in"| node_dashboard
node_dashboard -->|"presents"| node_child_views
node_dashboard -->|"presents"| node_admin_views
node_dashboard -->|"presents"| node_operations_views
node_dashboard -->|"offers"| node_school_screens
node_api_client -->|"HTTP requests"| node_server
node_server -->|"mounts"| node_routes
node_routes -->|"dispatches"| node_controllers
node_controllers -->|"calls"| node_services
node_services -->|"queries through"| node_prisma
node_prisma -->|"reads and writes"| node_database
node_controllers -->|"delegates user actions"| node_users
node_controllers -->|"delegates student actions"| node_students
node_controllers -->|"delegates parent actions"| node_parents
node_controllers -->|"delegates teacher actions"| node_teachers
node_controllers -->|"delegates class actions"| node_classes
node_controllers -->|"delegates schedule actions"| node_schedule
node_controllers -->|"delegates health actions"| node_health

click node_app "https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/App.jsx"
click node_auth "https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/context/AuthContext.jsx"
click node_dashboard "https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/pages/Dashboard.jsx"
click node_child_views "https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/pages/ChildProfile.jsx"
click node_admin_views "https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/pages/StudentManagement.jsx"
click node_operations_views "https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/pages/GeneralSchedule.jsx"
click node_api_client "https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/services/api.js"
click node_server "https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/server.js"
click node_routes "https://github.com/vtn-911/doan_cdio3/tree/main/Backend/src/routes"
click node_controllers "https://github.com/vtn-911/doan_cdio3/tree/main/Backend/src/controllers"
click node_services "https://github.com/vtn-911/doan_cdio3/tree/main/Backend/src/services"
click node_prisma "https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/config/prisma.js"
click node_users "https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/user.service.js"
click node_students "https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/student.service.js"
click node_parents "https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/parent.service.js"
click node_teachers "https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/teacher.service.js"
click node_classes "https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/class.service.js"
click node_schedule "https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/schedule.service.js"
click node_health "https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/health.service.js"
click node_school_screens "https://github.com/vtn-911/doan_cdio3/tree/main/Frontend/fe-mamnon/src/pages"

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_auth,node_dashboard,node_child_views,node_admin_views,node_operations_views,node_api_client,node_school_screens toneBlue
class node_server,node_routes,node_controllers,node_services,node_prisma,node_database toneAmber
class node_users,node_students,node_parents,node_teachers,node_classes toneMint
class node_schedule,node_health toneRose
class node_user toneIndigo
```

## Components

### Web portal

- [App shell](https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/App.jsx): `Frontend/fe-mamnon/src/App.jsx`
- [Login and auth](https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/context/AuthContext.jsx): `Frontend/fe-mamnon/src/context/AuthContext.jsx`
- [Role dashboard](https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/pages/Dashboard.jsx): `Frontend/fe-mamnon/src/pages/Dashboard.jsx`
- [Child views](https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/pages/ChildProfile.jsx): `Frontend/fe-mamnon/src/pages/ChildProfile.jsx`
- [Management screens](https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/pages/StudentManagement.jsx): `Frontend/fe-mamnon/src/pages/StudentManagement.jsx`
- [School operations](https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/pages/GeneralSchedule.jsx): `Frontend/fe-mamnon/src/pages/GeneralSchedule.jsx`
- [API client](https://github.com/vtn-911/doan_cdio3/blob/main/Frontend/fe-mamnon/src/services/api.js): `Frontend/fe-mamnon/src/services/api.js`
- [Health, finance, alerts, reports, camera](https://github.com/vtn-911/doan_cdio3/tree/main/Frontend/fe-mamnon/src/pages): `Frontend/fe-mamnon/src/pages`

### API runtime

- [Express server](https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/server.js): `Backend/src/server.js`
- [REST routes](https://github.com/vtn-911/doan_cdio3/tree/main/Backend/src/routes): `Backend/src/routes`
- [Request controllers](https://github.com/vtn-911/doan_cdio3/tree/main/Backend/src/controllers): `Backend/src/controllers`
- [Domain services](https://github.com/vtn-911/doan_cdio3/tree/main/Backend/src/services): `Backend/src/services`
- [Prisma client](https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/config/prisma.js): `Backend/src/config/prisma.js`
- **Application database**

### People and classes

- [Users and roles](https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/user.service.js): `Backend/src/services/user.service.js`
- [Student records](https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/student.service.js): `Backend/src/services/student.service.js`
- [Parent and child access](https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/parent.service.js): `Backend/src/services/parent.service.js`
- [Teacher management](https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/teacher.service.js): `Backend/src/services/teacher.service.js`
- [Class management](https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/class.service.js): `Backend/src/services/class.service.js`

### School operations

- [Schedules](https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/schedule.service.js): `Backend/src/services/schedule.service.js`
- [Health records](https://github.com/vtn-911/doan_cdio3/blob/main/Backend/src/services/health.service.js): `Backend/src/services/health.service.js`

### Other components

- **Staff or parent**

## Connections

- Staff or parent → App shell: uses
- App shell → Login and auth: provides auth
- App shell → Role dashboard: shows when signed in
- Role dashboard → Child views: presents
- Role dashboard → Management screens: presents
- Role dashboard → School operations: presents
- Role dashboard → Health, finance, alerts, reports, camera: offers
- API client → Express server: HTTP requests
- Express server → REST routes: mounts
- REST routes → Request controllers: dispatches
- Request controllers → Domain services: calls
- Domain services → Prisma client: queries through
- Prisma client → Application database: reads and writes
- Request controllers → Users and roles: delegates user actions
- Request controllers → Student records: delegates student actions
- Request controllers → Parent and child access: delegates parent actions
- Request controllers → Teacher management: delegates teacher actions
- Request controllers → Class management: delegates class actions
- Request controllers → Schedules: delegates schedule actions
- Request controllers → Health records: delegates health actions
