# vaibhav025/capacity-connect architecture

> Architecture diagram of the GitHub repository vaibhav025/capacity-connect, 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/vaibhav025/capacity-connect
- Repository: https://github.com/vaibhav025/capacity-connect

## Overview

Capacity Connect is a role-based learning-management prototype for IMD trainees, trainers, and administrators. Its main learner journey is to find a course, study learning notes, take a knowledge check, and view a certificate when the score qualifies; the trainer and admin workspaces provide separate content, project, approval, and competency capabilities. The demo store supplies session-local learning and UI state, while selected server routes read or update Supabase when configured. Some page implementations and client data wiring were not sampled, so uncertain connections are omitted.

Main entry points: [`src/components/layout/Shell.tsx`](https://github.com/vaibhav025/capacity-connect/blob/main/src/components/layout/Shell.tsx) (Workspace shell), [`server/index.js`](https://github.com/vaibhav025/capacity-connect/blob/main/server/index.js) (Express API), [`src/App.tsx`](https://github.com/vaibhav025/capacity-connect/blob/main/src/App.tsx) (Role router), [`src/pages/CourseDetail.tsx`](https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/CourseDetail.tsx) (Course learning path)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Role workspaces"]
  node_app["Role router<br/>[App.tsx]"]
  node_shell["Workspace shell<br/>[Shell.tsx]"]
  node_login["Login screen<br/>[Login.tsx]"]
  node_dashboard["Role dashboards<br/>[Dashboard.tsx]"]
  node_collaboration["Announcements and discussion<br/>[Announcements.tsx]"]
  node_calendar["Calendar and events<br/>[CalendarPage.tsx]"]
end

subgraph group_learning["Learning journey"]
  node_courses["Course catalogue<br/>[Courses.tsx]"]
  node_course_detail["Course learning path<br/>[CourseDetail.tsx]"]
  node_learning_notes["Learning notes<br/>[learning.ts]"]
  node_assessment["Knowledge check"]
  node_certificates["Certificates<br/>[Certificates.tsx]"]
  node_certificate_verify["Certificate verification"]
end

subgraph group_management["Training management"]
  node_trainer_authoring["Trainer authoring"]
  node_content_uploader["Content staging"]
  node_projects["Projects and submissions<br/>[Projects.tsx]"]
  node_user_approvals["User approvals<br/>[UsersPage.tsx]"]
  node_competency["Competency matching"]
  node_analytics["Readiness and KPIs"]
  node_audit["Audit trail<br/>[AuditTrail.tsx]"]
end

subgraph group_platform["Runtime and data"]
  node_demo_store[("Session demo state<br/>[demoStore.ts]")]
  node_api["Express API<br/>[index.js]"]
  node_matching["Trainer ranking<br/>[competency.js]"]
  node_demo_trainers["Seeded trainer data<br/>[demoTrainers.js]"]
end

node_user(("Admin / trainer / trainee"))
node_supabase[("Supabase")]

node_user -->|"opens workspace"| node_app
node_app -->|"routes login"| node_login
node_app -->|"routes by role"| node_shell
node_shell -->|"routes pages"| node_dashboard
node_shell -->|"routes pages"| node_courses
node_shell -->|"routes pages"| node_course_detail
node_shell -->|"routes pages"| node_certificates
node_shell -->|"routes pages"| node_certificate_verify
node_shell -->|"routes pages"| node_user_approvals
node_shell -->|"routes pages"| node_collaboration
node_shell -->|"routes pages"| node_calendar
node_shell -->|"routes pages"| node_audit
node_course_detail -->|"uses notes"| node_learning_notes
node_course_detail -->|"offers knowledge check"| node_assessment
node_assessment -->|"saves learning state"| node_demo_store
node_assessment -->|"links earned certificate"| node_certificates
node_content_uploader -->|"stages course materials"| node_trainer_authoring
node_projects -->|"updates project state"| node_demo_store
node_competency -->|"requests recommendations"| node_api
node_api -->|"ranks trainers"| node_matching
node_api -.->|"reads fallback data"| node_demo_trainers
node_api -.->|"reads and updates"| node_supabase
node_api -->|"serves approval action"| node_user_approvals

click node_app "https://github.com/vaibhav025/capacity-connect/blob/main/src/App.tsx"
click node_shell "https://github.com/vaibhav025/capacity-connect/blob/main/src/components/layout/Shell.tsx"
click node_login "https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/Login.tsx"
click node_dashboard "https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/Dashboard.tsx"
click node_courses "https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/Courses.tsx"
click node_course_detail "https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/CourseDetail.tsx"
click node_learning_notes "https://github.com/vaibhav025/capacity-connect/blob/main/src/data/learning.ts"
click node_assessment "https://github.com/vaibhav025/capacity-connect/blob/main/src/components/trainee/AssessmentPlayer.tsx"
click node_certificates "https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/Certificates.tsx"
click node_certificate_verify "https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/CertificateVerify.tsx"
click node_trainer_authoring "https://github.com/vaibhav025/capacity-connect/blob/main/src/components/trainer/QuestionnaireBuilder.tsx"
click node_content_uploader "https://github.com/vaibhav025/capacity-connect/blob/main/src/components/trainer/DragDropContentUploader.tsx"
click node_projects "https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/Projects.tsx"
click node_user_approvals "https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/UsersPage.tsx"
click node_competency "https://github.com/vaibhav025/capacity-connect/blob/main/src/components/admin/CompetencyMatchModal.tsx"
click node_analytics "https://github.com/vaibhav025/capacity-connect/blob/main/src/components/admin/ReadinessOverview.tsx"
click node_collaboration "https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/Announcements.tsx"
click node_calendar "https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/CalendarPage.tsx"
click node_audit "https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/AuditTrail.tsx"
click node_demo_store "https://github.com/vaibhav025/capacity-connect/blob/main/src/lib/demoStore.ts"
click node_api "https://github.com/vaibhav025/capacity-connect/blob/main/server/index.js"
click node_matching "https://github.com/vaibhav025/capacity-connect/blob/main/server/services/competency.js"
click node_demo_trainers "https://github.com/vaibhav025/capacity-connect/blob/main/server/services/demoTrainers.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_shell,node_login,node_dashboard,node_collaboration,node_calendar toneBlue
class node_courses,node_course_detail,node_learning_notes,node_assessment,node_certificates,node_certificate_verify,node_supabase toneAmber
class node_trainer_authoring,node_content_uploader,node_projects,node_user_approvals,node_competency,node_analytics,node_audit toneMint
class node_demo_store,node_api,node_matching,node_demo_trainers toneRose
class node_user toneIndigo
```

## Components

### Role workspaces

- [Role router](https://github.com/vaibhav025/capacity-connect/blob/main/src/App.tsx): `src/App.tsx`
- [Workspace shell](https://github.com/vaibhav025/capacity-connect/blob/main/src/components/layout/Shell.tsx): `src/components/layout/Shell.tsx`
- [Login screen](https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`
- [Role dashboards](https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Announcements and discussion](https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/Announcements.tsx): `src/pages/Announcements.tsx`
- [Calendar and events](https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/CalendarPage.tsx): `src/pages/CalendarPage.tsx`

### Learning journey

- [Course catalogue](https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/Courses.tsx): `src/pages/Courses.tsx`
- [Course learning path](https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/CourseDetail.tsx): `src/pages/CourseDetail.tsx`
- [Learning notes](https://github.com/vaibhav025/capacity-connect/blob/main/src/data/learning.ts): `src/data/learning.ts`
- [Knowledge check](https://github.com/vaibhav025/capacity-connect/blob/main/src/components/trainee/AssessmentPlayer.tsx): `src/components/trainee/AssessmentPlayer.tsx`
- [Certificates](https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/Certificates.tsx): `src/pages/Certificates.tsx`
- [Certificate verification](https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/CertificateVerify.tsx): `src/pages/CertificateVerify.tsx`

### Training management

- [Trainer authoring](https://github.com/vaibhav025/capacity-connect/blob/main/src/components/trainer/QuestionnaireBuilder.tsx): `src/components/trainer/QuestionnaireBuilder.tsx`
- [Content staging](https://github.com/vaibhav025/capacity-connect/blob/main/src/components/trainer/DragDropContentUploader.tsx): `src/components/trainer/DragDropContentUploader.tsx`
- [Projects and submissions](https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/Projects.tsx): `src/pages/Projects.tsx`
- [User approvals](https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/UsersPage.tsx): `src/pages/UsersPage.tsx`
- [Competency matching](https://github.com/vaibhav025/capacity-connect/blob/main/src/components/admin/CompetencyMatchModal.tsx): `src/components/admin/CompetencyMatchModal.tsx`
- [Readiness and KPIs](https://github.com/vaibhav025/capacity-connect/blob/main/src/components/admin/ReadinessOverview.tsx): `src/components/admin/ReadinessOverview.tsx`
- [Audit trail](https://github.com/vaibhav025/capacity-connect/blob/main/src/pages/AuditTrail.tsx): `src/pages/AuditTrail.tsx`

### Runtime and data

- [Session demo state](https://github.com/vaibhav025/capacity-connect/blob/main/src/lib/demoStore.ts): `src/lib/demoStore.ts`
- [Express API](https://github.com/vaibhav025/capacity-connect/blob/main/server/index.js): `server/index.js`
- [Trainer ranking](https://github.com/vaibhav025/capacity-connect/blob/main/server/services/competency.js): `server/services/competency.js`
- [Seeded trainer data](https://github.com/vaibhav025/capacity-connect/blob/main/server/services/demoTrainers.js): `server/services/demoTrainers.js`

### Other components

- **Admin / trainer / trainee**
- **Supabase**

## Connections

- Admin / trainer / trainee → Role router: opens workspace
- Role router → Login screen: routes login
- Role router → Workspace shell: routes by role
- Workspace shell → Role dashboards: routes pages
- Workspace shell → Course catalogue: routes pages
- Workspace shell → Course learning path: routes pages
- Workspace shell → Certificates: routes pages
- Workspace shell → Certificate verification: routes pages
- Workspace shell → User approvals: routes pages
- Workspace shell → Announcements and discussion: routes pages
- Workspace shell → Calendar and events: routes pages
- Workspace shell → Audit trail: routes pages
- Course learning path → Learning notes: uses notes
- Course learning path → Knowledge check: offers knowledge check
- Knowledge check → Session demo state: saves learning state
- Knowledge check → Certificates: links earned certificate
- Content staging → Trainer authoring: stages course materials
- Projects and submissions → Session demo state: updates project state
- Competency matching → Express API: requests recommendations
- Express API → Trainer ranking: ranks trainers
- Express API → Seeded trainer data: reads fallback data
- Express API → Supabase: reads and updates
- Express API → User approvals: serves approval action
