# arivazhagan7b/groupmanagementportal architecture

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

- Interactive diagram: https://gitdiagram.com/arivazhagan7b/groupmanagementportal
- Repository: https://github.com/arivazhagan7b/groupmanagementportal

## Overview

Group Management Portal is a full-stack student-operations product. Users enter through cookie-based authentication, then use role-specific admin or student screens; those screens call the Express API, whose domain services manage group, membership, eligibility, phase, event, team, hub, and request workflows backed by MySQL. Audit records and Socket.IO updates support operations across those workflows. The graph preserves documented product areas, but several are represented at their exact module-directory level because their implementation excerpts were not supplied; those links are documented or marked unverified rather than inferred from names.

Main entry points: [`server/app.js`](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/app.js) (Express API), [`server/modules/membership/membership.service.js`](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/membership/membership.service.js) (Groups and memberships), [`client/src/App.jsx`](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/client/src/App.jsx) (Role-based app), [`server/modules/eligibility/eligibility.service.js`](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/eligibility/eligibility.service.js) (Eligibility scoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Role-based app<br/>[App.jsx]"]
  node_authctx["Session context<br/>[AuthContext.jsx]"]
  node_admin["Admin workspace<br/>[adminRoutes.jsx]"]
  node_student["Student workspace<br/>[studentRoutes.jsx]"]
  node_supportui["Support center<br/>[SupportPage.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_server["Express API<br/>[app.js]"]
  node_authroutes["Auth routes<br/>[auth.routes.js]"]
  node_authctrl["Login and session<br/>[auth.controller.js]"]
  node_authmw["Cookie authentication<br/>[auth.middleware.js]"]
  node_jwt["JWT utilities<br/>[jwt.js]"]
end

subgraph group_operations["Group operations"]
  node_group["Groups and memberships"]
  node_join["Join requests"]
  node_teamhub["Teams and hubs"]
  node_event["Events and groups"]
  node_supportapi["Support API"]
end

subgraph group_activities["Activities and policy"]
  node_eligibility["Eligibility scoring"]
  node_phase["Phase lifecycle<br/>[phase.service.js]"]
  node_policy["System policy"]
  node_points["Activity points"]
  node_audit["Audit logging<br/>[audit.service.js]"]
end

subgraph group_platform["Persistence and updates"]
  node_db[("MySQL pool<br/>[db.js]")]
  node_realtime["Realtime events<br/>[events.js]"]
  node_config["Runtime configuration<br/>[runtime.js]"]
  node_socket["Socket.IO server<br/>[socket.js]"]
end

node_user(("Portal user"))

node_user -->|"opens portal"| node_app
node_app -->|"checks session"| node_authctx
node_app -->|"routes admins"| node_admin
node_app -->|"routes students"| node_student
node_student -->|"routes to"| node_supportui
node_authctx -.->|"calls API"| node_server
node_admin -.->|"calls API"| node_server
node_student -.->|"calls API"| node_server
node_supportui -->|"uses support API"| node_supportapi
node_server -->|"mounts routes"| node_authroutes
node_authroutes -->|"dispatches"| node_authctrl
node_authroutes -->|"protects routes"| node_authmw
node_authmw -->|"validates session"| node_jwt
node_authmw -->|"reads secret"| node_config
node_server -->|"mounts domain routes"| node_group
node_server -->|"mounts domain routes"| node_join
node_server -->|"mounts domain routes"| node_eligibility
node_group -->|"uses request service"| node_join
node_join -->|"uses membership service"| node_group
node_group -->|"reads phase data"| node_phase
node_group -->|"reads policy"| node_policy
node_group -->|"writes activity points"| node_points
node_eligibility -->|"reads membership"| node_group
node_eligibility -->|"writes activity points"| node_points
node_server -->|"mounts domain routes"| node_teamhub
node_server -->|"mounts domain routes"| node_event
node_server -->|"mounts support routes"| node_supportapi
node_group -->|"queries database"| node_db
node_eligibility -->|"queries database"| node_db
node_audit -->|"broadcasts changes"| node_realtime
node_realtime -->|"emits events"| node_socket
node_server -->|"uses MySQL"| node_db
node_server -->|"provides live updates"| node_realtime

click node_app "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/client/src/App.jsx"
click node_authctx "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/client/src/utils/AuthContext.jsx"
click node_admin "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/client/src/admin/adminRoutes.jsx"
click node_student "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/client/src/students/studentRoutes.jsx"
click node_supportui "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/client/src/shared/pages/SupportPage.jsx"
click node_server "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/app.js"
click node_authroutes "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/routes/auth.routes.js"
click node_authctrl "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/controllers/auth.controller.js"
click node_authmw "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/middlewares/auth.middleware.js"
click node_jwt "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/utils/jwt.js"
click node_group "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/membership/membership.service.js"
click node_join "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/joinRequest/joinRequest.service.js"
click node_teamhub "https://github.com/arivazhagan7b/groupmanagementportal/tree/main/server/modules/team"
click node_event "https://github.com/arivazhagan7b/groupmanagementportal/tree/main/server/modules/event"
click node_eligibility "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/eligibility/eligibility.service.js"
click node_phase "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/phase/phase.service.js"
click node_policy "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/systemConfig/systemConfig.service.js"
click node_points "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/activityPointsWrite/activityPointsWrite.service.js"
click node_audit "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/audit/audit.service.js"
click node_supportapi "https://github.com/arivazhagan7b/groupmanagementportal/tree/main/server/modules/support"
click node_db "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/config/db.js"
click node_realtime "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/realtime/events.js"
click node_config "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/config/runtime.js"
click node_socket "https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/realtime/socket.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_admin,node_student,node_supportui,node_user toneBlue
class node_server,node_authroutes,node_authctrl,node_authmw,node_jwt toneAmber
class node_group,node_join,node_teamhub,node_event,node_supportapi toneMint
class node_eligibility,node_phase,node_policy,node_points,node_audit toneRose
class node_db,node_realtime,node_config,node_socket toneIndigo
```

## Components

### Web client

- [Role-based app](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Session context](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/client/src/utils/AuthContext.jsx): `client/src/utils/AuthContext.jsx`
- [Admin workspace](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/client/src/admin/adminRoutes.jsx): `client/src/admin/adminRoutes.jsx`
- [Student workspace](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/client/src/students/studentRoutes.jsx): `client/src/students/studentRoutes.jsx`
- [Support center](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/client/src/shared/pages/SupportPage.jsx): `client/src/shared/pages/SupportPage.jsx`

### Identity and access

- [Express API](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/app.js): `server/app.js`
- [Auth routes](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/routes/auth.routes.js): `server/routes/auth.routes.js`
- [Login and session](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/controllers/auth.controller.js): `server/controllers/auth.controller.js`
- [Cookie authentication](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/middlewares/auth.middleware.js): `server/middlewares/auth.middleware.js`
- [JWT utilities](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/utils/jwt.js): `server/utils/jwt.js`

### Group operations

- [Groups and memberships](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/membership/membership.service.js): `server/modules/membership/membership.service.js`
- [Join requests](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/joinRequest/joinRequest.service.js): `server/modules/joinRequest/joinRequest.service.js`
- [Teams and hubs](https://github.com/arivazhagan7b/groupmanagementportal/tree/main/server/modules/team): `server/modules/team`
- [Events and groups](https://github.com/arivazhagan7b/groupmanagementportal/tree/main/server/modules/event): `server/modules/event`
- [Support API](https://github.com/arivazhagan7b/groupmanagementportal/tree/main/server/modules/support): `server/modules/support`

### Activities and policy

- [Eligibility scoring](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/eligibility/eligibility.service.js): `server/modules/eligibility/eligibility.service.js`
- [Phase lifecycle](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/phase/phase.service.js): `server/modules/phase/phase.service.js`
- [System policy](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/systemConfig/systemConfig.service.js): `server/modules/systemConfig/systemConfig.service.js`
- [Activity points](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/activityPointsWrite/activityPointsWrite.service.js): `server/modules/activityPointsWrite/activityPointsWrite.service.js`
- [Audit logging](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/modules/audit/audit.service.js): `server/modules/audit/audit.service.js`

### Persistence and updates

- [MySQL pool](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/config/db.js): `server/config/db.js`
- [Realtime events](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/realtime/events.js): `server/realtime/events.js`
- [Runtime configuration](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/config/runtime.js): `server/config/runtime.js`
- [Socket.IO server](https://github.com/arivazhagan7b/groupmanagementportal/blob/main/server/realtime/socket.js): `server/realtime/socket.js`

### Other components

- **Portal user**

## Connections

- Portal user → Role-based app: opens portal (evidence: `README.md`)
- Role-based app → Session context: checks session (evidence: `client/src/App.jsx`)
- Role-based app → Admin workspace: routes admins (evidence: `client/src/App.jsx`)
- Role-based app → Student workspace: routes students (evidence: `client/src/App.jsx`)
- Student workspace → Support center: routes to (evidence: `client/src/students/studentRoutes.jsx`)
- Session context → Express API: calls API
- Admin workspace → Express API: calls API
- Student workspace → Express API: calls API
- Support center → Support API: uses support API (evidence: `client/src/shared/pages/SupportPage.jsx`)
- Express API → Auth routes: mounts routes (evidence: `server/app.js`)
- Auth routes → Login and session: dispatches (evidence: `server/routes/auth.routes.js`)
- Auth routes → Cookie authentication: protects routes (evidence: `server/routes/auth.routes.js`)
- Cookie authentication → JWT utilities: validates session (evidence: `server/middlewares/auth.middleware.js`)
- Cookie authentication → Runtime configuration: reads secret (evidence: `server/middlewares/auth.middleware.js`)
- Express API → Groups and memberships: mounts domain routes (evidence: `server/app.js`)
- Express API → Join requests: mounts domain routes (evidence: `server/app.js`)
- Express API → Eligibility scoring: mounts domain routes (evidence: `server/app.js`)
- Groups and memberships → Join requests: uses request service (evidence: `server/modules/joinRequest/joinRequest.service.js`)
- Join requests → Groups and memberships: uses membership service (evidence: `server/modules/joinRequest/joinRequest.service.js`)
- Groups and memberships → Phase lifecycle: reads phase data (evidence: `server/modules/membership/membership.service.js`)
- Groups and memberships → System policy: reads policy (evidence: `server/modules/membership/membership.service.js`)
- Groups and memberships → Activity points: writes activity points (evidence: `server/modules/membership/membership.service.js`)
- Eligibility scoring → Groups and memberships: reads membership (evidence: `server/modules/eligibility/eligibility.service.js`)
- Eligibility scoring → Activity points: writes activity points (evidence: `server/modules/eligibility/eligibility.service.js`)
- Express API → Teams and hubs: mounts domain routes (evidence: `server/app.js`)
- Express API → Events and groups: mounts domain routes (evidence: `server/app.js`)
- Express API → Support API: mounts support routes (evidence: `server/app.js`)
- Groups and memberships → MySQL pool: queries database (evidence: `README.md`)
- Eligibility scoring → MySQL pool: queries database (evidence: `server/modules/eligibility/eligibility.service.js`)
- Audit logging → Realtime events: broadcasts changes (evidence: `server/modules/audit/audit.service.js`)
- Realtime events → Socket.IO server: emits events (evidence: `server/realtime/events.js`)
- Express API → MySQL pool: uses MySQL (evidence: `README.md`)
- Express API → Realtime events: provides live updates (evidence: `README.md`)
