# regulanikhitha/rcts-c4gt-team-4 architecture

> Architecture diagram of the GitHub repository regulanikhitha/rcts-c4gt-team-4, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/regulanikhitha/rcts-c4gt-team-4
- Repository: https://github.com/regulanikhitha/rcts-c4gt-team-4

## Overview

C4GT Hub Attendance is a role-based attendance and member-management application, extended with permission requests, notifications, and reporting. A user enters through the React application; sign-in is handled by the auth context and API, then the role-specific dashboard presents operational views. The backend mounts REST modules whose controllers read and update MongoDB-backed records. Sampled attendance code also builds reports and exports PDFs; permission code handles reviews and downloads. Some frontend pages and backend modules are represented from the tree and app mounts only; their internal API wiring was not sampled.

Main entry points: [`frontend/src/App.jsx`](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/App.jsx) (App routing), [`backend/src/app.js`](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/app.js) (Express app), [`backend/src/controllers/attendanceController.js`](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/controllers/attendanceController.js) (Attendance reports), [`backend/src/controllers/authController.js`](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/controllers/authController.js) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["App routing<br/>[App.jsx]"]
  node_authctx["Auth context<br/>[AuthContext.jsx]"]
  node_dashboards["Role dashboards"]
  node_memberui["Member views<br/>[Members.jsx]"]
  node_attendanceui["Attendance views"]
  node_permissionui["Permission views"]
  node_reportui["Reports and calendar<br/>[Reports.jsx]"]
  node_notifyui["Notifications view<br/>[Notifications.jsx]"]
  node_http["HTTP client<br/>[axios.js]"]
end

subgraph group_api["Backend API"]
  node_server["Express app<br/>[app.js]"]
  node_authroutes["Auth routes<br/>[auth.js]"]
  node_memberroutes["Member routes<br/>[members.js]"]
  node_attendroutes["Attendance routes<br/>[attendance.js]"]
  node_permroutes["Permission routes<br/>[permissions.js]"]
  node_notifroutes["Notification routes<br/>[notifications.js]"]
  node_authctrl["Authentication<br/>[authController.js]"]
end

subgraph group_domain["Attendance and members"]
  node_memberctrl["Member operations"]
  node_attendctrl["Attendance reports"]
  node_pdf["Attendance PDF<br/>[pdfGenerator.js]"]
end

subgraph group_services["Permissions and communication"]
  node_permctrl["Permission workflow"]
  node_notifctrl["Notification management"]
  node_mail["Email delivery<br/>[mailer.js]"]
end

subgraph group_data["Persistent data"]
  node_mongo[("MongoDB<br/>[db.js]")]
  node_users[("User records<br/>[User.js]")]
  node_members[("Member records<br/>[Member.js]")]
  node_attendance[("Attendance records<br/>[Attendance.js]")]
  node_audit[("Audit records<br/>[AuditLog.js]")]
  node_permissions[("Permission records<br/>[Permission.js]")]
  node_notifications[("Notification records<br/>[Notification.js]")]
end

node_user(("Hub user"))

node_user -->|"uses"| node_app
node_app -->|"provides auth"| node_authctx
node_app -->|"routes by role"| node_dashboards
node_app -->|"routes to"| node_memberui
node_app -->|"routes to"| node_attendanceui
node_app -->|"routes to"| node_permissionui
node_app -->|"routes to"| node_reportui
node_app -->|"routes to"| node_notifyui
node_authctx -->|"posts login"| node_http
node_http -->|"sends requests"| node_server
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_memberroutes
node_server -->|"mounts"| node_attendroutes
node_server -->|"mounts"| node_permroutes
node_server -->|"mounts"| node_notifroutes
node_authroutes -->|"dispatches"| node_authctrl
node_authctrl -->|"reads and writes"| node_users
node_authctrl -->|"sends email"| node_mail
node_memberctrl -->|"reads and writes"| node_members
node_attendctrl -->|"reads"| node_members
node_attendctrl -->|"reads and writes"| node_attendance
node_attendctrl -->|"writes"| node_audit
node_attendctrl -->|"generates export"| node_pdf
node_permctrl -->|"reads and writes"| node_permissions
node_notifctrl -->|"reads and writes"| node_notifications
node_server -->|"connects"| node_mongo

click node_app "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/App.jsx"
click node_authctx "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/context/AuthContext.jsx"
click node_dashboards "https://github.com/regulanikhitha/rcts-c4gt-team-4/tree/main/frontend/src/pages"
click node_memberui "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/pages/Members.jsx"
click node_attendanceui "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/pages/AttendanceDashboard.jsx"
click node_permissionui "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/pages/PermissionPortal.jsx"
click node_reportui "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/pages/Reports.jsx"
click node_notifyui "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/pages/Notifications.jsx"
click node_http "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/api/axios.js"
click node_server "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/app.js"
click node_authroutes "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/routes/auth.js"
click node_memberroutes "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/routes/members.js"
click node_attendroutes "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/routes/attendance.js"
click node_permroutes "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/routes/permissions.js"
click node_notifroutes "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/routes/notifications.js"
click node_authctrl "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/controllers/authController.js"
click node_memberctrl "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/controllers/memberController.js"
click node_attendctrl "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/controllers/attendanceController.js"
click node_permctrl "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/controllers/permissionController.js"
click node_notifctrl "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/controllers/notificationController.js"
click node_pdf "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/utils/pdfGenerator.js"
click node_mail "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/utils/mailer.js"
click node_mongo "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/config/db.js"
click node_users "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/models/User.js"
click node_members "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/models/Member.js"
click node_attendance "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/models/Attendance.js"
click node_audit "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/models/AuditLog.js"
click node_permissions "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/models/Permission.js"
click node_notifications "https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/models/Notification.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_authctx,node_dashboards,node_memberui,node_attendanceui,node_permissionui,node_reportui,node_notifyui,node_http,node_user toneBlue
class node_server,node_authroutes,node_memberroutes,node_attendroutes,node_permroutes,node_notifroutes,node_authctrl toneAmber
class node_memberctrl,node_attendctrl,node_pdf toneMint
class node_permctrl,node_notifctrl,node_mail toneRose
class node_mongo,node_users,node_members,node_attendance,node_audit,node_permissions,node_notifications toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth context](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Role dashboards](https://github.com/regulanikhitha/rcts-c4gt-team-4/tree/main/frontend/src/pages): `frontend/src/pages`
- [Member views](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/pages/Members.jsx): `frontend/src/pages/Members.jsx`
- [Attendance views](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/pages/AttendanceDashboard.jsx): `frontend/src/pages/AttendanceDashboard.jsx`
- [Permission views](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/pages/PermissionPortal.jsx): `frontend/src/pages/PermissionPortal.jsx`
- [Reports and calendar](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/pages/Reports.jsx): `frontend/src/pages/Reports.jsx`
- [Notifications view](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/pages/Notifications.jsx): `frontend/src/pages/Notifications.jsx`
- [HTTP client](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/frontend/src/api/axios.js): `frontend/src/api/axios.js`

### Backend API

- [Express app](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/app.js): `backend/src/app.js`
- [Auth routes](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/routes/auth.js): `backend/src/routes/auth.js`
- [Member routes](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/routes/members.js): `backend/src/routes/members.js`
- [Attendance routes](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/routes/attendance.js): `backend/src/routes/attendance.js`
- [Permission routes](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/routes/permissions.js): `backend/src/routes/permissions.js`
- [Notification routes](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/routes/notifications.js): `backend/src/routes/notifications.js`
- [Authentication](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`

### Attendance and members

- [Member operations](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/controllers/memberController.js): `backend/src/controllers/memberController.js`
- [Attendance reports](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/controllers/attendanceController.js): `backend/src/controllers/attendanceController.js`
- [Attendance PDF](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/utils/pdfGenerator.js): `backend/src/utils/pdfGenerator.js`

### Permissions and communication

- [Permission workflow](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/controllers/permissionController.js): `backend/src/controllers/permissionController.js`
- [Notification management](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/controllers/notificationController.js): `backend/src/controllers/notificationController.js`
- [Email delivery](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/utils/mailer.js): `backend/src/utils/mailer.js`

### Persistent data

- [MongoDB](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/config/db.js): `backend/src/config/db.js`
- [User records](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Member records](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/models/Member.js): `backend/src/models/Member.js`
- [Attendance records](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/models/Attendance.js): `backend/src/models/Attendance.js`
- [Audit records](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/models/AuditLog.js): `backend/src/models/AuditLog.js`
- [Permission records](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/models/Permission.js): `backend/src/models/Permission.js`
- [Notification records](https://github.com/regulanikhitha/rcts-c4gt-team-4/blob/main/backend/src/models/Notification.js): `backend/src/models/Notification.js`

### Other components

- **Hub user**

## Connections

- Hub user → App routing: uses
- App routing → Auth context: provides auth
- App routing → Role dashboards: routes by role
- App routing → Member views: routes to
- App routing → Attendance views: routes to
- App routing → Permission views: routes to
- App routing → Reports and calendar: routes to
- App routing → Notifications view: routes to
- Auth context → HTTP client: posts login
- HTTP client → Express app: sends requests
- Express app → Auth routes: mounts
- Express app → Member routes: mounts
- Express app → Attendance routes: mounts
- Express app → Permission routes: mounts
- Express app → Notification routes: mounts
- Auth routes → Authentication: dispatches
- Authentication → User records: reads and writes
- Authentication → Email delivery: sends email
- Member operations → Member records: reads and writes
- Attendance reports → Member records: reads
- Attendance reports → Attendance records: reads and writes
- Attendance reports → Audit records: writes
- Attendance reports → Attendance PDF: generates export
- Permission workflow → Permission records: reads and writes
- Notification management → Notification records: reads and writes
- Express app → MongoDB: connects
