# alen-saji-05/elearn architecture

> Architecture diagram of the GitHub repository alen-saji-05/elearn, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alen-saji-05/elearn
- Repository: https://github.com/alen-saji-05/elearn

## Overview

LearnHub supports student learning, mentor course authoring, and administration. The principal journey is course discovery, enrollment/payment, then lesson access and progress; identity, chat, reviews, search, and notifications are supporting capabilities. Sampled frontend code establishes routing, auth API calls, and WebSocket use; sampled payment code establishes Stripe’s payment-to-enrollment flow. Other feature links reflect README capabilities and app boundaries, not inspected call wiring.

Main entry points: [`backend/apps/payments/services.py`](https://github.com/alen-saji-05/elearn/blob/main/backend/apps/payments/services.py) (Payment service), [`frontend/src/App.jsx`](https://github.com/alen-saji-05/elearn/blob/main/frontend/src/App.jsx) (App routing), [`frontend/src/api/axios.js`](https://github.com/alen-saji-05/elearn/blob/main/frontend/src/api/axios.js) (HTTP API client), [`backend/apps/chat`](https://github.com/alen-saji-05/elearn/tree/main/backend/apps/chat) (Real-time Q&A)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web client"]
  node_app["App routing<br/>[App.jsx]"]
  node_authctx["Auth context<br/>[AuthContext.jsx]"]
  node_coursepages["Course pages<br/>[CourseList.jsx]"]
  node_lessonpage["Lesson player<br/>[LessonPlayer.jsx]"]
  node_checkoutpage["Checkout page<br/>[Checkout.jsx]"]
  node_api["HTTP API client<br/>[axios.js]"]
  node_websocket["Chat socket hook<br/>[useWebSocket.js]"]
end

subgraph group_learning["Learning domain"]
  node_courses["Courses and lessons"]
  node_enrollments["Enrollment and progress"]
  node_search["Course search"]
end

subgraph group_commerce["Identity and commerce"]
  node_users["Users and roles"]
  node_payments["Payment service<br/>[services.py]"]
  node_paymentrecords[("Payment records<br/>[models.py]")]
end

subgraph group_engagement["Engagement"]
  node_chat["Real-time Q&amp;A"]
  node_reviews["Ratings and reviews"]
  node_notifications["Notifications"]
end

node_learner(("Learner / mentor / admin"))
node_postgres[("PostgreSQL")]
node_redis[("Redis")]
node_elasticsearch[("Elasticsearch")]
node_stripe["Stripe"]
node_paypal["PayPal"]
node_email["Email service"]

node_learner -->|"uses"| node_app
node_app -->|"provides auth"| node_authctx
node_app -->|"routes to"| node_coursepages
node_app -->|"routes to"| node_lessonpage
node_app -->|"routes to"| node_checkoutpage
node_authctx -->|"calls"| node_api
node_api -->|"auth requests"| node_users
node_coursepages -->|"requests data"| node_api
node_lessonpage -->|"requests data"| node_api
node_checkoutpage -->|"requests payment"| node_api
node_payments -->|"creates and updates"| node_paymentrecords
node_payments -->|"creates sessions"| node_stripe
node_payments -->|"verifies and refunds"| node_stripe
node_payments -->|"creates enrollment"| node_enrollments
node_payments -->|"updates enrollment count"| node_courses
node_websocket -->|"opens socket"| node_chat
node_search -.->|"searches index"| node_elasticsearch
node_chat -.->|"uses channel layer"| node_redis
node_notifications -.->|"sends email"| node_email
node_users -->|"persists data"| node_postgres
node_courses -->|"persists data"| node_postgres
node_enrollments -->|"persists data"| node_postgres
node_paymentrecords -->|"persists data"| node_postgres
node_reviews -->|"persists data"| node_postgres
node_chat -->|"persists messages"| node_postgres
node_notifications -->|"persists notices"| node_postgres

click node_app "https://github.com/alen-saji-05/elearn/blob/main/frontend/src/App.jsx"
click node_authctx "https://github.com/alen-saji-05/elearn/blob/main/frontend/src/context/AuthContext.jsx"
click node_coursepages "https://github.com/alen-saji-05/elearn/blob/main/frontend/src/pages/CourseList.jsx"
click node_lessonpage "https://github.com/alen-saji-05/elearn/blob/main/frontend/src/pages/LessonPlayer.jsx"
click node_checkoutpage "https://github.com/alen-saji-05/elearn/blob/main/frontend/src/pages/Checkout.jsx"
click node_api "https://github.com/alen-saji-05/elearn/blob/main/frontend/src/api/axios.js"
click node_websocket "https://github.com/alen-saji-05/elearn/blob/main/frontend/src/hooks/useWebSocket.js"
click node_users "https://github.com/alen-saji-05/elearn/tree/main/backend/apps/users"
click node_courses "https://github.com/alen-saji-05/elearn/tree/main/backend/apps/courses"
click node_enrollments "https://github.com/alen-saji-05/elearn/tree/main/backend/apps/enrollments"
click node_payments "https://github.com/alen-saji-05/elearn/blob/main/backend/apps/payments/services.py"
click node_paymentrecords "https://github.com/alen-saji-05/elearn/blob/main/backend/apps/payments/models.py"
click node_chat "https://github.com/alen-saji-05/elearn/tree/main/backend/apps/chat"
click node_reviews "https://github.com/alen-saji-05/elearn/tree/main/backend/apps/reviews"
click node_notifications "https://github.com/alen-saji-05/elearn/tree/main/backend/apps/notifications"
click node_search "https://github.com/alen-saji-05/elearn/tree/main/backend/apps/search"

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_authctx,node_coursepages,node_lessonpage,node_checkoutpage,node_api,node_websocket toneBlue
class node_courses,node_enrollments,node_search,node_postgres,node_redis,node_elasticsearch toneAmber
class node_users,node_payments,node_paymentrecords toneMint
class node_chat,node_reviews,node_notifications toneRose
class node_learner,node_stripe,node_paypal,node_email toneIndigo
```

## Components

### Web client

- [App routing](https://github.com/alen-saji-05/elearn/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth context](https://github.com/alen-saji-05/elearn/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Course pages](https://github.com/alen-saji-05/elearn/blob/main/frontend/src/pages/CourseList.jsx): `frontend/src/pages/CourseList.jsx`
- [Lesson player](https://github.com/alen-saji-05/elearn/blob/main/frontend/src/pages/LessonPlayer.jsx): `frontend/src/pages/LessonPlayer.jsx`
- [Checkout page](https://github.com/alen-saji-05/elearn/blob/main/frontend/src/pages/Checkout.jsx): `frontend/src/pages/Checkout.jsx`
- [HTTP API client](https://github.com/alen-saji-05/elearn/blob/main/frontend/src/api/axios.js): `frontend/src/api/axios.js`
- [Chat socket hook](https://github.com/alen-saji-05/elearn/blob/main/frontend/src/hooks/useWebSocket.js): `frontend/src/hooks/useWebSocket.js`

### Learning domain

- [Courses and lessons](https://github.com/alen-saji-05/elearn/tree/main/backend/apps/courses): `backend/apps/courses`
- [Enrollment and progress](https://github.com/alen-saji-05/elearn/tree/main/backend/apps/enrollments): `backend/apps/enrollments`
- [Course search](https://github.com/alen-saji-05/elearn/tree/main/backend/apps/search): `backend/apps/search`

### Identity and commerce

- [Users and roles](https://github.com/alen-saji-05/elearn/tree/main/backend/apps/users): `backend/apps/users`
- [Payment service](https://github.com/alen-saji-05/elearn/blob/main/backend/apps/payments/services.py): `backend/apps/payments/services.py`
- [Payment records](https://github.com/alen-saji-05/elearn/blob/main/backend/apps/payments/models.py): `backend/apps/payments/models.py`

### Engagement

- [Real-time Q&A](https://github.com/alen-saji-05/elearn/tree/main/backend/apps/chat): `backend/apps/chat`
- [Ratings and reviews](https://github.com/alen-saji-05/elearn/tree/main/backend/apps/reviews): `backend/apps/reviews`
- [Notifications](https://github.com/alen-saji-05/elearn/tree/main/backend/apps/notifications): `backend/apps/notifications`

### Other components

- **Learner / mentor / admin**
- **PostgreSQL**
- **Redis**
- **Elasticsearch**
- **Stripe**
- **PayPal**
- **Email service**

## Connections

- Learner / mentor / admin → App routing: uses
- App routing → Auth context: provides auth
- App routing → Course pages: routes to
- App routing → Lesson player: routes to
- App routing → Checkout page: routes to
- Auth context → HTTP API client: calls
- HTTP API client → Users and roles: auth requests
- Course pages → HTTP API client: requests data
- Lesson player → HTTP API client: requests data
- Checkout page → HTTP API client: requests payment
- Payment service → Payment records: creates and updates
- Payment service → Stripe: creates sessions
- Payment service → Stripe: verifies and refunds
- Payment service → Enrollment and progress: creates enrollment
- Payment service → Courses and lessons: updates enrollment count
- Chat socket hook → Real-time Q&A: opens socket
- Course search → Elasticsearch: searches index
- Real-time Q&A → Redis: uses channel layer
- Notifications → Email service: sends email
- Users and roles → PostgreSQL: persists data
- Courses and lessons → PostgreSQL: persists data
- Enrollment and progress → PostgreSQL: persists data
- Payment records → PostgreSQL: persists data
- Ratings and reviews → PostgreSQL: persists data
- Real-time Q&A → PostgreSQL: persists messages
- Notifications → PostgreSQL: persists notices
