# jellyacez/community-disaster-learning-management-system architecture

> Architecture diagram of the GitHub repository jellyacez/community-disaster-learning-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jellyacez/community-disaster-learning-management-system
- Repository: https://github.com/jellyacez/community-disaster-learning-management-system

## Overview

B ಕಲ? This is a React/Express disaster-preparedness learning and certification platform for Bacolor residents, with scoped administration for barangay, MDRRMO, and system staff. Residents sign in, discover and enroll in progressive hazard modules, complete assessments, synchronize progress, and obtain verifiable certificates. Administrators create and approve learning content, manage users and feedback, and monitor community and platform performance. The map includes authentication, authorization, and persistence as internal layers. Relationships are limited to README statements and source-index references or shown route wiring; unsampled client-to-API details are left unverified.

Main entry points: [`server/routes/modules/moduleRoutes.js`](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/routes/modules/moduleRoutes.js) (Module Routes), [`server/routes/admin/adminMdrrmoRoutes.js`](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/routes/admin/adminMdrrmoRoutes.js) (MDRRMO Routes), [`server/server.js`](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/server.js) (API Application), [`server/config/db.js`](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/config/db.js) (PostgreSQL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Resident Learning"]
  node_app["Web App Routes<br/>[App.jsx]"]
  node_dashboard["Resident Dashboard<br/>[Dashboard.jsx]"]
  node_catalog["Module Catalog<br/>[ModuleCatalog.jsx]"]
  node_viewer["Module Viewer"]
  node_enrollment["Enrollment Hook"]
  node_local_sync["Offline Progress Sync<br/>[syncManager.js]"]
  node_certificates["Certificates<br/>[Certificates.jsx]"]
end

subgraph group_admin["Administration"]
  node_admin_routes["MDRRMO Routes"]
  node_barangay_controller["Barangay Operations"]
  node_admin_feedback["Feedback Management"]
end

subgraph group_backend["Backend Workflows"]
  node_module_routes["Module Routes<br/>[moduleRoutes.js]"]
  node_module_controller["Module Operations"]
  node_module_service["Module Services<br/>[ModuleService.js]"]
  node_progress_controller["Progress Operations"]
  node_progress_service["Progress Service"]
  node_cert_controller["Certificate Operations"]
end

subgraph group_identity["Identity and Security"]
  node_auth["Session Authentication<br/>[auth.js]"]
  node_auth_middleware["Session Guard<br/>[authenticate.js]"]
  node_permissions["Role Permissions<br/>[permissions.js]"]
end

subgraph group_platform["Platform Services"]
  node_database[("PostgreSQL<br/>[db.js]")]
  node_server_entry["API Application<br/>[server.js]"]
  node_sse["Live Notifications<br/>[sseService.js]"]
end

node_resident(("Resident"))
node_admin_actor(("Administrator"))

node_resident -.->|"uses"| node_app
node_admin_actor -.->|"uses"| node_app
node_app -->|"routes to"| node_dashboard
node_resident -.->|"browses"| node_catalog
node_catalog -.->|"enrolls with"| node_enrollment
node_enrollment -.->|"requests API"| node_module_routes
node_module_routes -->|"guards"| node_auth_middleware
node_module_routes -->|"dispatches"| node_module_controller
node_module_routes -->|"dispatches"| node_progress_controller
node_module_controller -->|"calls"| node_module_service
node_module_service -->|"queries"| node_database
node_viewer -.->|"saves progress"| node_local_sync
node_local_sync -.->|"syncs remotely"| node_database
node_progress_controller -->|"calls"| node_progress_service
node_progress_service -.->|"queries"| node_database
node_certificates -.->|"requests certificate"| node_cert_controller
node_cert_controller -->|"reads progress"| node_progress_service
node_admin_actor -.->|"manages modules"| node_admin_routes
node_admin_routes -->|"dispatches"| node_module_controller
node_admin_routes -->|"dispatches"| node_barangay_controller
node_barangay_controller -.->|"via service"| node_database
node_admin_feedback -.->|"manages feedback"| node_admin_routes
node_auth_middleware -->|"checks session"| node_auth
node_auth_middleware -->|"checks roles"| node_permissions
node_server_entry -->|"mounts routes"| node_module_routes
node_server_entry -.->|"mounts routes"| node_admin_routes
node_server_entry -->|"mounts auth"| node_auth
node_server_entry -->|"mounts notifications"| node_sse
node_barangay_controller -->|"publishes updates"| node_sse

click node_app "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/App.jsx"
click node_dashboard "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/pages/user/dashboard/Dashboard.jsx"
click node_catalog "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/pages/user/catalog/ModuleCatalog.jsx"
click node_viewer "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/pages/user/module-viewer/ModuleDetailsPage.jsx"
click node_enrollment "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/hooks/useModuleEnrollment.js"
click node_local_sync "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/lib/LocalSave/syncManager.js"
click node_certificates "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/pages/user/certificates/Certificates.jsx"
click node_module_routes "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/routes/modules/moduleRoutes.js"
click node_module_controller "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/controllers/modules/moduleController.js"
click node_module_service "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/services/modules/ModuleService.js"
click node_progress_controller "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/controllers/modules/moduleProgressController.js"
click node_progress_service "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/services/modules/ModuleProgressService.js"
click node_cert_controller "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/controllers/certificatesController.js"
click node_admin_routes "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/routes/admin/adminMdrrmoRoutes.js"
click node_barangay_controller "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/controllers/admin/barangayController.js"
click node_admin_feedback "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/pages/admin/feedback/AdminFeedbackManager.jsx"
click node_auth "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/utils/auth.js"
click node_auth_middleware "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/middleware/authenticate.js"
click node_permissions "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/config/permissions.js"
click node_database "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/config/db.js"
click node_server_entry "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/server.js"
click node_sse "https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/services/notif/sseService.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_dashboard,node_catalog,node_viewer,node_enrollment,node_local_sync,node_certificates toneBlue
class node_admin_routes,node_barangay_controller,node_admin_feedback toneAmber
class node_module_routes,node_module_controller,node_module_service,node_progress_controller,node_progress_service,node_cert_controller toneMint
class node_auth,node_auth_middleware,node_permissions toneRose
class node_database,node_server_entry,node_sse,node_resident,node_admin_actor toneIndigo
```

## Components

### Resident Learning

- [Web App Routes](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Resident Dashboard](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/pages/user/dashboard/Dashboard.jsx): `client/src/pages/user/dashboard/Dashboard.jsx`
- [Module Catalog](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/pages/user/catalog/ModuleCatalog.jsx): `client/src/pages/user/catalog/ModuleCatalog.jsx`
- [Module Viewer](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/pages/user/module-viewer/ModuleDetailsPage.jsx): `client/src/pages/user/module-viewer/ModuleDetailsPage.jsx`
- [Enrollment Hook](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/hooks/useModuleEnrollment.js): `client/src/hooks/useModuleEnrollment.js`
- [Offline Progress Sync](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/lib/LocalSave/syncManager.js): `client/src/lib/LocalSave/syncManager.js`
- [Certificates](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/pages/user/certificates/Certificates.jsx): `client/src/pages/user/certificates/Certificates.jsx`

### Administration

- [MDRRMO Routes](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/routes/admin/adminMdrrmoRoutes.js): `server/routes/admin/adminMdrrmoRoutes.js`
- [Barangay Operations](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/controllers/admin/barangayController.js): `server/controllers/admin/barangayController.js`
- [Feedback Management](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/client/src/pages/admin/feedback/AdminFeedbackManager.jsx): `client/src/pages/admin/feedback/AdminFeedbackManager.jsx`

### Backend Workflows

- [Module Routes](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/routes/modules/moduleRoutes.js): `server/routes/modules/moduleRoutes.js`
- [Module Operations](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/controllers/modules/moduleController.js): `server/controllers/modules/moduleController.js`
- [Module Services](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/services/modules/ModuleService.js): `server/services/modules/ModuleService.js`
- [Progress Operations](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/controllers/modules/moduleProgressController.js): `server/controllers/modules/moduleProgressController.js`
- [Progress Service](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/services/modules/ModuleProgressService.js): `server/services/modules/ModuleProgressService.js`
- [Certificate Operations](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/controllers/certificatesController.js): `server/controllers/certificatesController.js`

### Identity and Security

- [Session Authentication](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/utils/auth.js): `server/utils/auth.js`
- [Session Guard](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/middleware/authenticate.js): `server/middleware/authenticate.js`
- [Role Permissions](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/config/permissions.js): `server/config/permissions.js`

### Platform Services

- [PostgreSQL](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/config/db.js): `server/config/db.js`
- [API Application](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/server.js): `server/server.js`
- [Live Notifications](https://github.com/jellyacez/community-disaster-learning-management-system/blob/main/server/services/notif/sseService.js): `server/services/notif/sseService.js`

### Other components

- **Resident**
- **Administrator**

## Connections

- Resident → Web App Routes: uses
- Administrator → Web App Routes: uses
- Web App Routes → Resident Dashboard: routes to (evidence: `client/src/App.jsx`)
- Resident → Module Catalog: browses
- Module Catalog → Enrollment Hook: enrolls with
- Enrollment Hook → Module Routes: requests API
- Module Routes → Session Guard: guards (evidence: `server/routes/modules/moduleRoutes.js`)
- Module Routes → Module Operations: dispatches (evidence: `server/routes/modules/moduleRoutes.js`)
- Module Routes → Progress Operations: dispatches (evidence: `server/routes/modules/moduleRoutes.js`)
- Module Operations → Module Services: calls (evidence: `server/controllers/modules/moduleController.js`)
- Module Services → PostgreSQL: queries (evidence: `server/services/modules/ModuleService.js`)
- Module Viewer → Offline Progress Sync: saves progress
- Offline Progress Sync → PostgreSQL: syncs remotely
- Progress Operations → Progress Service: calls (evidence: `server/controllers/modules/moduleProgressController.js`)
- Progress Service → PostgreSQL: queries
- Certificates → Certificate Operations: requests certificate
- Certificate Operations → Progress Service: reads progress (evidence: `server/controllers/certificatesController.js`)
- Administrator → MDRRMO Routes: manages modules
- MDRRMO Routes → Module Operations: dispatches (evidence: `server/routes/admin/adminMdrrmoRoutes.js`)
- MDRRMO Routes → Barangay Operations: dispatches (evidence: `server/routes/admin/adminMdrrmoRoutes.js`)
- Barangay Operations → PostgreSQL: via service
- Feedback Management → MDRRMO Routes: manages feedback
- Session Guard → Session Authentication: checks session (evidence: `server/middleware/authenticate.js`)
- Session Guard → Role Permissions: checks roles (evidence: `server/middleware/authenticate.js`)
- API Application → Module Routes: mounts routes (evidence: `server/server.js`)
- API Application → MDRRMO Routes: mounts routes
- API Application → Session Authentication: mounts auth (evidence: `server/server.js`)
- API Application → Live Notifications: mounts notifications (evidence: `server/server.js`)
- Barangay Operations → Live Notifications: publishes updates (evidence: `server/controllers/admin/barangayController.js`)
