# a-blessingtheanalyst/bgap-academy architecture

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

- Interactive diagram: https://gitdiagram.com/a-blessingtheanalyst/bgap-academy
- Repository: https://github.com/a-blessingtheanalyst/bgap-academy

## Overview

BGAP is a multi-role learning and workforce platform: learners practice analytics, receive feedback, build skills and portfolios, while instructors, organisations, HR teams and platform admins manage learning and assessments. The README documents these distinct user-facing capabilities; sampled code confirms selected API, AI, authentication and persistence paths. Source excerpts are partial, so the graph omits unverified links between most product screens and API routes.

Main entry points: [`frontend/app/(students)`](https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(students)) (Learner portal), [`frontend/app/api/branching/route.js`](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/app/api/branching/route.js) (Branching scenarios), [`backend/src/controllers/certpathController.js`](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/controllers/certpathController.js) (CertPath controller), [`frontend/app/api/challenge-context/route.js`](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/app/api/challenge-context/route.js) (Challenge Lab)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learn["Learner experience"]
  node_learner["Learner portal"]
  node_challenge["Challenge Lab<br/>[route.js]"]
  node_workspace["Analyst workspace"]
  node_portfolio["Portfolio builder"]
end

subgraph group_assess["Practice and assessment"]
  node_scenario["Branching scenarios<br/>[route.js]"]
  node_feedback["AI feedback<br/>[route.js]"]
  node_certpath["Certification prep"]
  node_certcoach["CertPath AI coach"]
  node_certpractice["CertPath practice and exams<br/>[route.js]"]
end

subgraph group_manage["Teaching and administration"]
  node_instructor["Instructor portal"]
  node_observer["Class Observer"]
  node_intelligence["Learning intelligence<br/>[route.js]"]
  node_orgadmin["Company administration"]
  node_hr["HR assessments"]
  node_admin["Platform administration"]
end

subgraph group_platform["Platform services"]
  node_api["Backend API router<br/>[index.js]"]
  node_cert_routes["CertPath routes<br/>[certpath.routes.js]"]
  node_cert_controller["CertPath controller"]
  node_auth["Backend authentication<br/>[auth.js]"]
  node_groq["Groq client<br/>[groqClient.js]"]
  node_supabase[("Supabase store<br/>[supabase.js]")]
  node_ms_sync["Microsoft curriculum sync"]
  node_security["API security utilities<br/>[apiSecurity.js]"]
  node_market["Market prompt context<br/>[market-context.js]"]
  node_usage["AI usage limits<br/>[aiUsageLimits.js]"]
  node_plans["Plan configuration<br/>[planConfig.js]"]
end

node_actor(("Learners and candidates"))
node_educators(("Instructors and admins"))
node_hr_actor(("HR teams"))

node_actor -->|"use learning tools"| node_learner
node_educators -->|"manage learning"| node_instructor
node_educators -->|"manage cohorts"| node_orgadmin
node_educators -->|"administer platform"| node_admin
node_hr_actor -->|"manage assessments"| node_hr
node_learner -->|"practice challenges"| node_challenge
node_learner -->|"work on tasks"| node_workspace
node_learner -->|"play scenarios"| node_scenario
node_learner -->|"get feedback"| node_feedback
node_learner -->|"prepare certifications"| node_certpath
node_learner -->|"build portfolio"| node_portfolio
node_instructor -->|"generate class quizzes"| node_observer
node_instructor -->|"analyze cohorts"| node_intelligence
node_api -->|"mounts routes"| node_cert_routes
node_cert_routes -->|"routes requests"| node_cert_controller
node_cert_routes -->|"authenticates requests"| node_auth
node_cert_controller -->|"generates AI content"| node_groq
node_cert_controller -->|"reads and writes"| node_supabase
node_cert_controller -->|"triggers curriculum sync"| node_ms_sync
node_challenge -->|"authenticates requests"| node_security
node_challenge -->|"builds prompt context"| node_market
node_scenario -->|"authenticates requests"| node_security
node_scenario -->|"builds prompt context"| node_market
node_scenario -->|"checks and logs usage"| node_usage
node_scenario -->|"checks plan limits"| node_plans
node_feedback -->|"authenticates requests"| node_security
node_feedback -->|"checks and logs usage"| node_usage
node_certpath -->|"offers coaching"| node_certcoach
node_certpath -->|"offers practice"| node_certpractice
node_certpath -->|"served by"| node_cert_controller

click node_learner "https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(students)"
click node_challenge "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/app/api/challenge-context/route.js"
click node_workspace "https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(students)/branching/play"
click node_scenario "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/app/api/branching/route.js"
click node_feedback "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/app/api/feedback/route.js"
click node_certpath "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/controllers/certpathController.js"
click node_certcoach "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/controllers/certpathController.js"
click node_certpractice "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/app/api/certpath/practice/route.js"
click node_instructor "https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(teach)"
click node_observer "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/lib/observerLectureNotes.js"
click node_intelligence "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/app/api/intelligence/route.js"
click node_orgadmin "https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(teams)/company-admin"
click node_hr "https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(hr)"
click node_admin "https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(admin)/admin"
click node_portfolio "https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(students)/portfolio"
click node_api "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/routes/index.js"
click node_cert_routes "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/routes/certpath.routes.js"
click node_cert_controller "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/controllers/certpathController.js"
click node_auth "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/middleware/auth.js"
click node_groq "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/config/groqClient.js"
click node_supabase "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/config/supabase.js"
click node_ms_sync "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/services/microsoftSyncService.js"
click node_security "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/lib/apiSecurity.js"
click node_market "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/lib/market-context.js"
click node_usage "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/lib/aiUsageLimits.js"
click node_plans "https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/lib/planConfig.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_learner,node_challenge,node_workspace,node_portfolio toneBlue
class node_scenario,node_feedback,node_certpath,node_certcoach,node_certpractice toneAmber
class node_instructor,node_observer,node_intelligence,node_orgadmin,node_hr,node_admin toneMint
class node_api,node_cert_routes,node_cert_controller,node_auth,node_groq,node_supabase,node_ms_sync,node_security,node_market,node_usage,node_plans toneRose
class node_actor,node_educators,node_hr_actor toneIndigo
```

## Components

### Learner experience

- [Learner portal](https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(students)): `frontend/app/(students)`
- [Challenge Lab](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/app/api/challenge-context/route.js): `frontend/app/api/challenge-context/route.js`
- [Analyst workspace](https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(students)/branching/play): `frontend/app/(students)/branching/play`
- [Portfolio builder](https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(students)/portfolio): `frontend/app/(students)/portfolio`

### Practice and assessment

- [Branching scenarios](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/app/api/branching/route.js): `frontend/app/api/branching/route.js`
- [AI feedback](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/app/api/feedback/route.js): `frontend/app/api/feedback/route.js`
- [Certification prep](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/controllers/certpathController.js): `backend/src/controllers/certpathController.js`
- [CertPath AI coach](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/controllers/certpathController.js): `backend/src/controllers/certpathController.js`
- [CertPath practice and exams](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/app/api/certpath/practice/route.js): `frontend/app/api/certpath/practice/route.js`

### Teaching and administration

- [Instructor portal](https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(teach)): `frontend/app/(teach)`
- [Class Observer](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/lib/observerLectureNotes.js): `frontend/lib/observerLectureNotes.js`
- [Learning intelligence](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/app/api/intelligence/route.js): `frontend/app/api/intelligence/route.js`
- [Company administration](https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(teams)/company-admin): `frontend/app/(teams)/company-admin`
- [HR assessments](https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(hr)): `frontend/app/(hr)`
- [Platform administration](https://github.com/a-blessingtheanalyst/bgap-academy/tree/main/frontend/app/(admin)/admin): `frontend/app/(admin)/admin`

### Platform services

- [Backend API router](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/routes/index.js): `backend/src/routes/index.js`
- [CertPath routes](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/routes/certpath.routes.js): `backend/src/routes/certpath.routes.js`
- [CertPath controller](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/controllers/certpathController.js): `backend/src/controllers/certpathController.js`
- [Backend authentication](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`
- [Groq client](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/config/groqClient.js): `backend/src/config/groqClient.js`
- [Supabase store](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/config/supabase.js): `backend/src/config/supabase.js`
- [Microsoft curriculum sync](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/backend/src/services/microsoftSyncService.js): `backend/src/services/microsoftSyncService.js`
- [API security utilities](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/lib/apiSecurity.js): `frontend/lib/apiSecurity.js`
- [Market prompt context](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/lib/market-context.js): `frontend/lib/market-context.js`
- [AI usage limits](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/lib/aiUsageLimits.js): `frontend/lib/aiUsageLimits.js`
- [Plan configuration](https://github.com/a-blessingtheanalyst/bgap-academy/blob/main/frontend/lib/planConfig.js): `frontend/lib/planConfig.js`

### Other components

- **Learners and candidates**
- **Instructors and admins**
- **HR teams**

## Connections

- Learners and candidates → Learner portal: use learning tools (evidence: `README.md`)
- Instructors and admins → Instructor portal: manage learning (evidence: `README.md`)
- Instructors and admins → Company administration: manage cohorts (evidence: `README.md`)
- Instructors and admins → Platform administration: administer platform (evidence: `README.md`)
- HR teams → HR assessments: manage assessments (evidence: `README.md`)
- Learner portal → Challenge Lab: practice challenges (evidence: `README.md`)
- Learner portal → Analyst workspace: work on tasks (evidence: `README.md`)
- Learner portal → Branching scenarios: play scenarios (evidence: `README.md`)
- Learner portal → AI feedback: get feedback (evidence: `README.md`)
- Learner portal → Certification prep: prepare certifications (evidence: `README.md`)
- Learner portal → Portfolio builder: build portfolio (evidence: `README.md`)
- Instructor portal → Class Observer: generate class quizzes (evidence: `README.md`)
- Instructor portal → Learning intelligence: analyze cohorts (evidence: `README.md`)
- Backend API router → CertPath routes: mounts routes (evidence: `backend/src/routes/index.js`)
- CertPath routes → CertPath controller: routes requests (evidence: `backend/src/routes/certpath.routes.js`)
- CertPath routes → Backend authentication: authenticates requests (evidence: `backend/src/routes/certpath.routes.js`)
- CertPath controller → Groq client: generates AI content (evidence: `backend/src/controllers/certpathController.js`)
- CertPath controller → Supabase store: reads and writes (evidence: `backend/src/controllers/certpathController.js`)
- CertPath controller → Microsoft curriculum sync: triggers curriculum sync (evidence: `backend/src/controllers/certpathController.js`)
- Challenge Lab → API security utilities: authenticates requests (evidence: `frontend/app/api/challenge-context/route.js`)
- Challenge Lab → Market prompt context: builds prompt context (evidence: `frontend/app/api/challenge-context/route.js`)
- Branching scenarios → API security utilities: authenticates requests (evidence: `frontend/app/api/branching/route.js`)
- Branching scenarios → Market prompt context: builds prompt context (evidence: `frontend/app/api/branching/route.js`)
- Branching scenarios → AI usage limits: checks and logs usage (evidence: `frontend/app/api/branching/route.js`)
- Branching scenarios → Plan configuration: checks plan limits (evidence: `frontend/app/api/branching/route.js`)
- AI feedback → API security utilities: authenticates requests (evidence: `frontend/app/api/feedback/route.js`)
- AI feedback → AI usage limits: checks and logs usage (evidence: `frontend/app/api/feedback/route.js`)
- Certification prep → CertPath AI coach: offers coaching (evidence: `backend/src/routes/certpath.routes.js`)
- Certification prep → CertPath practice and exams: offers practice
- Certification prep → CertPath controller: served by (evidence: `backend/src/routes/certpath.routes.js`)
