# egbusonemmanuel/med-distinction-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/egbusonemmanuel/med-distinction-frontend
- Repository: https://github.com/egbusonemmanuel/med-distinction-frontend

## Overview

MedLearn is a medical-learning web app. Learners enter through the landing and sign-in experience, then use protected dashboard and study areas; paid and admin access is gated in the app router. The documented product also includes competitions, leaderboards, subscriptions, a digital library, and administrative content management. The sampled frontend shows Supabase authentication and a separate HTTP API helper for leaderboard, groups, AI, and library operations. Backend coverage is limited: the tree contains a library route, but its callers and server wiring are not established by the excerpts.

Main entry points: [`src/App.jsx`](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/App.jsx) (Route and access), [`src/supabaseClient.js`](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/supabaseClient.js) (Supabase client), [`src/components/Dashboard.jsx`](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/components/Dashboard.jsx) (Learner dashboard), [`src/lib/api.js`](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/lib/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and access"]
  node_app["Route and access<br/>[App.jsx]"]
  node_landing["Landing page<br/>[Landing.jsx]"]
  node_auth["Sign-in<br/>[Auth.jsx]"]
  node_callback["OAuth callback<br/>[AuthCallback.jsx]"]
end

subgraph group_learning["Learning experience"]
  node_dashboard["Learner dashboard<br/>[Dashboard.jsx]"]
  node_quizzes["Quizzes<br/>[Quizzes.jsx]"]
  node_flashcards["Flashcards<br/>[Flashcards.jsx]"]
  node_courses["Courses<br/>[Courses.jsx]"]
  node_library["Digital library<br/>[Library.jsx]"]
  node_competitions["Competitions<br/>[Competitions.jsx]"]
end

subgraph group_management["Progress and management"]
  node_leaderboard["Leaderboard<br/>[Leaderboard.jsx]"]
  node_subscriptions["Subscriptions<br/>[Subscriptions.jsx]"]
  node_adminpage["Admin page<br/>[AdminPage.jsx]"]
  node_adminpanel["Admin panel<br/>[AdminPanel.jsx]"]
end

subgraph group_services["Data and integrations"]
  node_api["API client<br/>[api.js]"]
  node_supabase["Supabase client<br/>[supabaseClient.js]"]
  node_supastorage[("Supabase service")]
  node_httpapi["HTTP API"]
  node_libraryroute["Library route<br/>[library.js]"]
end

node_learner(("Learner"))

node_learner -->|"opens"| node_app
node_app -->|"routes to"| node_landing
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_callback
node_app -->|"protects"| node_dashboard
node_app -->|"protects"| node_quizzes
node_app -->|"protects"| node_flashcards
node_app -->|"gates access"| node_library
node_app -->|"gates access"| node_courses
node_app -->|"gates access"| node_subscriptions
node_app -->|"admin routes"| node_adminpage
node_app -->|"admin routes"| node_adminpanel
node_auth -->|"authenticates"| node_supabase
node_callback -->|"sets session"| node_supabase
node_supabase -->|"connects to"| node_supastorage
node_dashboard -->|"reads session"| node_supabase
node_dashboard -->|"fetches profile"| node_api
node_api -->|"requests data"| node_httpapi
node_library -.->|"uses library API"| node_api
node_httpapi -.->|"may serve library"| node_libraryroute

click node_app "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/App.jsx"
click node_landing "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Landing.jsx"
click node_auth "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Auth.jsx"
click node_callback "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/AuthCallback.jsx"
click node_dashboard "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/components/Dashboard.jsx"
click node_quizzes "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Quizzes.jsx"
click node_flashcards "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Flashcards.jsx"
click node_courses "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Courses.jsx"
click node_library "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Library.jsx"
click node_competitions "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Competitions.jsx"
click node_leaderboard "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Leaderboard.jsx"
click node_subscriptions "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Subscriptions.jsx"
click node_adminpage "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/AdminPage.jsx"
click node_adminpanel "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/AdminPanel.jsx"
click node_api "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/lib/api.js"
click node_supabase "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/supabaseClient.js"
click node_libraryroute "https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/backend/routes/library.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_landing,node_auth,node_callback toneBlue
class node_dashboard,node_quizzes,node_flashcards,node_courses,node_library,node_competitions toneAmber
class node_leaderboard,node_subscriptions,node_adminpage,node_adminpanel toneMint
class node_api,node_supabase,node_supastorage,node_httpapi,node_libraryroute toneRose
class node_learner toneIndigo
```

## Components

### App and access

- [Route and access](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/App.jsx): `src/App.jsx`
- [Landing page](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Landing.jsx): `src/pages/Landing.jsx`
- [Sign-in](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Auth.jsx): `src/pages/Auth.jsx`
- [OAuth callback](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/AuthCallback.jsx): `src/pages/AuthCallback.jsx`

### Learning experience

- [Learner dashboard](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/components/Dashboard.jsx): `src/components/Dashboard.jsx`
- [Quizzes](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Quizzes.jsx): `src/pages/Quizzes.jsx`
- [Flashcards](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Flashcards.jsx): `src/pages/Flashcards.jsx`
- [Courses](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Courses.jsx): `src/pages/Courses.jsx`
- [Digital library](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Library.jsx): `src/pages/Library.jsx`
- [Competitions](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Competitions.jsx): `src/pages/Competitions.jsx`

### Progress and management

- [Leaderboard](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Leaderboard.jsx): `src/pages/Leaderboard.jsx`
- [Subscriptions](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/Subscriptions.jsx): `src/pages/Subscriptions.jsx`
- [Admin page](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/AdminPage.jsx): `src/pages/AdminPage.jsx`
- [Admin panel](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/pages/AdminPanel.jsx): `src/pages/AdminPanel.jsx`

### Data and integrations

- [API client](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/lib/api.js): `src/lib/api.js`
- [Supabase client](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/supabaseClient.js): `src/supabaseClient.js`
- **Supabase service**
- **HTTP API**
- [Library route](https://github.com/egbusonemmanuel/med-distinction-frontend/blob/main/src/backend/routes/library.js): `src/backend/routes/library.js`

### Other components

- **Learner**

## Connections

- Learner → Route and access: opens (evidence: `README.md`)
- Route and access → Landing page: routes to (evidence: `src/App.jsx`)
- Route and access → Sign-in: routes to (evidence: `src/App.jsx`)
- Route and access → OAuth callback: routes to (evidence: `src/App.jsx`)
- Route and access → Learner dashboard: protects (evidence: `src/App.jsx`)
- Route and access → Quizzes: protects (evidence: `src/App.jsx`)
- Route and access → Flashcards: protects (evidence: `src/App.jsx`)
- Route and access → Digital library: gates access (evidence: `src/App.jsx`)
- Route and access → Courses: gates access (evidence: `src/App.jsx`)
- Route and access → Subscriptions: gates access (evidence: `src/App.jsx`)
- Route and access → Admin page: admin routes (evidence: `src/App.jsx`)
- Route and access → Admin panel: admin routes (evidence: `src/App.jsx`)
- Sign-in → Supabase client: authenticates (evidence: `src/pages/Auth.jsx`)
- OAuth callback → Supabase client: sets session (evidence: `src/pages/AuthCallback.jsx`)
- Supabase client → Supabase service: connects to (evidence: `src/supabaseClient.js`)
- Learner dashboard → Supabase client: reads session (evidence: `src/components/Dashboard.jsx`)
- Learner dashboard → API client: fetches profile (evidence: `src/components/Dashboard.jsx`)
- API client → HTTP API: requests data (evidence: `src/lib/api.js`)
- Digital library → API client: uses library API
- HTTP API → Library route: may serve library
