# kram823542/myccms architecture

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

- Interactive diagram: https://gitdiagram.com/kram823542/myccms
- Repository: https://github.com/kram823542/myccms

## Overview

This is a role-based CLF and workforce management application: users enter through a role-specific web interface, perform operational tasks such as employee, attendance, leave, work, and resource management, and access reports or administrative controls. The frontend is a React application and the backend exposes a Node API backed by MongoDB. The graph preserves documented route and import relationships; the README is empty, and unsampled feature-to-endpoint wiring is shown only as unverified dashed integration.

Main entry points: [`frontend/src/app/router.jsx`](https://github.com/kram823542/myccms/blob/main/frontend/src/app/router.jsx) (Role router), [`frontend/src/services/apiClient.js`](https://github.com/kram823542/myccms/blob/main/frontend/src/services/apiClient.js) (HTTP client), [`BACKEND/src/modules/auth/auth.service.js`](https://github.com/kram823542/myccms/blob/main/BACKEND/src/modules/auth/auth.service.js) (Identity service), [`BACKEND/src/routes/index.js`](https://github.com/kram823542/myccms/blob/main/BACKEND/src/routes/index.js) (API routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Web entry<br/>[App.jsx]"]
  node_router["Role router<br/>[router.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_dashboards["Role dashboards"]
  node_reports_ui["Reports and profile<br/>[ReportsPage.jsx]"]
  node_system_ui["System controls"]
  node_api_client["HTTP client<br/>[apiClient.js]"]
  node_auth_storage["Session storage<br/>[authStorage.js]"]
end

subgraph group_workforce["Workforce operations"]
  node_workforce_ui["Workforce pages"]
  node_employees[("Employee records<br/>[employee.model.js]")]
  node_work_services["Work and plans"]
  node_leave_controller["Leave workflow"]
  node_attendance[("Attendance records")]
end

subgraph group_program["Program operations"]
  node_program_ui["Program pages"]
  node_clf_resources["CLF resources"]
  node_advice["Advice and topsheets"]
end

subgraph group_platform["API and platform"]
  node_server["API application<br/>[app.js]"]
  node_api_routes["API routes<br/>[index.js]"]
  node_auth_service["Identity service<br/>[auth.service.js]"]
  node_users[("User records<br/>[user.model.js]")]
  node_reporting["Reports and audit"]
  node_system["System administration"]
  node_database[("MongoDB connection<br/>[database.js]")]
end

node_user(("Staff and admins"))

node_user -->|"opens"| node_app
node_app -->|"renders"| node_router
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_dashboards
node_router -->|"routes to"| node_workforce_ui
node_router -->|"routes to"| node_program_ui
node_router -->|"routes to"| node_reports_ui
node_router -->|"routes to"| node_system_ui
node_dashboards -->|"uses APIs"| node_workforce_ui
node_login -.->|"requests through"| node_api_client
node_workforce_ui -.->|"requests through"| node_api_client
node_program_ui -.->|"requests through"| node_api_client
node_reports_ui -.->|"requests through"| node_api_client
node_system_ui -->|"requests through"| node_api_client
node_api_client -->|"reads tokens"| node_auth_storage
node_api_client -.->|"calls API"| node_api_routes
node_server -->|"mounts routes"| node_api_routes
node_api_routes -.->|"dispatches"| node_auth_service
node_auth_service -->|"reads and updates"| node_users
node_auth_service -->|"resolves employee"| node_employees
node_auth_service -->|"checks state"| node_system
node_auth_service -.->|"records audit"| node_reporting
node_leave_controller -->|"looks up"| node_employees
node_leave_controller -->|"updates attendance"| node_attendance
node_leave_controller -.->|"uses CLF records"| node_clf_resources
node_clf_resources -.->|"generates advice"| node_advice
node_work_services -.->|"serves via API"| node_api_routes
node_server -.->|"connects"| node_database

click node_app "https://github.com/kram823542/myccms/blob/main/frontend/src/App.jsx"
click node_router "https://github.com/kram823542/myccms/blob/main/frontend/src/app/router.jsx"
click node_login "https://github.com/kram823542/myccms/blob/main/frontend/src/features/auth/Login.jsx"
click node_dashboards "https://github.com/kram823542/myccms/tree/main/frontend/src/dashboards"
click node_workforce_ui "https://github.com/kram823542/myccms/tree/main/frontend/src/features"
click node_program_ui "https://github.com/kram823542/myccms/tree/main/frontend/src/features"
click node_reports_ui "https://github.com/kram823542/myccms/blob/main/frontend/src/features/reports/ReportsPage.jsx"
click node_system_ui "https://github.com/kram823542/myccms/tree/main/frontend/src/features/system"
click node_api_client "https://github.com/kram823542/myccms/blob/main/frontend/src/services/apiClient.js"
click node_auth_storage "https://github.com/kram823542/myccms/blob/main/frontend/src/utils/authStorage.js"
click node_server "https://github.com/kram823542/myccms/blob/main/BACKEND/src/app.js"
click node_api_routes "https://github.com/kram823542/myccms/blob/main/BACKEND/src/routes/index.js"
click node_auth_service "https://github.com/kram823542/myccms/blob/main/BACKEND/src/modules/auth/auth.service.js"
click node_users "https://github.com/kram823542/myccms/blob/main/BACKEND/src/modules/users/user.model.js"
click node_employees "https://github.com/kram823542/myccms/blob/main/BACKEND/src/modules/employees/employee.model.js"
click node_work_services "https://github.com/kram823542/myccms/tree/main/BACKEND/src/modules/workDone"
click node_leave_controller "https://github.com/kram823542/myccms/blob/main/BACKEND/src/modules/leaves/leave.controller.js"
click node_attendance "https://github.com/kram823542/myccms/tree/main/BACKEND/src/modules/attendance"
click node_clf_resources "https://github.com/kram823542/myccms/tree/main/BACKEND/src/modules/clfResources"
click node_advice "https://github.com/kram823542/myccms/blob/main/BACKEND/src/modules/advice/advice.controller.js"
click node_reporting "https://github.com/kram823542/myccms/tree/main/BACKEND/src/modules/reports"
click node_system "https://github.com/kram823542/myccms/tree/main/BACKEND/src/modules/system"
click node_database "https://github.com/kram823542/myccms/blob/main/BACKEND/src/config/database.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_app,node_router,node_login,node_dashboards,node_reports_ui,node_system_ui,node_api_client,node_auth_storage toneBlue
class node_workforce_ui,node_employees,node_work_services,node_leave_controller,node_attendance toneAmber
class node_program_ui,node_clf_resources,node_advice toneMint
class node_server,node_api_routes,node_auth_service,node_users,node_reporting,node_system,node_database toneRose
class node_user toneIndigo
```

## Components

### Web application

- [Web entry](https://github.com/kram823542/myccms/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Role router](https://github.com/kram823542/myccms/blob/main/frontend/src/app/router.jsx): `frontend/src/app/router.jsx`
- [Login](https://github.com/kram823542/myccms/blob/main/frontend/src/features/auth/Login.jsx): `frontend/src/features/auth/Login.jsx`
- [Role dashboards](https://github.com/kram823542/myccms/tree/main/frontend/src/dashboards): `frontend/src/dashboards`
- [Reports and profile](https://github.com/kram823542/myccms/blob/main/frontend/src/features/reports/ReportsPage.jsx): `frontend/src/features/reports/ReportsPage.jsx`
- [System controls](https://github.com/kram823542/myccms/tree/main/frontend/src/features/system): `frontend/src/features/system`
- [HTTP client](https://github.com/kram823542/myccms/blob/main/frontend/src/services/apiClient.js): `frontend/src/services/apiClient.js`
- [Session storage](https://github.com/kram823542/myccms/blob/main/frontend/src/utils/authStorage.js): `frontend/src/utils/authStorage.js`

### Workforce operations

- [Workforce pages](https://github.com/kram823542/myccms/tree/main/frontend/src/features): `frontend/src/features`
- [Employee records](https://github.com/kram823542/myccms/blob/main/BACKEND/src/modules/employees/employee.model.js): `BACKEND/src/modules/employees/employee.model.js`
- [Work and plans](https://github.com/kram823542/myccms/tree/main/BACKEND/src/modules/workDone): `BACKEND/src/modules/workDone`
- [Leave workflow](https://github.com/kram823542/myccms/blob/main/BACKEND/src/modules/leaves/leave.controller.js): `BACKEND/src/modules/leaves/leave.controller.js`
- [Attendance records](https://github.com/kram823542/myccms/tree/main/BACKEND/src/modules/attendance): `BACKEND/src/modules/attendance`

### Program operations

- [Program pages](https://github.com/kram823542/myccms/tree/main/frontend/src/features): `frontend/src/features`
- [CLF resources](https://github.com/kram823542/myccms/tree/main/BACKEND/src/modules/clfResources): `BACKEND/src/modules/clfResources`
- [Advice and topsheets](https://github.com/kram823542/myccms/blob/main/BACKEND/src/modules/advice/advice.controller.js): `BACKEND/src/modules/advice/advice.controller.js`

### API and platform

- [API application](https://github.com/kram823542/myccms/blob/main/BACKEND/src/app.js): `BACKEND/src/app.js`
- [API routes](https://github.com/kram823542/myccms/blob/main/BACKEND/src/routes/index.js): `BACKEND/src/routes/index.js`
- [Identity service](https://github.com/kram823542/myccms/blob/main/BACKEND/src/modules/auth/auth.service.js): `BACKEND/src/modules/auth/auth.service.js`
- [User records](https://github.com/kram823542/myccms/blob/main/BACKEND/src/modules/users/user.model.js): `BACKEND/src/modules/users/user.model.js`
- [Reports and audit](https://github.com/kram823542/myccms/tree/main/BACKEND/src/modules/reports): `BACKEND/src/modules/reports`
- [System administration](https://github.com/kram823542/myccms/tree/main/BACKEND/src/modules/system): `BACKEND/src/modules/system`
- [MongoDB connection](https://github.com/kram823542/myccms/blob/main/BACKEND/src/config/database.js): `BACKEND/src/config/database.js`

### Other components

- **Staff and admins**

## Connections

- Staff and admins → Web entry: opens
- Web entry → Role router: renders (evidence: `frontend/src/App.jsx`)
- Role router → Login: routes to (evidence: `frontend/src/app/router.jsx`)
- Role router → Role dashboards: routes to (evidence: `frontend/src/app/router.jsx`)
- Role router → Workforce pages: routes to (evidence: `frontend/src/app/router.jsx`)
- Role router → Program pages: routes to (evidence: `frontend/src/app/router.jsx`)
- Role router → Reports and profile: routes to (evidence: `frontend/src/app/router.jsx`)
- Role router → System controls: routes to (evidence: `frontend/src/app/router.jsx`)
- Role dashboards → Workforce pages: uses APIs (evidence: `frontend/src/dashboards/EmployeeDashboard.jsx`)
- Login → HTTP client: requests through
- Workforce pages → HTTP client: requests through
- Program pages → HTTP client: requests through
- Reports and profile → HTTP client: requests through
- System controls → HTTP client: requests through (evidence: `frontend/src/features/system/DatabaseBrowser.jsx`)
- HTTP client → Session storage: reads tokens (evidence: `frontend/src/services/apiClient.js`)
- HTTP client → API routes: calls API
- API application → API routes: mounts routes (evidence: `BACKEND/src/app.js`)
- API routes → Identity service: dispatches
- Identity service → User records: reads and updates (evidence: `BACKEND/src/modules/auth/auth.service.js`)
- Identity service → Employee records: resolves employee (evidence: `BACKEND/src/modules/auth/auth.service.js`)
- Identity service → System administration: checks state (evidence: `BACKEND/src/modules/auth/auth.service.js`)
- Identity service → Reports and audit: records audit
- Leave workflow → Employee records: looks up (evidence: `BACKEND/src/modules/leaves/leave.controller.js`)
- Leave workflow → Attendance records: updates attendance (evidence: `BACKEND/src/modules/leaves/leave.controller.js`)
- Leave workflow → CLF resources: uses CLF records
- CLF resources → Advice and topsheets: generates advice
- Work and plans → API routes: serves via API
- API application → MongoDB connection: connects
