# coutkirathecoderendl/ced-pre-enrollment architecture

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

- Interactive diagram: https://gitdiagram.com/coutkirathecoderendl/ced-pre-enrollment
- Repository: https://github.com/coutkirathecoderendl/ced-pre-enrollment

## Overview

CED Pre-Enrollment is a web application for student enrollment, advising, teacher grading, and administrative management, with student records optionally synchronized from an IT department database. The main workflow is login and token-based access, followed by student enrollment actions and teacher advising review; admins manage records, sections, notices, and enrollment clearance. The source excerpts show route-to-database calls and server route registration. Dashboard files are present, but their behavior is not shown, so their runtime links are omitted.

Main entry points: [`server.js`](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/server.js) (Express server), [`config/db.js`](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/config/db.js) (CED MySQL database), [`routes/itSync.js`](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/routes/itSync.js) (IT student sync), [`middleware/auth.js`](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/middleware/auth.js) (Token and role checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_server["Express server<br/>[server.js]"]
  node_login_page["Login page<br/>[login.html]"]
  node_student_page["Student dashboard<br/>[dashboard.html]"]
  node_teacher_page["Teacher dashboard<br/>[dashboard.html]"]
  node_admin_page["Admin dashboard<br/>[dashboard.html]"]
  node_bfo_page["BFO dashboard<br/>[dashboard.html]"]
end

subgraph group_identity["Identity and access"]
  node_login_api["Login API<br/>[auth.js]"]
  node_access_control["Token and role checks<br/>[auth.js]"]
end

subgraph group_student["Student enrollment"]
  node_student_api["Student enrollment API<br/>[students.js]"]
end

subgraph group_staff["Staff operations"]
  node_teacher_api["Teacher advising and grades<br/>[teachers.js]"]
  node_admin_api["Administration API<br/>[admin.js]"]
  node_it_sync["IT student sync<br/>[itSync.js]"]
end

subgraph group_data["Data sources"]
  node_ced_db[("CED MySQL database<br/>[db.js]")]
  node_it_db[("IT department database<br/>[itDb.js]")]
end

node_student_actor(("Student"))
node_teacher_actor(("Teacher"))
node_admin_actor(("Administrator"))

node_server -->|"mounts auth"| node_login_api
node_server -->|"mounts routes"| node_student_api
node_server -->|"mounts routes"| node_teacher_api
node_server -->|"mounts routes"| node_admin_api
node_server -->|"mounts routes"| node_it_sync
node_server -->|"serves at root"| node_login_page
node_login_api -->|"queries users"| node_ced_db
node_student_api -->|"reads and writes"| node_ced_db
node_teacher_api -->|"reads and writes"| node_ced_db
node_admin_api -->|"reads and writes"| node_ced_db
node_it_sync -->|"reads student view"| node_it_db
node_it_sync -->|"checks and imports"| node_ced_db
node_student_api -->|"uses guards"| node_access_control
node_teacher_api -->|"uses guards"| node_access_control
node_admin_api -->|"uses guards"| node_access_control
node_it_sync -->|"uses guards"| node_access_control

click node_server "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/server.js"
click node_login_page "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/public/login.html"
click node_student_page "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/public/student/dashboard.html"
click node_teacher_page "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/public/teacher/dashboard.html"
click node_admin_page "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/public/admin/dashboard.html"
click node_bfo_page "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/public/bfo/dashboard.html"
click node_login_api "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/routes/auth.js"
click node_access_control "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/middleware/auth.js"
click node_student_api "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/routes/students.js"
click node_teacher_api "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/routes/teachers.js"
click node_admin_api "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/routes/admin.js"
click node_it_sync "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/routes/itSync.js"
click node_ced_db "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/config/db.js"
click node_it_db "https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/config/itDb.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_server,node_login_page,node_student_page,node_teacher_page,node_admin_page,node_bfo_page toneBlue
class node_login_api,node_access_control toneAmber
class node_student_api toneMint
class node_teacher_api,node_admin_api,node_it_sync toneRose
class node_ced_db,node_it_db,node_student_actor,node_teacher_actor,node_admin_actor toneIndigo
```

## Components

### Web entry

- [Express server](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/server.js): `server.js`
- [Login page](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/public/login.html): `public/login.html`
- [Student dashboard](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/public/student/dashboard.html): `public/student/dashboard.html`
- [Teacher dashboard](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/public/teacher/dashboard.html): `public/teacher/dashboard.html`
- [Admin dashboard](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/public/admin/dashboard.html): `public/admin/dashboard.html`
- [BFO dashboard](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/public/bfo/dashboard.html): `public/bfo/dashboard.html`

### Identity and access

- [Login API](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/routes/auth.js): `routes/auth.js`
- [Token and role checks](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/middleware/auth.js): `middleware/auth.js`

### Student enrollment

- [Student enrollment API](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/routes/students.js): `routes/students.js`

### Staff operations

- [Teacher advising and grades](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/routes/teachers.js): `routes/teachers.js`
- [Administration API](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/routes/admin.js): `routes/admin.js`
- [IT student sync](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/routes/itSync.js): `routes/itSync.js`

### Data sources

- [CED MySQL database](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/config/db.js): `config/db.js`
- [IT department database](https://github.com/coutkirathecoderendl/ced-pre-enrollment/blob/main/config/itDb.js): `config/itDb.js`

### Other components

- **Student**
- **Teacher**
- **Administrator**

## Connections

- Express server → Login API: mounts auth (evidence: `server.js`)
- Express server → Student enrollment API: mounts routes (evidence: `server.js`)
- Express server → Teacher advising and grades: mounts routes (evidence: `server.js`)
- Express server → Administration API: mounts routes (evidence: `server.js`)
- Express server → IT student sync: mounts routes (evidence: `server.js`)
- Express server → Login page: serves at root (evidence: `server.js`)
- Login API → CED MySQL database: queries users (evidence: `routes/auth.js`)
- Student enrollment API → CED MySQL database: reads and writes (evidence: `routes/students.js`)
- Teacher advising and grades → CED MySQL database: reads and writes (evidence: `routes/teachers.js`)
- Administration API → CED MySQL database: reads and writes (evidence: `routes/admin.js`)
- IT student sync → IT department database: reads student view (evidence: `routes/itSync.js`)
- IT student sync → CED MySQL database: checks and imports (evidence: `routes/itSync.js`)
- Student enrollment API → Token and role checks: uses guards (evidence: `routes/students.js`)
- Teacher advising and grades → Token and role checks: uses guards (evidence: `routes/teachers.js`)
- Administration API → Token and role checks: uses guards (evidence: `routes/admin.js`)
- IT student sync → Token and role checks: uses guards (evidence: `routes/itSync.js`)
