# rajeevshivah/learn-portal architecture

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

- Interactive diagram: https://gitdiagram.com/rajeevshivah/learn-portal
- Repository: https://github.com/rajeevshivah/learn-portal

## Overview

Learn Portal is a learning and community platform with courses, episodes, paid access, live events, and a personalized technology feed. Learners enter through the web app, authenticate, browse learning or event offerings, and access content according to enrollment or registration status; administrators manage offerings and approvals. The backend also exposes an MCP interface for phone/web tools. The README documents event registration, paid-event approval gating, and publishing recordings as episodes. Some route and page implementations were not sampled, so their internal relationships are not expanded.

Main entry points: [`backend/routes/events.js`](https://github.com/rajeevshivah/learn-portal/blob/main/backend/routes/events.js) (Event workflows), [`frontend/src/App.jsx`](https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/App.jsx) (Web app routes), [`backend/server.js`](https://github.com/rajeevshivah/learn-portal/blob/main/backend/server.js) (API route mounting), [`backend/routes/tech.js`](https://github.com/rajeevshivah/learn-portal/blob/main/backend/routes/tech.js) (Tech feed API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Web app routes<br/>[App.jsx]"]
  node_authui["Sign-in state<br/>[AuthContext.jsx]"]
end

subgraph group_learning["Learning platform"]
  node_courseui["Course and episode pages<br/>[CourseEpisodes.jsx]"]
  node_refundui["Refund information<br/>[RefundPolicy.jsx]"]
  node_courseapi["Course and episode APIs<br/>[courses.js]"]
  node_coursemodel[("Courses<br/>[Course.js]")]
  node_episodemodel[("Episodes<br/>[Episode.js]")]
  node_enrollments[("Enrollment access<br/>[Enrollment.js]")]
end

subgraph group_events["Live events"]
  node_eventui["Event pages<br/>[EventDetail.jsx]"]
  node_eventadmin["Event administration<br/>[EventsTab.jsx]"]
  node_eventapi["Event workflows<br/>[events.js]"]
  node_eventmodel[("Live events<br/>[LiveEvent.js]")]
  node_registrations[("Registrations<br/>[Registration.js]")]
  node_pricing["Pricing and coupons<br/>[pricing.js]"]
end

subgraph group_community["Community and discovery"]
  node_techui["Tech discovery<br/>[Tech.jsx]"]
  node_techapi["Tech feed API<br/>[tech.js]"]
  node_techfeed["Feed aggregation<br/>[techFeed.js]"]
  node_techitems[("Feed items<br/>[TechItem.js]")]
  node_doubts["Discussion workflows<br/>[questions.js]"]
end

subgraph group_platform["Platform services"]
  node_api["API route mounting<br/>[server.js]"]
  node_authapi["Authentication<br/>[auth.js]"]
  node_authmw["Request authorization<br/>[auth.js]"]
  node_users[("User accounts<br/>[User.js]")]
  node_settings[("Platform settings<br/>[Settings.js]")]
  node_mcp["MCP tools<br/>[tools.mjs]"]
  node_mcphttp["MCP HTTP adapter<br/>[http.js]"]
end

node_learner(("Learner"))
node_admin(("Administrator"))

node_learner -->|"uses"| node_webapp
node_admin -->|"uses"| node_webapp
node_webapp -->|"wraps routes"| node_authui
node_webapp -->|"routes to"| node_eventui
node_webapp -->|"routes to"| node_courseui
node_webapp -->|"routes to"| node_refundui
node_authapi -->|"reads and updates"| node_users
node_authmw -->|"loads account"| node_users
node_api -->|"mounts"| node_authapi
node_api -->|"mounts"| node_eventapi
node_api -->|"mounts"| node_techapi
node_api -->|"mounts"| node_doubts
node_courseapi -->|"uses"| node_coursemodel
node_courseapi -->|"uses"| node_episodemodel
node_courseapi -.->|"uses"| node_enrollments
node_eventapi -->|"reads and writes"| node_eventmodel
node_eventapi -->|"reads and writes"| node_registrations
node_eventapi -->|"validates course"| node_coursemodel
node_eventapi -->|"publishes recording"| node_episodemodel
node_eventapi -->|"reads payment details"| node_settings
node_eventapi -->|"delegates pricing"| node_pricing
node_eventui -.->|"uses event API"| node_eventapi
node_eventadmin -.->|"manages events"| node_eventapi
node_techapi -->|"uses feed"| node_techfeed
node_techapi -->|"reads and writes"| node_techitems
node_techapi -->|"uses profiles"| node_users
node_techui -.->|"uses tech API"| node_techapi
node_mcphttp -->|"dispatches tools"| node_mcp
node_api -->|"mounts"| node_mcphttp

click node_webapp "https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/context/AuthContext.jsx"
click node_courseui "https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/pages/CourseEpisodes.jsx"
click node_refundui "https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/pages/RefundPolicy.jsx"
click node_courseapi "https://github.com/rajeevshivah/learn-portal/blob/main/backend/routes/courses.js"
click node_coursemodel "https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/Course.js"
click node_episodemodel "https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/Episode.js"
click node_enrollments "https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/Enrollment.js"
click node_eventui "https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/pages/EventDetail.jsx"
click node_eventadmin "https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/pages/admin/EventsTab.jsx"
click node_eventapi "https://github.com/rajeevshivah/learn-portal/blob/main/backend/routes/events.js"
click node_eventmodel "https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/LiveEvent.js"
click node_registrations "https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/Registration.js"
click node_pricing "https://github.com/rajeevshivah/learn-portal/blob/main/backend/utils/pricing.js"
click node_techui "https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/pages/Tech.jsx"
click node_techapi "https://github.com/rajeevshivah/learn-portal/blob/main/backend/routes/tech.js"
click node_techfeed "https://github.com/rajeevshivah/learn-portal/blob/main/backend/utils/techFeed.js"
click node_techitems "https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/TechItem.js"
click node_doubts "https://github.com/rajeevshivah/learn-portal/blob/main/backend/routes/questions.js"
click node_api "https://github.com/rajeevshivah/learn-portal/blob/main/backend/server.js"
click node_authapi "https://github.com/rajeevshivah/learn-portal/blob/main/backend/routes/auth.js"
click node_authmw "https://github.com/rajeevshivah/learn-portal/blob/main/backend/middleware/auth.js"
click node_users "https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/User.js"
click node_settings "https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/Settings.js"
click node_mcp "https://github.com/rajeevshivah/learn-portal/blob/main/backend/mcp/tools.mjs"
click node_mcphttp "https://github.com/rajeevshivah/learn-portal/blob/main/backend/mcp/http.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_webapp,node_authui toneBlue
class node_courseui,node_refundui,node_courseapi,node_coursemodel,node_episodemodel,node_enrollments toneAmber
class node_eventui,node_eventadmin,node_eventapi,node_eventmodel,node_registrations,node_pricing toneMint
class node_techui,node_techapi,node_techfeed,node_techitems,node_doubts toneRose
class node_api,node_authapi,node_authmw,node_users,node_settings,node_mcp,node_mcphttp,node_learner,node_admin toneIndigo
```

## Components

### Web experience

- [Web app routes](https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign-in state](https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`

### Learning platform

- [Course and episode pages](https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/pages/CourseEpisodes.jsx): `frontend/src/pages/CourseEpisodes.jsx`
- [Refund information](https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/pages/RefundPolicy.jsx): `frontend/src/pages/RefundPolicy.jsx`
- [Course and episode APIs](https://github.com/rajeevshivah/learn-portal/blob/main/backend/routes/courses.js): `backend/routes/courses.js`
- [Courses](https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/Course.js): `backend/models/Course.js`
- [Episodes](https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/Episode.js): `backend/models/Episode.js`
- [Enrollment access](https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/Enrollment.js): `backend/models/Enrollment.js`

### Live events

- [Event pages](https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/pages/EventDetail.jsx): `frontend/src/pages/EventDetail.jsx`
- [Event administration](https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/pages/admin/EventsTab.jsx): `frontend/src/pages/admin/EventsTab.jsx`
- [Event workflows](https://github.com/rajeevshivah/learn-portal/blob/main/backend/routes/events.js): `backend/routes/events.js`
- [Live events](https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/LiveEvent.js): `backend/models/LiveEvent.js`
- [Registrations](https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/Registration.js): `backend/models/Registration.js`
- [Pricing and coupons](https://github.com/rajeevshivah/learn-portal/blob/main/backend/utils/pricing.js): `backend/utils/pricing.js`

### Community and discovery

- [Tech discovery](https://github.com/rajeevshivah/learn-portal/blob/main/frontend/src/pages/Tech.jsx): `frontend/src/pages/Tech.jsx`
- [Tech feed API](https://github.com/rajeevshivah/learn-portal/blob/main/backend/routes/tech.js): `backend/routes/tech.js`
- [Feed aggregation](https://github.com/rajeevshivah/learn-portal/blob/main/backend/utils/techFeed.js): `backend/utils/techFeed.js`
- [Feed items](https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/TechItem.js): `backend/models/TechItem.js`
- [Discussion workflows](https://github.com/rajeevshivah/learn-portal/blob/main/backend/routes/questions.js): `backend/routes/questions.js`

### Platform services

- [API route mounting](https://github.com/rajeevshivah/learn-portal/blob/main/backend/server.js): `backend/server.js`
- [Authentication](https://github.com/rajeevshivah/learn-portal/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Request authorization](https://github.com/rajeevshivah/learn-portal/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`
- [User accounts](https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/User.js): `backend/models/User.js`
- [Platform settings](https://github.com/rajeevshivah/learn-portal/blob/main/backend/models/Settings.js): `backend/models/Settings.js`
- [MCP tools](https://github.com/rajeevshivah/learn-portal/blob/main/backend/mcp/tools.mjs): `backend/mcp/tools.mjs`
- [MCP HTTP adapter](https://github.com/rajeevshivah/learn-portal/blob/main/backend/mcp/http.js): `backend/mcp/http.js`

### Other components

- **Learner**
- **Administrator**

## Connections

- Learner → Web app routes: uses (evidence: `frontend/src/App.jsx`)
- Administrator → Web app routes: uses (evidence: `frontend/src/App.jsx`)
- Web app routes → Sign-in state: wraps routes (evidence: `frontend/src/App.jsx`)
- Web app routes → Event pages: routes to (evidence: `frontend/src/App.jsx`)
- Web app routes → Course and episode pages: routes to (evidence: `frontend/src/App.jsx`)
- Web app routes → Refund information: routes to (evidence: `frontend/src/App.jsx`)
- Authentication → User accounts: reads and updates (evidence: `backend/routes/auth.js`)
- Request authorization → User accounts: loads account (evidence: `backend/middleware/auth.js`)
- API route mounting → Authentication: mounts (evidence: `backend/server.js`)
- API route mounting → Event workflows: mounts (evidence: `backend/server.js`)
- API route mounting → Tech feed API: mounts (evidence: `backend/server.js`)
- API route mounting → Discussion workflows: mounts (evidence: `backend/server.js`)
- Course and episode APIs → Courses: uses
- Course and episode APIs → Episodes: uses
- Course and episode APIs → Enrollment access: uses
- Event workflows → Live events: reads and writes (evidence: `backend/routes/events.js`)
- Event workflows → Registrations: reads and writes (evidence: `backend/routes/events.js`)
- Event workflows → Courses: validates course (evidence: `backend/routes/events.js`)
- Event workflows → Episodes: publishes recording (evidence: `backend/routes/events.js`)
- Event workflows → Platform settings: reads payment details (evidence: `backend/routes/events.js`)
- Event workflows → Pricing and coupons: delegates pricing (evidence: `backend/routes/events.js`)
- Event pages → Event workflows: uses event API
- Event administration → Event workflows: manages events
- Tech feed API → Feed aggregation: uses feed (evidence: `backend/routes/tech.js`)
- Tech feed API → Feed items: reads and writes (evidence: `backend/routes/tech.js`)
- Tech feed API → User accounts: uses profiles (evidence: `backend/routes/tech.js`)
- Tech discovery → Tech feed API: uses tech API
- MCP HTTP adapter → MCP tools: dispatches tools (evidence: `backend/mcp/http.js`)
- API route mounting → MCP HTTP adapter: mounts (evidence: `backend/server.js`)
