# shubhamshubham66/cadet-connection-portal architecture

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

- Interactive diagram: https://gitdiagram.com/shubhamshubham66/cadet-connection-portal
- Repository: https://github.com/shubhamshubham66/cadet-connection-portal

## Overview

Cadet Connection Portal is an NCC cadet and officer portal: cadets register and use self-service features, while role-scoped administrators manage cadets and operations. The documented pages and backend routes cover camps, attendance, certificates, gallery, events, reports and payments. The sampled code confirms API dispatch, registration/authentication, camp registration, payment handling and ID-card generation. Several frontend pages and backend subsystems are represented from the tree and README; their internal wiring was not sampled, so unsupported connections are omitted.

Main entry points: [`backend/server.js`](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/server.js) (API server), [`backend/routes/payments.js`](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/payments.js) (Registration payments), [`cadet`](https://github.com/shubhamshubham66/cadet-connection-portal/tree/main/cadet) (Portal pages), [`backend/routes/auth.js`](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/auth.js) (Login and profile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Portal access"]
  node_web["Portal pages"]
  node_officer_ui["Officer console"]
  node_public_ui["Public pages<br/>[index.html]"]
end

subgraph group_identity["Identity and access"]
  node_auth_routes["Login and profile<br/>[auth.js]"]
  node_registration["Cadet registration<br/>[registration.js]"]
  node_preapproval["Eligibility approvals<br/>[admin.js]"]
  node_access["Token access control<br/>[auth.js]"]
end

subgraph group_operations["Cadet operations"]
  node_cadet_data[("Cadet records<br/>[Cadet.js]")]
  node_admin_data[("Admin accounts<br/>[Admin.js]")]
  node_camp_routes["Camp management<br/>[camps.js]"]
  node_camp_data[("Camp records<br/>[Camp.js]")]
  node_camp_signups[("Camp registrations")]
  node_payments["Registration payments<br/>[payments.js]"]
  node_fee_settings[("Fee settings<br/>[Settings.js]")]
  node_idcard["ID-card generator<br/>[idCardGenerator.js]"]
  node_attendance["Attendance pages<br/>[attendance.html]"]
  node_certificates["Certificates pages<br/>[certificates.html]"]
end

subgraph group_content["Portal content"]
  node_uploads["Media uploads<br/>[upload.js]"]
  node_gallery["Gallery service<br/>[gallery.js]"]
  node_content_pages["Events and information<br/>[events.html]"]
end

subgraph group_platform["Platform services"]
  node_api["API server<br/>[server.js]"]
  node_cloudinary["Cloudinary storage<br/>[cloudinary.js]"]
  node_database[("MongoDB connection<br/>[db.js]")]
end

node_cadet(("Cadet"))
node_officer(("Officer"))
node_public(("Public visitor"))
node_razorpay["Razorpay"]

node_cadet -.->|"uses"| node_web
node_officer -.->|"uses"| node_officer_ui
node_public -.->|"views"| node_public_ui
node_api -->|"connects"| node_database
node_api -->|"routes"| node_auth_routes
node_api -->|"routes"| node_camp_routes
node_api -->|"routes"| node_payments
node_api -->|"routes"| node_registration
node_api -->|"routes"| node_preapproval
node_api -->|"routes"| node_gallery
node_auth_routes -->|"reads and updates"| node_cadet_data
node_auth_routes -->|"reads"| node_admin_data
node_auth_routes -->|"verifies token"| node_access
node_registration -->|"checks eligibility"| node_preapproval
node_registration -->|"creates cadet"| node_cadet_data
node_preapproval -->|"checks existing"| node_cadet_data
node_preapproval -->|"requires roles"| node_access
node_camp_routes -->|"reads and writes"| node_camp_data
node_camp_routes -->|"manages signups"| node_camp_signups
node_camp_routes -->|"requires roles"| node_access
node_payments -->|"reads and updates"| node_cadet_data
node_payments -->|"reads and sets"| node_fee_settings
node_payments -->|"requires roles"| node_access
node_payments -.->|"creates orders"| node_razorpay
node_idcard -->|"uploads PDF"| node_cloudinary
node_uploads -->|"stores media"| node_cloudinary
node_gallery -.->|"serves gallery"| node_content_pages
node_web -.->|"requests data"| node_api
node_officer_ui -.->|"manages portal"| node_api
node_web -.->|"includes"| node_attendance
node_web -.->|"includes"| node_certificates

click node_web "https://github.com/shubhamshubham66/cadet-connection-portal/tree/main/cadet"
click node_officer_ui "https://github.com/shubhamshubham66/cadet-connection-portal/tree/main/officer"
click node_public_ui "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/index.html"
click node_api "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/server.js"
click node_auth_routes "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/auth.js"
click node_registration "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/registration.js"
click node_preapproval "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/admin.js"
click node_access "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/middleware/auth.js"
click node_cadet_data "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/models/Cadet.js"
click node_admin_data "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/models/Admin.js"
click node_camp_routes "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/camps.js"
click node_camp_data "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/models/Camp.js"
click node_camp_signups "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/models/CampRegistration.js"
click node_payments "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/payments.js"
click node_fee_settings "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/models/Settings.js"
click node_idcard "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/utils/idCardGenerator.js"
click node_uploads "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/upload.js"
click node_cloudinary "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/config/cloudinary.js"
click node_gallery "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/gallery.js"
click node_content_pages "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/events.html"
click node_attendance "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/cadet/attendance.html"
click node_certificates "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/cadet/certificates.html"
click node_database "https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/config/db.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_web,node_officer_ui,node_public_ui toneBlue
class node_auth_routes,node_registration,node_preapproval,node_access toneAmber
class node_cadet_data,node_admin_data,node_camp_routes,node_camp_data,node_camp_signups,node_payments,node_fee_settings,node_idcard,node_attendance,node_certificates toneMint
class node_uploads,node_gallery,node_content_pages toneRose
class node_api,node_cloudinary,node_database,node_cadet,node_officer,node_public,node_razorpay toneIndigo
```

## Components

### Portal access

- [Portal pages](https://github.com/shubhamshubham66/cadet-connection-portal/tree/main/cadet): `cadet`
- [Officer console](https://github.com/shubhamshubham66/cadet-connection-portal/tree/main/officer): `officer`
- [Public pages](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/index.html): `index.html`

### Identity and access

- [Login and profile](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Cadet registration](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/registration.js): `backend/routes/registration.js`
- [Eligibility approvals](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/admin.js): `backend/routes/admin.js`
- [Token access control](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`

### Cadet operations

- [Cadet records](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/models/Cadet.js): `backend/models/Cadet.js`
- [Admin accounts](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/models/Admin.js): `backend/models/Admin.js`
- [Camp management](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/camps.js): `backend/routes/camps.js`
- [Camp records](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/models/Camp.js): `backend/models/Camp.js`
- [Camp registrations](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/models/CampRegistration.js): `backend/models/CampRegistration.js`
- [Registration payments](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/payments.js): `backend/routes/payments.js`
- [Fee settings](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/models/Settings.js): `backend/models/Settings.js`
- [ID-card generator](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/utils/idCardGenerator.js): `backend/utils/idCardGenerator.js`
- [Attendance pages](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/cadet/attendance.html): `cadet/attendance.html`
- [Certificates pages](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/cadet/certificates.html): `cadet/certificates.html`

### Portal content

- [Media uploads](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/upload.js): `backend/routes/upload.js`
- [Gallery service](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/routes/gallery.js): `backend/routes/gallery.js`
- [Events and information](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/events.html): `events.html`

### Platform services

- [API server](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/server.js): `backend/server.js`
- [Cloudinary storage](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/config/cloudinary.js): `backend/config/cloudinary.js`
- [MongoDB connection](https://github.com/shubhamshubham66/cadet-connection-portal/blob/main/backend/config/db.js): `backend/config/db.js`

### Other components

- **Cadet**
- **Officer**
- **Public visitor**
- **Razorpay**

## Connections

- Cadet → Portal pages: uses (evidence: `README.md`)
- Officer → Officer console: uses (evidence: `README.md`)
- Public visitor → Public pages: views (evidence: `README.md`)
- API server → MongoDB connection: connects (evidence: `backend/server.js`)
- API server → Login and profile: routes (evidence: `backend/server.js`)
- API server → Camp management: routes (evidence: `backend/server.js`)
- API server → Registration payments: routes (evidence: `backend/server.js`)
- API server → Cadet registration: routes (evidence: `backend/server.js`)
- API server → Eligibility approvals: routes (evidence: `backend/server.js`)
- API server → Gallery service: routes (evidence: `backend/server.js`)
- Login and profile → Cadet records: reads and updates (evidence: `backend/routes/auth.js`)
- Login and profile → Admin accounts: reads (evidence: `backend/routes/auth.js`)
- Login and profile → Token access control: verifies token (evidence: `backend/routes/auth.js`)
- Cadet registration → Eligibility approvals: checks eligibility (evidence: `backend/routes/registration.js`)
- Cadet registration → Cadet records: creates cadet (evidence: `backend/routes/registration.js`)
- Eligibility approvals → Cadet records: checks existing (evidence: `backend/routes/admin.js`)
- Eligibility approvals → Token access control: requires roles (evidence: `backend/routes/admin.js`)
- Camp management → Camp records: reads and writes (evidence: `backend/routes/camps.js`)
- Camp management → Camp registrations: manages signups (evidence: `backend/routes/camps.js`)
- Camp management → Token access control: requires roles (evidence: `backend/routes/camps.js`)
- Registration payments → Cadet records: reads and updates (evidence: `backend/routes/payments.js`)
- Registration payments → Fee settings: reads and sets (evidence: `backend/routes/payments.js`)
- Registration payments → Token access control: requires roles (evidence: `backend/routes/payments.js`)
- Registration payments → Razorpay: creates orders
- ID-card generator → Cloudinary storage: uploads PDF (evidence: `backend/utils/idCardGenerator.js`)
- Media uploads → Cloudinary storage: stores media (evidence: `backend/routes/upload.js`)
- Gallery service → Events and information: serves gallery
- Portal pages → API server: requests data
- Officer console → API server: manages portal
- Portal pages → Attendance pages: includes (evidence: `README.md`)
- Portal pages → Certificates pages: includes (evidence: `README.md`)
