# shabhai-md-asadullah-5/eduwatch architecture

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

- Interactive diagram: https://gitdiagram.com/shabhai-md-asadullah-5/eduwatch
- Repository: https://github.com/shabhai-md-asadullah-5/eduwatch

## Overview

EduWatch is a student academic-performance and early-warning application. Faculty and students use the browser interface to access student records, demo risk indicators and interventions; the server exposes API routes backed by MongoDB models. The graph includes the documented dashboard, student-management, search/filter, login and intervention capabilities. Backend calls and route registration are supported by excerpts; browser-to-API wiring and the database connection internals are not shown, so those links are omitted or marked unverified.

Main entry points: [`server.js`](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/server.js) (Express server), [`controllers/authController.js`](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/controllers/authController.js) (Login service), [`routes/studentRoutes.js`](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/routes/studentRoutes.js) (Student routes), [`models/Student.js`](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/models/Student.js) (Student records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Browser experience"]
  node_page["Welcome page<br/>[index.html]"]
  node_dashboard_ui["Dashboard UI<br/>[app.js]"]
  node_auth_ui["Login UI<br/>[auth.js]"]
  node_students_ui["Student views<br/>[students.js]"]
  node_interventions_ui["Intervention views<br/>[interventions.js]"]
  node_ui_helpers["UI helpers<br/>[ui.js]"]
end

subgraph group_api["API and routing"]
  node_server["Express server<br/>[server.js]"]
  node_auth_routes["Auth routes<br/>[authRoutes.js]"]
  node_student_routes["Student routes<br/>[studentRoutes.js]"]
  node_intervention_routes["Intervention routes"]
end

subgraph group_domain["Academic services"]
  node_auth_service["Login service<br/>[authController.js]"]
  node_student_service["Student service"]
  node_intervention_service["Intervention service"]
  node_risk_rules["Risk rules<br/>[riskCalculator.js]"]
end

subgraph group_data["Persistence"]
  node_student_model["Student records<br/>[Student.js]"]
  node_faculty_model["Faculty records<br/>[Faculty.js]"]
  node_intervention_model["Intervention records<br/>[Intervention.js]"]
end

node_faculty(("Faculty"))
node_student_actor(("Student"))
node_mongo[("MongoDB")]

node_server -->|"serves static files"| node_page
node_server -->|"mounts routes"| node_auth_routes
node_server -->|"mounts routes"| node_student_routes
node_server -->|"mounts routes"| node_intervention_routes
node_auth_routes -->|"dispatches to"| node_auth_service
node_student_routes -->|"dispatches to"| node_student_service
node_intervention_routes -->|"dispatches to"| node_intervention_service
node_student_service -->|"reads and writes"| node_student_model
node_student_service -->|"calculates risk"| node_risk_rules
node_intervention_service -->|"checks student"| node_student_model
node_intervention_service -->|"reads and writes"| node_intervention_model
node_auth_service -->|"looks up student"| node_student_model
node_auth_service -->|"looks up faculty"| node_faculty_model
node_auth_service -->|"loads interventions"| node_intervention_model
node_auth_service -->|"gets risk reasons"| node_risk_rules
node_server -.->|"connects through config"| node_mongo
node_student_model -.->|"persists records"| node_mongo
node_faculty_model -.->|"persists records"| node_mongo
node_intervention_model -.->|"persists records"| node_mongo
node_faculty -.->|"uses login"| node_page
node_student_actor -.->|"uses login"| node_page
node_auth_ui -.->|"submits credentials"| node_auth_routes
node_dashboard_ui -.->|"requests dashboard data"| node_student_routes
node_students_ui -.->|"manages students"| node_student_routes
node_interventions_ui -.->|"manages interventions"| node_intervention_routes

click node_page "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/public/index.html"
click node_dashboard_ui "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/public/js/app.js"
click node_auth_ui "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/public/js/auth.js"
click node_students_ui "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/public/js/students.js"
click node_interventions_ui "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/public/js/interventions.js"
click node_ui_helpers "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/public/js/ui.js"
click node_server "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/server.js"
click node_auth_routes "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/routes/authRoutes.js"
click node_student_routes "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/routes/studentRoutes.js"
click node_intervention_routes "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/routes/interventionRoutes.js"
click node_auth_service "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/controllers/authController.js"
click node_student_service "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/controllers/studentController.js"
click node_intervention_service "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/controllers/interventionController.js"
click node_risk_rules "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/utils/riskCalculator.js"
click node_student_model "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/models/Student.js"
click node_faculty_model "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/models/Faculty.js"
click node_intervention_model "https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/models/Intervention.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_page,node_dashboard_ui,node_auth_ui,node_students_ui,node_interventions_ui,node_ui_helpers toneBlue
class node_server,node_auth_routes,node_student_routes,node_intervention_routes,node_mongo toneAmber
class node_auth_service,node_student_service,node_intervention_service,node_risk_rules toneMint
class node_student_model,node_faculty_model,node_intervention_model toneRose
class node_faculty,node_student_actor toneIndigo
```

## Components

### Browser experience

- [Welcome page](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/public/index.html): `public/index.html`
- [Dashboard UI](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/public/js/app.js): `public/js/app.js`
- [Login UI](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/public/js/auth.js): `public/js/auth.js`
- [Student views](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/public/js/students.js): `public/js/students.js`
- [Intervention views](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/public/js/interventions.js): `public/js/interventions.js`
- [UI helpers](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/public/js/ui.js): `public/js/ui.js`

### API and routing

- [Express server](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/server.js): `server.js`
- [Auth routes](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/routes/authRoutes.js): `routes/authRoutes.js`
- [Student routes](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/routes/studentRoutes.js): `routes/studentRoutes.js`
- [Intervention routes](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/routes/interventionRoutes.js): `routes/interventionRoutes.js`

### Academic services

- [Login service](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/controllers/authController.js): `controllers/authController.js`
- [Student service](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/controllers/studentController.js): `controllers/studentController.js`
- [Intervention service](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/controllers/interventionController.js): `controllers/interventionController.js`
- [Risk rules](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/utils/riskCalculator.js): `utils/riskCalculator.js`

### Persistence

- [Student records](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/models/Student.js): `models/Student.js`
- [Faculty records](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/models/Faculty.js): `models/Faculty.js`
- [Intervention records](https://github.com/shabhai-md-asadullah-5/eduwatch/blob/main/models/Intervention.js): `models/Intervention.js`

### Other components

- **Faculty**
- **Student**
- **MongoDB**

## Connections

- Express server → Welcome page: serves static files (evidence: `server.js`)
- Express server → Auth routes: mounts routes (evidence: `server.js`)
- Express server → Student routes: mounts routes (evidence: `server.js`)
- Express server → Intervention routes: mounts routes (evidence: `server.js`)
- Auth routes → Login service: dispatches to (evidence: `routes/authRoutes.js`)
- Student routes → Student service: dispatches to (evidence: `routes/studentRoutes.js`)
- Intervention routes → Intervention service: dispatches to (evidence: `routes/interventionRoutes.js`)
- Student service → Student records: reads and writes (evidence: `controllers/studentController.js`)
- Student service → Risk rules: calculates risk (evidence: `controllers/studentController.js`)
- Intervention service → Student records: checks student (evidence: `controllers/interventionController.js`)
- Intervention service → Intervention records: reads and writes (evidence: `controllers/interventionController.js`)
- Login service → Student records: looks up student (evidence: `controllers/authController.js`)
- Login service → Faculty records: looks up faculty (evidence: `controllers/authController.js`)
- Login service → Intervention records: loads interventions (evidence: `controllers/authController.js`)
- Login service → Risk rules: gets risk reasons (evidence: `controllers/authController.js`)
- Express server → MongoDB: connects through config (evidence: `server.js`)
- Student records → MongoDB: persists records
- Faculty records → MongoDB: persists records
- Intervention records → MongoDB: persists records
- Faculty → Welcome page: uses login
- Student → Welcome page: uses login
- Login UI → Auth routes: submits credentials
- Dashboard UI → Student routes: requests dashboard data
- Student views → Student routes: manages students
- Intervention views → Intervention routes: manages interventions
