# techandguard/smartbridge-correction architecture

> Architecture diagram of the GitHub repository techandguard/smartbridge-correction, 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/techandguard/smartbridge-correction
- Repository: https://github.com/techandguard/smartbridge-correction

## Overview

SmartBridge FET is a CAPS-aligned learning and tutoring platform for South African Grades 10–12 students. Users enter through the routed React app, authenticate and complete onboarding, then use learning resources, quizzes, progress tools, tutor services, and opportunity discovery; role-specific dashboards support parents, counselors, tutors, and administrators. Supabase provides auth and application data, while edge functions cover asynchronous and AI-assisted capabilities. The graph reflects documented capabilities and indexed references; several feature-level links are intentionally omitted because their implementation was not sampled.

Main entry points: [`src/App.jsx`](https://github.com/techandguard/smartbridge-correction/blob/main/src/App.jsx) (Routes and guards), [`src/lib/supabaseClient.js`](https://github.com/techandguard/smartbridge-correction/blob/main/src/lib/supabaseClient.js) (Supabase services), [`src/pages/AdminDashboard.jsx`](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/AdminDashboard.jsx) (Admin dashboard), [`src/pages/ResourceSearch.jsx`](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/ResourceSearch.jsx) (Resource search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application entry"]
  node_app["Routes and guards<br/>[App.jsx]"]
  node_auth["Auth and profiles<br/>[AuthContext.jsx]"]
  node_layout["App shell<br/>[AppLayout.jsx]"]
  node_onboard["Onboarding<br/>[Onboarding.jsx]"]
end

subgraph group_learning["Learning tools"]
  node_subjects["CAPS subjects<br/>[subjects.js]"]
  node_student["Student dashboard"]
  node_resources["Resource search<br/>[ResourceSearch.jsx]"]
  node_quiz["Practice quizzes<br/>[PracticeQuiz.jsx]"]
  node_video["Video lessons<br/>[VideoLessons.jsx]"]
end

subgraph group_services["Platform services"]
  node_tutors["Tutor services<br/>[Tutors.jsx]"]
  node_bookings["Tutor bookings<br/>[Bookings.jsx]"]
  node_opportunities["Student opportunities"]
  node_community["Community forum<br/>[CommunityForum.jsx]"]
  node_parents["Parent dashboard"]
end

subgraph group_operations["Operations"]
  node_admin["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_capsadmin["CAPS administration<br/>[CAPSAdmin.jsx]"]
  node_knowledge["Knowledge resources"]
  node_contentreview["Opportunity review"]
  node_backend[("Supabase services<br/>[supabaseClient.js]")]
  node_functions["Edge functions"]
end

node_learner(("Students and tutors"))

node_learner -->|"uses"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"routes through"| node_layout
node_app -->|"routes to"| node_onboard
node_auth -->|"uses auth"| node_backend
node_app -->|"routes to"| node_student
node_app -->|"routes to"| node_resources
node_resources -->|"reads data"| node_backend
node_resources -->|"uses subject list"| node_subjects
node_app -->|"routes to"| node_quiz
node_app -->|"routes to"| node_video
node_app -->|"routes to"| node_tutors
node_app -->|"routes to"| node_bookings
node_app -->|"routes to"| node_opportunities
node_app -->|"routes to"| node_community
node_app -->|"routes to"| node_parents
node_app -->|"routes to"| node_admin
node_admin -->|"renders"| node_knowledge
node_admin -->|"renders"| node_contentreview
node_admin -->|"routes to"| node_capsadmin
node_knowledge -->|"manages resources"| node_backend
node_capsadmin -->|"manages documents"| node_backend
node_backend -.->|"invokes"| node_functions

click node_app "https://github.com/techandguard/smartbridge-correction/blob/main/src/App.jsx"
click node_auth "https://github.com/techandguard/smartbridge-correction/blob/main/src/lib/AuthContext.jsx"
click node_layout "https://github.com/techandguard/smartbridge-correction/blob/main/src/components/layout/AppLayout.jsx"
click node_onboard "https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/Onboarding.jsx"
click node_subjects "https://github.com/techandguard/smartbridge-correction/blob/main/src/lib/subjects.js"
click node_student "https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/StudentDashboard.jsx"
click node_resources "https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/ResourceSearch.jsx"
click node_quiz "https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/PracticeQuiz.jsx"
click node_video "https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/VideoLessons.jsx"
click node_tutors "https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/Tutors.jsx"
click node_bookings "https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/Bookings.jsx"
click node_opportunities "https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/StudentOpportunities.jsx"
click node_community "https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/CommunityForum.jsx"
click node_parents "https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/ParentDashboard.jsx"
click node_admin "https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/AdminDashboard.jsx"
click node_capsadmin "https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/CAPSAdmin.jsx"
click node_knowledge "https://github.com/techandguard/smartbridge-correction/blob/main/src/components/admin/KnowledgeBaseManager.jsx"
click node_contentreview "https://github.com/techandguard/smartbridge-correction/blob/main/src/components/admin/OpportunitiesContentReview.jsx"
click node_backend "https://github.com/techandguard/smartbridge-correction/blob/main/src/lib/supabaseClient.js"
click node_functions "https://github.com/techandguard/smartbridge-correction/tree/main/supabase-functions/functions"

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_auth,node_layout,node_onboard toneBlue
class node_subjects,node_student,node_resources,node_quiz,node_video toneAmber
class node_tutors,node_bookings,node_opportunities,node_community,node_parents toneMint
class node_admin,node_capsadmin,node_knowledge,node_contentreview,node_backend,node_functions toneRose
class node_learner toneIndigo
```

## Components

### Application entry

- [Routes and guards](https://github.com/techandguard/smartbridge-correction/blob/main/src/App.jsx): `src/App.jsx`
- [Auth and profiles](https://github.com/techandguard/smartbridge-correction/blob/main/src/lib/AuthContext.jsx): `src/lib/AuthContext.jsx`
- [App shell](https://github.com/techandguard/smartbridge-correction/blob/main/src/components/layout/AppLayout.jsx): `src/components/layout/AppLayout.jsx`
- [Onboarding](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/Onboarding.jsx): `src/pages/Onboarding.jsx`

### Learning tools

- [CAPS subjects](https://github.com/techandguard/smartbridge-correction/blob/main/src/lib/subjects.js): `src/lib/subjects.js`
- [Student dashboard](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/StudentDashboard.jsx): `src/pages/StudentDashboard.jsx`
- [Resource search](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/ResourceSearch.jsx): `src/pages/ResourceSearch.jsx`
- [Practice quizzes](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/PracticeQuiz.jsx): `src/pages/PracticeQuiz.jsx`
- [Video lessons](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/VideoLessons.jsx): `src/pages/VideoLessons.jsx`

### Platform services

- [Tutor services](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/Tutors.jsx): `src/pages/Tutors.jsx`
- [Tutor bookings](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/Bookings.jsx): `src/pages/Bookings.jsx`
- [Student opportunities](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/StudentOpportunities.jsx): `src/pages/StudentOpportunities.jsx`
- [Community forum](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/CommunityForum.jsx): `src/pages/CommunityForum.jsx`
- [Parent dashboard](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/ParentDashboard.jsx): `src/pages/ParentDashboard.jsx`

### Operations

- [Admin dashboard](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/AdminDashboard.jsx): `src/pages/AdminDashboard.jsx`
- [CAPS administration](https://github.com/techandguard/smartbridge-correction/blob/main/src/pages/CAPSAdmin.jsx): `src/pages/CAPSAdmin.jsx`
- [Knowledge resources](https://github.com/techandguard/smartbridge-correction/blob/main/src/components/admin/KnowledgeBaseManager.jsx): `src/components/admin/KnowledgeBaseManager.jsx`
- [Opportunity review](https://github.com/techandguard/smartbridge-correction/blob/main/src/components/admin/OpportunitiesContentReview.jsx): `src/components/admin/OpportunitiesContentReview.jsx`
- [Supabase services](https://github.com/techandguard/smartbridge-correction/blob/main/src/lib/supabaseClient.js): `src/lib/supabaseClient.js`
- [Edge functions](https://github.com/techandguard/smartbridge-correction/tree/main/supabase-functions/functions): `supabase-functions/functions`

### Other components

- **Students and tutors**

## Connections

- Students and tutors → Routes and guards: uses
- Routes and guards → Auth and profiles: provides auth (evidence: `src/App.jsx`)
- Routes and guards → App shell: routes through (evidence: `src/App.jsx`)
- Routes and guards → Onboarding: routes to (evidence: `src/App.jsx`)
- Auth and profiles → Supabase services: uses auth (evidence: `src/lib/AuthContext.jsx`)
- Routes and guards → Student dashboard: routes to (evidence: `src/App.jsx`)
- Routes and guards → Resource search: routes to (evidence: `src/App.jsx`)
- Resource search → Supabase services: reads data (evidence: `src/pages/ResourceSearch.jsx`)
- Resource search → CAPS subjects: uses subject list (evidence: `src/pages/ResourceSearch.jsx`)
- Routes and guards → Practice quizzes: routes to (evidence: `src/App.jsx`)
- Routes and guards → Video lessons: routes to (evidence: `src/App.jsx`)
- Routes and guards → Tutor services: routes to (evidence: `src/App.jsx`)
- Routes and guards → Tutor bookings: routes to (evidence: `src/App.jsx`)
- Routes and guards → Student opportunities: routes to (evidence: `src/App.jsx`)
- Routes and guards → Community forum: routes to (evidence: `src/App.jsx`)
- Routes and guards → Parent dashboard: routes to (evidence: `src/App.jsx`)
- Routes and guards → Admin dashboard: routes to (evidence: `src/App.jsx`)
- Admin dashboard → Knowledge resources: renders (evidence: `src/pages/AdminDashboard.jsx`)
- Admin dashboard → Opportunity review: renders (evidence: `src/pages/AdminDashboard.jsx`)
- Admin dashboard → CAPS administration: routes to (evidence: `src/App.jsx`)
- Knowledge resources → Supabase services: manages resources (evidence: `src/components/admin/KnowledgeBaseManager.jsx`)
- CAPS administration → Supabase services: manages documents (evidence: `src/pages/CAPSAdmin.jsx`)
- Supabase services → Edge functions: invokes
