# cayelaemj/training-and-development-hub architecture

> Architecture diagram of the GitHub repository cayelaemj/training-and-development-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cayelaemj/training-and-development-hub
- Repository: https://github.com/cayelaemj/training-and-development-hub

## Overview

CABO Learning Hub is a connected education and lifelong-development platform, not just an LMS. A learner signs in, uploads private study material, generates and answers a written exam, then receives AI-assisted scoring and feedback; staff can review results and record audited adjustments in organization workspaces. The broader product also covers academics, learner development, admissions, reporting, governance, and native clients. Edges are limited to README-documented relationships and sampled call sites; many route-to-feature links remain unverified because their implementations were not sampled.

Main entry points: [`artifacts/api-server/src/app.ts`](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/app.ts) (Express API), [`artifacts/api-server/src/routes/writtenExams.ts`](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/writtenExams.ts) (Written examinations), [`artifacts/api-server/src/routes/storage.ts`](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/storage.ts) (Study materials), [`lib/db/src/schema/index.ts`](https://github.com/cayelaemj/training-and-development-hub/blob/main/lib/db/src/schema/index.ts) (PostgreSQL schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learner experience"]
  node_web["Web application<br/>[App.tsx]"]
  node_native["Native clients<br/>[MainActivity.kt]"]
end

subgraph group_learning["Learning and assessment"]
  node_upload["Study materials<br/>[storage.ts]"]
  node_exam["Written examinations<br/>[writtenExams.ts]"]
  node_assessment["Question bank and assessments"]
  node_academic["Academics and gradebook<br/>[academic.ts]"]
end

subgraph group_institutions["Institutional operations"]
  node_organizations["Organization workspaces<br/>[organizations.ts]"]
  node_admissions["Admissions<br/>[admissions.ts]"]
  node_learnerdev["Learner development and passport<br/>[learnerJourney.ts]"]
  node_reporting["Reports and issuance<br/>[reportCards.ts]"]
  node_governance["Governance and accountability"]
end

subgraph group_services["API and services"]
  node_ai["AI completion and credits<br/>[aiCompletion.ts]"]
  node_api["Express API<br/>[app.ts]"]
  node_auth["Authentication middleware<br/>[authMiddleware.ts]"]
  node_storage["Object storage service<br/>[objectStorage.ts]"]
  node_acl["Object access policy<br/>[objectAcl.ts]"]
end

subgraph group_state["Persistence"]
  node_db[("PostgreSQL schema<br/>[index.ts]")]
  node_examdata[("Exam records<br/>[writtenExams.ts]")]
  node_orgdata[("Organization records<br/>[organizations.ts]")]
end

node_learner(("Learner or staff"))

node_learner -->|"uses"| node_web
node_learner -.->|"uses"| node_native
node_web -.->|"requests services"| node_api
node_native -->|"calls endpoints"| node_api
node_api -->|"applies middleware"| node_auth
node_api -.->|"routes requests"| node_upload
node_upload -->|"stores private blobs"| node_storage
node_storage -->|"checks access"| node_acl
node_learner -->|"uploads notes"| node_upload
node_learner -->|"generates and submits"| node_exam
node_exam -.->|"uses AI marking"| node_ai
node_exam -->|"persists attempts"| node_examdata
node_organizations -->|"stores workspaces"| node_orgdata
node_organizations -->|"assigns exams"| node_exam
node_learner -.->|"records progress"| node_academic
node_learner -->|"practices tests"| node_assessment
node_learner -.->|"tracks development"| node_learnerdev
node_reporting -.->|"reads records"| node_db
node_governance -.->|"supports oversight"| node_db
node_api -->|"serves data-backed routes"| node_db

click node_web "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/training-platform/src/App.tsx"
click node_native "https://github.com/cayelaemj/training-and-development-hub/blob/main/native-apps/android/app/src/main/java/za/co/cabosolutions/learninghub/MainActivity.kt"
click node_upload "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/storage.ts"
click node_exam "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/writtenExams.ts"
click node_assessment "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/assessmentQuestionBank.ts"
click node_academic "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/academic.ts"
click node_ai "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/lib/aiCompletion.ts"
click node_organizations "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/organizations.ts"
click node_admissions "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/admissions.ts"
click node_learnerdev "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/learnerJourney.ts"
click node_reporting "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/reportCards.ts"
click node_governance "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/lib/accountabilityPolicy.ts"
click node_api "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/app.ts"
click node_auth "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/middlewares/authMiddleware.ts"
click node_storage "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/lib/objectStorage.ts"
click node_acl "https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/lib/objectAcl.ts"
click node_db "https://github.com/cayelaemj/training-and-development-hub/blob/main/lib/db/src/schema/index.ts"
click node_examdata "https://github.com/cayelaemj/training-and-development-hub/blob/main/lib/db/src/schema/writtenExams.ts"
click node_orgdata "https://github.com/cayelaemj/training-and-development-hub/blob/main/lib/db/src/schema/organizations.ts"

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_native toneBlue
class node_upload,node_exam,node_assessment,node_academic toneAmber
class node_organizations,node_admissions,node_learnerdev,node_reporting,node_governance toneMint
class node_ai,node_api,node_auth,node_storage,node_acl toneRose
class node_db,node_examdata,node_orgdata,node_learner toneIndigo
```

## Components

### Learner experience

- [Web application](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/training-platform/src/App.tsx): `artifacts/training-platform/src/App.tsx`
- [Native clients](https://github.com/cayelaemj/training-and-development-hub/blob/main/native-apps/android/app/src/main/java/za/co/cabosolutions/learninghub/MainActivity.kt): `native-apps/android/app/src/main/java/za/co/cabosolutions/learninghub/MainActivity.kt`

### Learning and assessment

- [Study materials](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/storage.ts): `artifacts/api-server/src/routes/storage.ts`
- [Written examinations](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/writtenExams.ts): `artifacts/api-server/src/routes/writtenExams.ts`
- [Question bank and assessments](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/assessmentQuestionBank.ts): `artifacts/api-server/src/routes/assessmentQuestionBank.ts`
- [Academics and gradebook](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/academic.ts): `artifacts/api-server/src/routes/academic.ts`

### Institutional operations

- [Organization workspaces](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/organizations.ts): `artifacts/api-server/src/routes/organizations.ts`
- [Admissions](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/admissions.ts): `artifacts/api-server/src/routes/admissions.ts`
- [Learner development and passport](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/learnerJourney.ts): `artifacts/api-server/src/routes/learnerJourney.ts`
- [Reports and issuance](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/routes/reportCards.ts): `artifacts/api-server/src/routes/reportCards.ts`
- [Governance and accountability](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/lib/accountabilityPolicy.ts): `artifacts/api-server/src/lib/accountabilityPolicy.ts`

### API and services

- [AI completion and credits](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/lib/aiCompletion.ts): `artifacts/api-server/src/lib/aiCompletion.ts`
- [Express API](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/app.ts): `artifacts/api-server/src/app.ts`
- [Authentication middleware](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/middlewares/authMiddleware.ts): `artifacts/api-server/src/middlewares/authMiddleware.ts`
- [Object storage service](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/lib/objectStorage.ts): `artifacts/api-server/src/lib/objectStorage.ts`
- [Object access policy](https://github.com/cayelaemj/training-and-development-hub/blob/main/artifacts/api-server/src/lib/objectAcl.ts): `artifacts/api-server/src/lib/objectAcl.ts`

### Persistence

- [PostgreSQL schema](https://github.com/cayelaemj/training-and-development-hub/blob/main/lib/db/src/schema/index.ts): `lib/db/src/schema/index.ts`
- [Exam records](https://github.com/cayelaemj/training-and-development-hub/blob/main/lib/db/src/schema/writtenExams.ts): `lib/db/src/schema/writtenExams.ts`
- [Organization records](https://github.com/cayelaemj/training-and-development-hub/blob/main/lib/db/src/schema/organizations.ts): `lib/db/src/schema/organizations.ts`

### Other components

- **Learner or staff**

## Connections

- Learner or staff → Web application: uses (evidence: `README.md`)
- Learner or staff → Native clients: uses
- Web application → Express API: requests services
- Native clients → Express API: calls endpoints
- Express API → Authentication middleware: applies middleware (evidence: `artifacts/api-server/src/app.ts`)
- Express API → Study materials: routes requests
- Study materials → Object storage service: stores private blobs (evidence: `artifacts/api-server/src/routes/storage.ts`)
- Object storage service → Object access policy: checks access (evidence: `artifacts/api-server/src/lib/objectStorage.ts`)
- Learner or staff → Study materials: uploads notes (evidence: `README.md`)
- Learner or staff → Written examinations: generates and submits (evidence: `README.md`)
- Written examinations → AI completion and credits: uses AI marking
- Written examinations → Exam records: persists attempts (evidence: `README.md`)
- Organization workspaces → Organization records: stores workspaces (evidence: `README.md`)
- Organization workspaces → Written examinations: assigns exams (evidence: `README.md`)
- Learner or staff → Academics and gradebook: records progress
- Learner or staff → Question bank and assessments: practices tests (evidence: `README.md`)
- Learner or staff → Learner development and passport: tracks development
- Reports and issuance → PostgreSQL schema: reads records
- Governance and accountability → PostgreSQL schema: supports oversight
- Express API → PostgreSQL schema: serves data-backed routes (evidence: `README.md`)
