# prashantrmane-arch/courselit architecture

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

- Interactive diagram: https://gitdiagram.com/prashantrmane-arch/courselit
- Repository: https://github.com/prashantrmane-arch/courselit

## Overview

CourseLit is a self-hosted LMS and digital-commerce platform. Its primary workflow is for a creator to author and publish course content, configure payment, and manage learners; learners discover products, enroll, and access lessons. The README also identifies website building, student management, and analytics as product capabilities. The graph combines those documented capabilities with relationships visible in sampled source; unsampled subsystem connections are omitted rather than inferred.

Main entry points: [`apps/queue/src/domain/worker.ts`](https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/domain/worker.ts) (Mail worker), [`apps/web/app/(with-contexts)/dashboard/(sidebar)/products/page.tsx`](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/(with-contexts)/dashboard/(sidebar)/products/page.tsx) (Admin dashboard), [`apps/web/app/api/payment/initiate/route.ts`](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/api/payment/initiate/route.ts) (Payment initiation), [`apps/web/services/db.ts`](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/services/db.ts) (Application database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Creator workspace"]
  node_dashboard["Admin dashboard<br/>[page.tsx]"]
  node_course_content["Course authoring<br/>[page.tsx]"]
  node_website_builder["Website builder"]
  node_email_authoring["Email authoring"]
  node_blog["Blog publishing<br/>[page.tsx]"]
end

subgraph group_learning["Learner experience"]
  node_learner_course["Course pages<br/>[page.tsx]"]
  node_lesson_api["Lesson access<br/>[route.ts]"]
  node_learner_progress["Learning progress<br/>[route.ts]"]
  node_communities["Communities<br/>[page.tsx]"]
end

subgraph group_commerce["Commerce and platform"]
  node_product_api["Product API<br/>[route.ts]"]
  node_payment_api["Payment initiation<br/>[route.ts]"]
  node_db[("Application database<br/>[db.ts]")]
  node_domain_setup["Tenant setup<br/>[route.ts]"]
  node_analytics["Analytics<br/>[posthog.ts]"]
end

subgraph group_async["Background services"]
  node_queue_routes["Job routes<br/>[routes.ts]"]
  node_mail_jobs["Mail queue<br/>[handler.ts]"]
  node_mail_worker["Mail worker<br/>[worker.ts]"]
  node_mail_delivery["Email delivery<br/>[mail.ts]"]
  node_notification_jobs["Notification enqueue<br/>[enqueue.ts]"]
  node_notification_channel["App notification channel<br/>[app.ts]"]
  node_notification_sse["Notification stream<br/>[routes.ts]"]
end

node_creator(("Course creator"))
node_learner(("Learner"))
node_payment_provider["Payment provider"]

node_creator -->|"manages"| node_dashboard
node_dashboard -->|"authors courses"| node_course_content
node_creator -->|"builds sales pages"| node_website_builder
node_creator -.->|"authors email"| node_email_authoring
node_dashboard -.->|"publishes content"| node_blog
node_learner -.->|"browses products"| node_product_api
node_product_api -.->|"reads products"| node_db
node_learner -.->|"starts enrollment"| node_payment_api
node_payment_api -.->|"initiates payment"| node_payment_provider
node_payment_api -.->|"updates membership"| node_db
node_learner -->|"opens course"| node_learner_course
node_learner_course -.->|"requests lessons"| node_lesson_api
node_lesson_api -.->|"records progress"| node_learner_progress
node_learner -.->|"joins communities"| node_communities
node_domain_setup -->|"connects database"| node_db
node_queue_routes -->|"enqueues mail"| node_mail_jobs
node_mail_worker -->|"consumes jobs"| node_mail_jobs
node_mail_worker -->|"sends email"| node_mail_delivery
node_queue_routes -->|"enqueues notifications"| node_notification_jobs
node_notification_channel -->|"enqueues notification"| node_notification_jobs
node_notification_sse -.->|"streams updates"| node_learner
node_mail_worker -->|"reports errors"| node_analytics

click node_dashboard "https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/(with-contexts)/dashboard/(sidebar)/products/page.tsx"
click node_course_content "https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/(with-contexts)/dashboard/(sidebar)/product/%5Bid%5D/content/page.tsx"
click node_website_builder "https://github.com/prashantrmane-arch/courselit/tree/main/packages/page-blocks"
click node_email_authoring "https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/(with-contexts)/dashboard/(sidebar)/mails/new/new-mail-page-client.tsx"
click node_product_api "https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/api/products/route.ts"
click node_payment_api "https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/api/payment/initiate/route.ts"
click node_learner_course "https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/(with-contexts)/course/%5Bslug%5D/%5Bid%5D/page.tsx"
click node_lesson_api "https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/api/products/%5BproductId%5D/lessons/route.ts"
click node_learner_progress "https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/api/products/%5BproductId%5D/customers/%5BuserId%5D/progress/route.ts"
click node_communities "https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/(with-contexts)/(with-layout)/communities/page.tsx"
click node_blog "https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/(with-contexts)/dashboard/(sidebar)/blogs/page.tsx"
click node_db "https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/services/db.ts"
click node_domain_setup "https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/verify-domain/route.ts"
click node_queue_routes "https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/job/routes.ts"
click node_mail_jobs "https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/domain/handler.ts"
click node_mail_worker "https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/domain/worker.ts"
click node_mail_delivery "https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/mail.ts"
click node_notification_jobs "https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/notifications/services/enqueue.ts"
click node_notification_channel "https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/notifications/services/channels/app.ts"
click node_notification_sse "https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/sse/routes.ts"
click node_analytics "https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/observability/posthog.ts"

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_dashboard,node_course_content,node_website_builder,node_email_authoring,node_blog toneBlue
class node_learner_course,node_lesson_api,node_learner_progress,node_communities toneAmber
class node_product_api,node_payment_api,node_db,node_domain_setup,node_analytics toneMint
class node_queue_routes,node_mail_jobs,node_mail_worker,node_mail_delivery,node_notification_jobs,node_notification_channel,node_notification_sse toneRose
class node_creator,node_learner,node_payment_provider toneIndigo
```

## Components

### Creator workspace

- [Admin dashboard](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/(with-contexts)/dashboard/(sidebar)/products/page.tsx): `apps/web/app/(with-contexts)/dashboard/(sidebar)/products/page.tsx`
- [Course authoring](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/(with-contexts)/dashboard/(sidebar)/product/%5Bid%5D/content/page.tsx): `apps/web/app/(with-contexts)/dashboard/(sidebar)/product/[id]/content/page.tsx`
- [Website builder](https://github.com/prashantrmane-arch/courselit/tree/main/packages/page-blocks): `packages/page-blocks`
- [Email authoring](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/(with-contexts)/dashboard/(sidebar)/mails/new/new-mail-page-client.tsx): `apps/web/app/(with-contexts)/dashboard/(sidebar)/mails/new/new-mail-page-client.tsx`
- [Blog publishing](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/(with-contexts)/dashboard/(sidebar)/blogs/page.tsx): `apps/web/app/(with-contexts)/dashboard/(sidebar)/blogs/page.tsx`

### Learner experience

- [Course pages](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/(with-contexts)/course/%5Bslug%5D/%5Bid%5D/page.tsx): `apps/web/app/(with-contexts)/course/[slug]/[id]/page.tsx`
- [Lesson access](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/api/products/%5BproductId%5D/lessons/route.ts): `apps/web/app/api/products/[productId]/lessons/route.ts`
- [Learning progress](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/api/products/%5BproductId%5D/customers/%5BuserId%5D/progress/route.ts): `apps/web/app/api/products/[productId]/customers/[userId]/progress/route.ts`
- [Communities](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/(with-contexts)/(with-layout)/communities/page.tsx): `apps/web/app/(with-contexts)/(with-layout)/communities/page.tsx`

### Commerce and platform

- [Product API](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/api/products/route.ts): `apps/web/app/api/products/route.ts`
- [Payment initiation](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/api/payment/initiate/route.ts): `apps/web/app/api/payment/initiate/route.ts`
- [Application database](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/services/db.ts): `apps/web/services/db.ts`
- [Tenant setup](https://github.com/prashantrmane-arch/courselit/blob/main/apps/web/app/verify-domain/route.ts): `apps/web/app/verify-domain/route.ts`
- [Analytics](https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/observability/posthog.ts): `apps/queue/src/observability/posthog.ts`

### Background services

- [Job routes](https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/job/routes.ts): `apps/queue/src/job/routes.ts`
- [Mail queue](https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/domain/handler.ts): `apps/queue/src/domain/handler.ts`
- [Mail worker](https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/domain/worker.ts): `apps/queue/src/domain/worker.ts`
- [Email delivery](https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/mail.ts): `apps/queue/src/mail.ts`
- [Notification enqueue](https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/notifications/services/enqueue.ts): `apps/queue/src/notifications/services/enqueue.ts`
- [App notification channel](https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/notifications/services/channels/app.ts): `apps/queue/src/notifications/services/channels/app.ts`
- [Notification stream](https://github.com/prashantrmane-arch/courselit/blob/main/apps/queue/src/sse/routes.ts): `apps/queue/src/sse/routes.ts`

### Other components

- **Course creator**
- **Learner**
- **Payment provider**

## Connections

- Course creator → Admin dashboard: manages
- Admin dashboard → Course authoring: authors courses
- Course creator → Website builder: builds sales pages
- Course creator → Email authoring: authors email
- Admin dashboard → Blog publishing: publishes content
- Learner → Product API: browses products
- Product API → Application database: reads products
- Learner → Payment initiation: starts enrollment
- Payment initiation → Payment provider: initiates payment
- Payment initiation → Application database: updates membership
- Learner → Course pages: opens course
- Course pages → Lesson access: requests lessons
- Lesson access → Learning progress: records progress
- Learner → Communities: joins communities
- Tenant setup → Application database: connects database (evidence: `apps/web/app/verify-domain/route.ts`)
- Job routes → Mail queue: enqueues mail (evidence: `apps/queue/src/job/routes.ts`)
- Mail worker → Mail queue: consumes jobs (evidence: `apps/queue/src/domain/worker.ts`)
- Mail worker → Email delivery: sends email (evidence: `apps/queue/src/domain/worker.ts`)
- Job routes → Notification enqueue: enqueues notifications (evidence: `apps/queue/src/job/routes.ts`)
- App notification channel → Notification enqueue: enqueues notification (evidence: `apps/queue/src/notifications/services/channels/app.ts`)
- Notification stream → Learner: streams updates
- Mail worker → Analytics: reports errors (evidence: `apps/queue/src/domain/worker.ts`)
