# babita-0505/capacity-connect architecture

> Architecture diagram of the GitHub repository babita-0505/capacity-connect, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/babita-0505/capacity-connect
- Repository: https://github.com/babita-0505/capacity-connect

## Overview

Capacity Connect is an IMD-focused learning and capacity-building portal. Users register and sign in, complete meteorological profiles, discover courses and learning resources, then access assessments and competency-oriented features. Trainers create courses and resources; administrators manage approvals and users. The README documents community, question generation, dashboard, and competency capabilities, though their implementations were not sampled. The graph uses documented capability paths and sampled frontend/API wiring; unsampled internal calls are left unspecified.

Main entry points: [`api/app/main.py`](https://github.com/babita-0505/capacity-connect/blob/master/api/app/main.py) (FastAPI application), [`web/lib/api.ts`](https://github.com/babita-0505/capacity-connect/blob/master/web/lib/api.ts) (Browser API client), [`web/app/page.tsx`](https://github.com/babita-0505/capacity-connect/blob/master/web/app/page.tsx) (Portal home), [`web/app/(auth)/login/page.tsx`](https://github.com/babita-0505/capacity-connect/blob/master/web/app/(auth)/login/page.tsx) (Sign-in and signup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_home["Portal home<br/>[page.tsx]"]
  node_authpages["Sign-in and signup<br/>[page.tsx]"]
  node_profileui["Profile editor<br/>[page.tsx]"]
  node_catalog["Course catalogue<br/>[page.tsx]"]
  node_courseview["Course resources<br/>[page.tsx]"]
  node_trainerui["Trainer course tools<br/>[page.tsx]"]
  node_adminui["Admin user tools<br/>[page.tsx]"]
  node_apiclient["Browser API client<br/>[api.ts]"]
end

subgraph group_identity["Identity and administration"]
  node_auth["Authentication<br/>[auth.py]"]
  node_admin["User administration<br/>[admin.py]"]
  node_profile["Profiles and skills<br/>[profile.py]"]
end

subgraph group_learning["Learning and assessment"]
  node_courses["Course management<br/>[courses.py]"]
  node_files["File uploads<br/>[files.py]"]
  node_assessments["Timed assessments<br/>[assessments.py]"]
  node_community["Learning community<br/>[community.py]"]
  node_generation["Question generation<br/>[generation.py]"]
end

subgraph group_insight["Competency and insights"]
  node_competency["Competency mapping<br/>[competency.py]"]
  node_dashboard["Learning dashboard<br/>[dashboard.py]"]
end

subgraph group_runtime["API runtime"]
  node_api["FastAPI application<br/>[main.py]"]
  node_worker["Background job worker<br/>[runner.py]"]
  node_database[("PostgreSQL<br/>[db.py]")]
  node_disk[("Upload storage")]
end

node_learner(("Portal user"))

node_learner -->|"opens portal"| node_home
node_home -->|"explores courses"| node_catalog
node_learner -->|"registers or signs in"| node_authpages
node_learner -->|"completes profile"| node_profileui
node_learner -->|"opens course"| node_courseview
node_trainerui -->|"requests course actions"| node_apiclient
node_adminui -->|"requests user actions"| node_apiclient
node_profileui -->|"requests profile data"| node_apiclient
node_catalog -->|"searches catalogue"| node_apiclient
node_courseview -->|"loads course"| node_apiclient
node_authpages -->|"sends credentials"| node_apiclient
node_apiclient -->|"sends API requests"| node_api
node_api -->|"mounts router"| node_auth
node_api -->|"mounts router"| node_admin
node_api -->|"mounts router"| node_profile
node_api -->|"mounts router"| node_courses
node_api -->|"mounts router"| node_files
node_api -->|"mounts router"| node_assessments
node_api -->|"mounts router"| node_community
node_api -->|"mounts router"| node_generation
node_api -->|"mounts router"| node_competency
node_api -->|"mounts router"| node_dashboard
node_api -->|"starts worker"| node_worker
node_auth -->|"reads and writes"| node_database
node_worker -->|"processes jobs"| node_database
node_api -->|"serves uploads"| node_disk

click node_home "https://github.com/babita-0505/capacity-connect/blob/master/web/app/page.tsx"
click node_authpages "https://github.com/babita-0505/capacity-connect/blob/master/web/app/(auth)/login/page.tsx"
click node_profileui "https://github.com/babita-0505/capacity-connect/blob/master/web/app/profile/page.tsx"
click node_catalog "https://github.com/babita-0505/capacity-connect/blob/master/web/app/courses/page.tsx"
click node_courseview "https://github.com/babita-0505/capacity-connect/blob/master/web/app/courses/%5Bid%5D/page.tsx"
click node_trainerui "https://github.com/babita-0505/capacity-connect/blob/master/web/app/trainer/courses/page.tsx"
click node_adminui "https://github.com/babita-0505/capacity-connect/blob/master/web/app/admin/users/page.tsx"
click node_apiclient "https://github.com/babita-0505/capacity-connect/blob/master/web/lib/api.ts"
click node_auth "https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/auth.py"
click node_admin "https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/admin.py"
click node_profile "https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/profile.py"
click node_courses "https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/courses.py"
click node_files "https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/files.py"
click node_assessments "https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/assessments.py"
click node_community "https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/community.py"
click node_generation "https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/generation.py"
click node_competency "https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/competency.py"
click node_dashboard "https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/dashboard.py"
click node_api "https://github.com/babita-0505/capacity-connect/blob/master/api/app/main.py"
click node_worker "https://github.com/babita-0505/capacity-connect/blob/master/api/app/worker/runner.py"
click node_database "https://github.com/babita-0505/capacity-connect/blob/master/api/app/db.py"

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_home,node_authpages,node_profileui,node_catalog,node_courseview,node_trainerui,node_adminui,node_apiclient,node_learner toneBlue
class node_auth,node_admin,node_profile toneAmber
class node_courses,node_files,node_assessments,node_community,node_generation toneMint
class node_competency,node_dashboard toneRose
class node_api,node_worker,node_database,node_disk toneIndigo
```

## Components

### User experience

- [Portal home](https://github.com/babita-0505/capacity-connect/blob/master/web/app/page.tsx): `web/app/page.tsx`
- [Sign-in and signup](https://github.com/babita-0505/capacity-connect/blob/master/web/app/(auth)/login/page.tsx): `web/app/(auth)/login/page.tsx`
- [Profile editor](https://github.com/babita-0505/capacity-connect/blob/master/web/app/profile/page.tsx): `web/app/profile/page.tsx`
- [Course catalogue](https://github.com/babita-0505/capacity-connect/blob/master/web/app/courses/page.tsx): `web/app/courses/page.tsx`
- [Course resources](https://github.com/babita-0505/capacity-connect/blob/master/web/app/courses/%5Bid%5D/page.tsx): `web/app/courses/[id]/page.tsx`
- [Trainer course tools](https://github.com/babita-0505/capacity-connect/blob/master/web/app/trainer/courses/page.tsx): `web/app/trainer/courses/page.tsx`
- [Admin user tools](https://github.com/babita-0505/capacity-connect/blob/master/web/app/admin/users/page.tsx): `web/app/admin/users/page.tsx`
- [Browser API client](https://github.com/babita-0505/capacity-connect/blob/master/web/lib/api.ts): `web/lib/api.ts`

### Identity and administration

- [Authentication](https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/auth.py): `api/app/routers/auth.py`
- [User administration](https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/admin.py): `api/app/routers/admin.py`
- [Profiles and skills](https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/profile.py): `api/app/routers/profile.py`

### Learning and assessment

- [Course management](https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/courses.py): `api/app/routers/courses.py`
- [File uploads](https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/files.py): `api/app/routers/files.py`
- [Timed assessments](https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/assessments.py): `api/app/routers/assessments.py`
- [Learning community](https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/community.py): `api/app/routers/community.py`
- [Question generation](https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/generation.py): `api/app/routers/generation.py`

### Competency and insights

- [Competency mapping](https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/competency.py): `api/app/routers/competency.py`
- [Learning dashboard](https://github.com/babita-0505/capacity-connect/blob/master/api/app/routers/dashboard.py): `api/app/routers/dashboard.py`

### API runtime

- [FastAPI application](https://github.com/babita-0505/capacity-connect/blob/master/api/app/main.py): `api/app/main.py`
- [Background job worker](https://github.com/babita-0505/capacity-connect/blob/master/api/app/worker/runner.py): `api/app/worker/runner.py`
- [PostgreSQL](https://github.com/babita-0505/capacity-connect/blob/master/api/app/db.py): `api/app/db.py`
- **Upload storage**

### Other components

- **Portal user**

## Connections

- Portal user → Portal home: opens portal
- Portal home → Course catalogue: explores courses
- Portal user → Sign-in and signup: registers or signs in
- Portal user → Profile editor: completes profile
- Portal user → Course resources: opens course
- Trainer course tools → Browser API client: requests course actions
- Admin user tools → Browser API client: requests user actions
- Profile editor → Browser API client: requests profile data
- Course catalogue → Browser API client: searches catalogue
- Course resources → Browser API client: loads course
- Sign-in and signup → Browser API client: sends credentials
- Browser API client → FastAPI application: sends API requests
- FastAPI application → Authentication: mounts router
- FastAPI application → User administration: mounts router
- FastAPI application → Profiles and skills: mounts router
- FastAPI application → Course management: mounts router
- FastAPI application → File uploads: mounts router
- FastAPI application → Timed assessments: mounts router
- FastAPI application → Learning community: mounts router
- FastAPI application → Question generation: mounts router
- FastAPI application → Competency mapping: mounts router
- FastAPI application → Learning dashboard: mounts router
- FastAPI application → Background job worker: starts worker
- Authentication → PostgreSQL: reads and writes
- Background job worker → PostgreSQL: processes jobs
- FastAPI application → Upload storage: serves uploads
