# oyerohabib/departmentms architecture

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

- Interactive diagram: https://gitdiagram.com/oyerohabib/departmentms
- Repository: https://github.com/oyerohabib/departmentms

## Overview

The Department Management System supports student, lecturer, and admin workflows for authentication, course management and enrollment, learning-material distribution, and user profiles. The main flow runs from the web dashboard through frontend services and HTTP routes to backend controllers and MongoDB models. The graph includes documented capabilities whose exact UI wiring was not sampled; edges are limited to relationships shown in excerpts, the source index, or README. Material storage beyond the recorded file path is not established.

Main entry points: [`backend/src/app.ts`](https://github.com/oyerohabib/departmentms/blob/main/backend/src/app.ts) (Express API), [`frontend/src/services/course.service.ts`](https://github.com/oyerohabib/departmentms/blob/main/frontend/src/services/course.service.ts) (Course service), [`frontend/src/lib/axios.ts`](https://github.com/oyerohabib/departmentms/blob/main/frontend/src/lib/axios.ts) (HTTP client), [`backend/src/routes/material.routes.ts`](https://github.com/oyerohabib/departmentms/blob/main/backend/src/routes/material.routes.ts) (Material routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_webapp["Web interface"]
  node_coursepages["Course pages"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_courseclient["Course service<br/>[course.service.ts]"]
  node_authclient["Auth service<br/>[auth.service.ts]"]
  node_materialclient["Material service"]
  node_userclient["User service<br/>[user.service.ts]"]
  node_httpclient["HTTP client<br/>[axios.ts]"]
end

subgraph group_api["API and access"]
  node_api["Express API<br/>[app.ts]"]
  node_authroutes["Auth routes<br/>[auth.routes.ts]"]
  node_courseroutes["Course routes<br/>[course.routes.ts]"]
  node_materialroutes["Material routes<br/>[material.routes.ts]"]
  node_userroutes["User routes<br/>[user.routes.ts]"]
  node_authguard["Auth and roles<br/>[auth.middleware.ts]"]
  node_upload["File upload"]
  node_responses["API responses<br/>[responseHandler.ts]"]
end

subgraph group_academic["Academic operations"]
  node_courseops["Course operations"]
  node_materialops["Material operations"]
  node_courses[("Courses<br/>[Course.ts]")]
  node_materials[("Materials<br/>[Material.ts]")]
  node_enrollment[("Enrollment records<br/>[Enrollment.ts]")]
end

subgraph group_identity["Identity and users"]
  node_authops["Authentication<br/>[auth.controller.ts]"]
  node_userops["User operations<br/>[user.controller.ts]"]
  node_users[("User records<br/>[User.ts]")]
  node_tokens["Password and tokens<br/>[auth.ts]"]
end

node_people(("Department users"))

node_people -->|"use"| node_webapp
node_webapp -.->|"request courses"| node_courseclient
node_dashboard -->|"fetch courses"| node_courseclient
node_coursepages -.->|"manage courses"| node_courseclient
node_courseclient -->|"send requests"| node_httpclient
node_authclient -->|"send requests"| node_httpclient
node_materialclient -.->|"send requests"| node_httpclient
node_userclient -.->|"send requests"| node_httpclient
node_courseclient -->|"calls endpoints"| node_courseroutes
node_httpclient -.->|"sends HTTP"| node_api
node_api -->|"mounts routes"| node_authroutes
node_api -->|"mounts routes"| node_userroutes
node_api -->|"mounts routes"| node_courseroutes
node_api -->|"mounts routes"| node_materialroutes
node_authroutes -->|"dispatches"| node_authops
node_courseroutes -->|"dispatches"| node_courseops
node_materialroutes -->|"dispatches"| node_materialops
node_userroutes -->|"dispatches"| node_userops
node_courseroutes -->|"checks access"| node_authguard
node_materialroutes -->|"checks access"| node_authguard
node_materialroutes -->|"processes file"| node_upload
node_courseops -->|"reads and writes"| node_courses
node_materialops -->|"reads and writes"| node_materials
node_materialops -->|"updates materials"| node_courses
node_authops -->|"reads and writes"| node_users
node_userops -->|"manages users"| node_users
node_authops -->|"hashes and signs"| node_tokens
node_authops -->|"formats results"| node_responses
node_courseops -->|"formats results"| node_responses
node_materialops -->|"formats results"| node_responses
node_userops -->|"formats results"| node_responses

click node_webapp "https://github.com/oyerohabib/departmentms/tree/main/frontend/src/app"
click node_coursepages "https://github.com/oyerohabib/departmentms/tree/main/frontend/src/app/dashboard/courses"
click node_dashboard "https://github.com/oyerohabib/departmentms/blob/main/frontend/src/app/dashboard/page.tsx"
click node_courseclient "https://github.com/oyerohabib/departmentms/blob/main/frontend/src/services/course.service.ts"
click node_authclient "https://github.com/oyerohabib/departmentms/blob/main/frontend/src/services/auth.service.ts"
click node_materialclient "https://github.com/oyerohabib/departmentms/blob/main/frontend/src/services/material.service.ts"
click node_userclient "https://github.com/oyerohabib/departmentms/blob/main/frontend/src/services/user.service.ts"
click node_httpclient "https://github.com/oyerohabib/departmentms/blob/main/frontend/src/lib/axios.ts"
click node_api "https://github.com/oyerohabib/departmentms/blob/main/backend/src/app.ts"
click node_authroutes "https://github.com/oyerohabib/departmentms/blob/main/backend/src/routes/auth.routes.ts"
click node_courseroutes "https://github.com/oyerohabib/departmentms/blob/main/backend/src/routes/course.routes.ts"
click node_materialroutes "https://github.com/oyerohabib/departmentms/blob/main/backend/src/routes/material.routes.ts"
click node_userroutes "https://github.com/oyerohabib/departmentms/blob/main/backend/src/routes/user.routes.ts"
click node_authguard "https://github.com/oyerohabib/departmentms/blob/main/backend/src/middlewares/auth.middleware.ts"
click node_upload "https://github.com/oyerohabib/departmentms/blob/main/backend/src/middlewares/uploadMiddleware.ts"
click node_responses "https://github.com/oyerohabib/departmentms/blob/main/backend/src/utils/responseHandler.ts"
click node_courseops "https://github.com/oyerohabib/departmentms/blob/main/backend/src/controllers/course.controller.ts"
click node_materialops "https://github.com/oyerohabib/departmentms/blob/main/backend/src/controllers/material.controller.ts"
click node_courses "https://github.com/oyerohabib/departmentms/blob/main/backend/src/models/Course.ts"
click node_materials "https://github.com/oyerohabib/departmentms/blob/main/backend/src/models/Material.ts"
click node_enrollment "https://github.com/oyerohabib/departmentms/blob/main/backend/src/models/Enrollment.ts"
click node_authops "https://github.com/oyerohabib/departmentms/blob/main/backend/src/controllers/auth.controller.ts"
click node_userops "https://github.com/oyerohabib/departmentms/blob/main/backend/src/controllers/user.controller.ts"
click node_users "https://github.com/oyerohabib/departmentms/blob/main/backend/src/models/User.ts"
click node_tokens "https://github.com/oyerohabib/departmentms/blob/main/backend/src/utils/auth.ts"

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_webapp,node_coursepages,node_dashboard,node_courseclient,node_authclient,node_materialclient,node_userclient,node_httpclient,node_people toneBlue
class node_api,node_authroutes,node_courseroutes,node_materialroutes,node_userroutes,node_authguard,node_upload,node_responses toneAmber
class node_courseops,node_materialops,node_courses,node_materials,node_enrollment toneMint
class node_authops,node_userops,node_users,node_tokens toneRose
```

## Components

### Web application

- [Web interface](https://github.com/oyerohabib/departmentms/tree/main/frontend/src/app): `frontend/src/app`
- [Course pages](https://github.com/oyerohabib/departmentms/tree/main/frontend/src/app/dashboard/courses): `frontend/src/app/dashboard/courses`
- [Dashboard](https://github.com/oyerohabib/departmentms/blob/main/frontend/src/app/dashboard/page.tsx): `frontend/src/app/dashboard/page.tsx`
- [Course service](https://github.com/oyerohabib/departmentms/blob/main/frontend/src/services/course.service.ts): `frontend/src/services/course.service.ts`
- [Auth service](https://github.com/oyerohabib/departmentms/blob/main/frontend/src/services/auth.service.ts): `frontend/src/services/auth.service.ts`
- [Material service](https://github.com/oyerohabib/departmentms/blob/main/frontend/src/services/material.service.ts): `frontend/src/services/material.service.ts`
- [User service](https://github.com/oyerohabib/departmentms/blob/main/frontend/src/services/user.service.ts): `frontend/src/services/user.service.ts`
- [HTTP client](https://github.com/oyerohabib/departmentms/blob/main/frontend/src/lib/axios.ts): `frontend/src/lib/axios.ts`

### API and access

- [Express API](https://github.com/oyerohabib/departmentms/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Auth routes](https://github.com/oyerohabib/departmentms/blob/main/backend/src/routes/auth.routes.ts): `backend/src/routes/auth.routes.ts`
- [Course routes](https://github.com/oyerohabib/departmentms/blob/main/backend/src/routes/course.routes.ts): `backend/src/routes/course.routes.ts`
- [Material routes](https://github.com/oyerohabib/departmentms/blob/main/backend/src/routes/material.routes.ts): `backend/src/routes/material.routes.ts`
- [User routes](https://github.com/oyerohabib/departmentms/blob/main/backend/src/routes/user.routes.ts): `backend/src/routes/user.routes.ts`
- [Auth and roles](https://github.com/oyerohabib/departmentms/blob/main/backend/src/middlewares/auth.middleware.ts): `backend/src/middlewares/auth.middleware.ts`
- [File upload](https://github.com/oyerohabib/departmentms/blob/main/backend/src/middlewares/uploadMiddleware.ts): `backend/src/middlewares/uploadMiddleware.ts`
- [API responses](https://github.com/oyerohabib/departmentms/blob/main/backend/src/utils/responseHandler.ts): `backend/src/utils/responseHandler.ts`

### Academic operations

- [Course operations](https://github.com/oyerohabib/departmentms/blob/main/backend/src/controllers/course.controller.ts): `backend/src/controllers/course.controller.ts`
- [Material operations](https://github.com/oyerohabib/departmentms/blob/main/backend/src/controllers/material.controller.ts): `backend/src/controllers/material.controller.ts`
- [Courses](https://github.com/oyerohabib/departmentms/blob/main/backend/src/models/Course.ts): `backend/src/models/Course.ts`
- [Materials](https://github.com/oyerohabib/departmentms/blob/main/backend/src/models/Material.ts): `backend/src/models/Material.ts`
- [Enrollment records](https://github.com/oyerohabib/departmentms/blob/main/backend/src/models/Enrollment.ts): `backend/src/models/Enrollment.ts`

### Identity and users

- [Authentication](https://github.com/oyerohabib/departmentms/blob/main/backend/src/controllers/auth.controller.ts): `backend/src/controllers/auth.controller.ts`
- [User operations](https://github.com/oyerohabib/departmentms/blob/main/backend/src/controllers/user.controller.ts): `backend/src/controllers/user.controller.ts`
- [User records](https://github.com/oyerohabib/departmentms/blob/main/backend/src/models/User.ts): `backend/src/models/User.ts`
- [Password and tokens](https://github.com/oyerohabib/departmentms/blob/main/backend/src/utils/auth.ts): `backend/src/utils/auth.ts`

### Other components

- **Department users**

## Connections

- Department users → Web interface: use
- Web interface → Course service: request courses (evidence: `frontend/src/app/dashboard/page.tsx`)
- Dashboard → Course service: fetch courses (evidence: `frontend/src/app/dashboard/page.tsx`)
- Course pages → Course service: manage courses
- Course service → HTTP client: send requests (evidence: `frontend/src/services/course.service.ts`)
- Auth service → HTTP client: send requests (evidence: `frontend/src/services/auth.service.ts`)
- Material service → HTTP client: send requests
- User service → HTTP client: send requests
- Course service → Course routes: calls endpoints (evidence: `frontend/src/services/course.service.ts`)
- HTTP client → Express API: sends HTTP
- Express API → Auth routes: mounts routes (evidence: `backend/src/app.ts`)
- Express API → User routes: mounts routes (evidence: `backend/src/app.ts`)
- Express API → Course routes: mounts routes (evidence: `backend/src/app.ts`)
- Express API → Material routes: mounts routes (evidence: `backend/src/app.ts`)
- Auth routes → Authentication: dispatches (evidence: `backend/src/routes/auth.routes.ts`)
- Course routes → Course operations: dispatches (evidence: `backend/src/routes/course.routes.ts`)
- Material routes → Material operations: dispatches (evidence: `backend/src/routes/material.routes.ts`)
- User routes → User operations: dispatches (evidence: `backend/src/routes/user.routes.ts`)
- Course routes → Auth and roles: checks access (evidence: `backend/src/routes/course.routes.ts`)
- Material routes → Auth and roles: checks access (evidence: `backend/src/routes/material.routes.ts`)
- Material routes → File upload: processes file (evidence: `backend/src/routes/material.routes.ts`)
- Course operations → Courses: reads and writes (evidence: `backend/src/controllers/course.controller.ts`)
- Material operations → Materials: reads and writes (evidence: `backend/src/controllers/material.controller.ts`)
- Material operations → Courses: updates materials (evidence: `backend/src/controllers/material.controller.ts`)
- Authentication → User records: reads and writes (evidence: `backend/src/controllers/auth.controller.ts`)
- User operations → User records: manages users (evidence: `backend/src/controllers/user.controller.ts`)
- Authentication → Password and tokens: hashes and signs (evidence: `backend/src/controllers/auth.controller.ts`)
- Authentication → API responses: formats results (evidence: `backend/src/controllers/auth.controller.ts`)
- Course operations → API responses: formats results (evidence: `backend/src/controllers/course.controller.ts`)
- Material operations → API responses: formats results (evidence: `backend/src/controllers/material.controller.ts`)
- User operations → API responses: formats results (evidence: `backend/src/controllers/user.controller.ts`)
