# ganganidhanush-maker/cybersecuirity-website architecture

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

- Interactive diagram: https://gitdiagram.com/ganganidhanush-maker/cybersecuirity-website
- Repository: https://github.com/ganganidhanush-maker/cybersecuirity-website

## Overview

This is a Cyber Security Club portal for members and administrators. A member uses the React client to sign in, then reaches event discovery and registration, payments, passes, profile, and club services; administrators manage accounts, events, payments, media, and audit records. The client sends API requests to Express, which routes them to controllers and persists domain data in MySQL through Prisma. The README documents security and additional capabilities; unsampled implementation details are represented at their exact enclosing directories, with undocumented relationships omitted.

Main entry points: [`server/app.js`](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/app.js) (Express app), [`server/controllers/member.controller.js`](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/controllers/member.controller.js) (Member services), [`server/routes/auth.routes.js`](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/routes/auth.routes.js) (Authentication routes), [`server/db/prisma.js`](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/db/prisma.js) (Prisma access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Portal client"]
  node_react["Portal interface<br/>[App.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_landing["Club landing"]
end

subgraph group_api["API and access"]
  node_express["Express app<br/>[app.js]"]
  node_session["Session security<br/>[session.js]"]
  node_csrf["CSRF protection<br/>[csrf.js]"]
  node_auth_routes["Authentication routes<br/>[auth.routes.js]"]
  node_auth["Authentication<br/>[auth.controller.js]"]
  node_auth_controls["Access controls<br/>[auth.js]"]
  node_auth_cache["Auth cache"]
  node_totp["Two-factor service<br/>[totp.service.js]"]
  node_mailer["Email delivery<br/>[mailer.service.js]"]
  node_openapi["API documentation<br/>[openapi.js]"]
end

subgraph group_member["Member services"]
  node_member_routes["Member routes<br/>[member.routes.js]"]
  node_member["Member services"]
  node_safe_user["Safe user output<br/>[safe-user.js]"]
  node_notifications["Notifications"]
  node_guest["Guest registration"]
end

subgraph group_admin["Administration"]
  node_admin_routes["Admin routes<br/>[admin.routes.js]"]
  node_admin["Admin operations"]
  node_subscriptions["Subscriptions"]
  node_audit["Audit logging<br/>[audit.service.js]"]
end

subgraph group_data["Persistence"]
  node_prisma["Prisma access<br/>[prisma.js]"]
  node_mysql[("MySQL database")]
end

node_visitor(("Portal user"))

node_visitor -->|"uses"| node_react
node_react -.->|"requests through"| node_api_client
node_api_client -.->|"sends API requests"| node_express
node_express -->|"configures"| node_session
node_express -->|"applies"| node_csrf
node_express -->|"mounts"| node_auth_routes
node_express -->|"mounts"| node_member_routes
node_express -->|"mounts"| node_admin_routes
node_express -->|"serves"| node_openapi
node_auth_routes -->|"routes to"| node_auth
node_auth_routes -->|"routes to"| node_guest
node_auth_routes -->|"routes to"| node_member
node_auth_routes -->|"protects with"| node_auth_controls
node_admin_routes -->|"routes to"| node_admin
node_admin_routes -->|"routes to"| node_subscriptions
node_admin_routes -->|"protects with"| node_auth_controls
node_member_routes -.->|"routes to"| node_member
node_auth -.->|"uses"| node_prisma
node_member -->|"queries"| node_prisma
node_admin -.->|"queries"| node_prisma
node_subscriptions -.->|"queries"| node_prisma
node_prisma -.->|"persists data"| node_mysql
node_member -->|"serializes with"| node_safe_user
node_member -->|"sends"| node_notifications
node_member -->|"writes"| node_audit
node_member -->|"invalidates"| node_auth_cache
node_auth -.->|"uses"| node_totp
node_auth -.->|"sends recovery email"| node_mailer
node_visitor -.->|"views"| node_landing

click node_react "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/src/App.jsx"
click node_api_client "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/src/lib/api.js"
click node_express "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/app.js"
click node_session "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/config/session.js"
click node_csrf "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/middleware/csrf.js"
click node_auth_routes "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/routes/auth.routes.js"
click node_auth "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/controllers/auth.controller.js"
click node_auth_controls "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/middleware/auth.js"
click node_member_routes "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/routes/member.routes.js"
click node_member "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/controllers/member.controller.js"
click node_admin_routes "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/routes/admin.routes.js"
click node_admin "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/controllers/admin.controller.js"
click node_subscriptions "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/controllers/subscription.controller.js"
click node_prisma "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/db/prisma.js"
click node_safe_user "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/utils/safe-user.js"
click node_notifications "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/services/notification.service.js"
click node_audit "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/services/audit.service.js"
click node_auth_cache "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/services/auth-cache.service.js"
click node_guest "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/controllers/guest.controller.js"
click node_totp "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/services/totp.service.js"
click node_mailer "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/services/mailer.service.js"
click node_landing "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/src/components/MrduOfficialLanding.jsx"
click node_openapi "https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/openapi.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_react,node_api_client,node_landing,node_visitor toneBlue
class node_express,node_session,node_csrf,node_auth_routes,node_auth,node_auth_controls,node_auth_cache,node_totp,node_mailer,node_openapi toneAmber
class node_member_routes,node_member,node_safe_user,node_notifications,node_guest toneMint
class node_admin_routes,node_admin,node_subscriptions,node_audit toneRose
class node_prisma,node_mysql toneIndigo
```

## Components

### Portal client

- [Portal interface](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/src/App.jsx): `src/App.jsx`
- [API client](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/src/lib/api.js): `src/lib/api.js`
- [Club landing](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/src/components/MrduOfficialLanding.jsx): `src/components/MrduOfficialLanding.jsx`

### API and access

- [Express app](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/app.js): `server/app.js`
- [Session security](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/config/session.js): `server/config/session.js`
- [CSRF protection](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/middleware/csrf.js): `server/middleware/csrf.js`
- [Authentication routes](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/routes/auth.routes.js): `server/routes/auth.routes.js`
- [Authentication](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/controllers/auth.controller.js): `server/controllers/auth.controller.js`
- [Access controls](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/middleware/auth.js): `server/middleware/auth.js`
- [Auth cache](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/services/auth-cache.service.js): `server/services/auth-cache.service.js`
- [Two-factor service](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/services/totp.service.js): `server/services/totp.service.js`
- [Email delivery](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/services/mailer.service.js): `server/services/mailer.service.js`
- [API documentation](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/openapi.js): `server/openapi.js`

### Member services

- [Member routes](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/routes/member.routes.js): `server/routes/member.routes.js`
- [Member services](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/controllers/member.controller.js): `server/controllers/member.controller.js`
- [Safe user output](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/utils/safe-user.js): `server/utils/safe-user.js`
- [Notifications](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/services/notification.service.js): `server/services/notification.service.js`
- [Guest registration](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/controllers/guest.controller.js): `server/controllers/guest.controller.js`

### Administration

- [Admin routes](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/routes/admin.routes.js): `server/routes/admin.routes.js`
- [Admin operations](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/controllers/admin.controller.js): `server/controllers/admin.controller.js`
- [Subscriptions](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/controllers/subscription.controller.js): `server/controllers/subscription.controller.js`
- [Audit logging](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/services/audit.service.js): `server/services/audit.service.js`

### Persistence

- [Prisma access](https://github.com/ganganidhanush-maker/cybersecuirity-website/blob/main/server/db/prisma.js): `server/db/prisma.js`
- **MySQL database**

### Other components

- **Portal user**

## Connections

- Portal user → Portal interface: uses
- Portal interface → API client: requests through
- API client → Express app: sends API requests (evidence: `README.md`)
- Express app → Session security: configures (evidence: `server/app.js`)
- Express app → CSRF protection: applies (evidence: `server/app.js`)
- Express app → Authentication routes: mounts (evidence: `server/app.js`)
- Express app → Member routes: mounts (evidence: `server/app.js`)
- Express app → Admin routes: mounts (evidence: `server/app.js`)
- Express app → API documentation: serves (evidence: `server/app.js`)
- Authentication routes → Authentication: routes to (evidence: `server/routes/auth.routes.js`)
- Authentication routes → Guest registration: routes to (evidence: `server/routes/auth.routes.js`)
- Authentication routes → Member services: routes to (evidence: `server/routes/auth.routes.js`)
- Authentication routes → Access controls: protects with (evidence: `server/routes/auth.routes.js`)
- Admin routes → Admin operations: routes to (evidence: `server/routes/admin.routes.js`)
- Admin routes → Subscriptions: routes to (evidence: `server/routes/admin.routes.js`)
- Admin routes → Access controls: protects with (evidence: `server/routes/admin.routes.js`)
- Member routes → Member services: routes to
- Authentication → Prisma access: uses
- Member services → Prisma access: queries (evidence: `server/controllers/member.controller.js`)
- Admin operations → Prisma access: queries
- Subscriptions → Prisma access: queries
- Prisma access → MySQL database: persists data
- Member services → Safe user output: serializes with (evidence: `server/controllers/member.controller.js`)
- Member services → Notifications: sends (evidence: `server/controllers/member.controller.js`)
- Member services → Audit logging: writes (evidence: `server/controllers/member.controller.js`)
- Member services → Auth cache: invalidates (evidence: `server/controllers/member.controller.js`)
- Authentication → Two-factor service: uses
- Authentication → Email delivery: sends recovery email
- Portal user → Club landing: views
