# guillermoscript/lms-front architecture

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

- Interactive diagram: https://gitdiagram.com/guillermoscript/lms-front
- Repository: https://github.com/guillermoscript/lms-front

## Overview

LMS Platform is a multi-tenant learning and commerce product for schools and course creators. Its primary flow is educators creating courses and selling access, followed by students enrolling, learning, completing assessments, and earning certificates. Separate branches cover tenant administration and platform billing, community and gamification, creator tools, and an MCP-based AI tutor. The graph combines sampled call relationships with capabilities and flows explicitly described in the README; unsampled implementation details are not assumed.

Main entry points: [`app/api/payments/checkout/route.ts`](https://github.com/guillermoscript/lms-front/blob/master/app/api/payments/checkout/route.ts) (Checkout), [`app/[locale]/dashboard/admin/page.tsx`](https://github.com/guillermoscript/lms-front/blob/master/app/%5Blocale%5D/dashboard/admin/page.tsx) (School administration), [`mcp-server/index.ts`](https://github.com/guillermoscript/lms-front/blob/master/mcp-server/index.ts) (MCP server), [`app/[locale]/(public)/courses/page.tsx`](https://github.com/guillermoscript/lms-front/blob/master/app/%5Blocale%5D/(public)/courses/page.tsx) (Course catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning"]
  node_course_authoring["Course authoring<br/>[page.tsx]"]
  node_course_catalog["Course catalog<br/>[page.tsx]"]
  node_enrollment["Enrollment"]
  node_course_delivery["Course delivery<br/>[page.tsx]"]
  node_assessments["Exams and exercises<br/>[page.tsx]"]
  node_certificates["Certificates<br/>[route.ts]"]
end

subgraph group_commerce["Commerce"]
  node_checkout["Checkout<br/>[route.ts]"]
  node_provider_factory["Payment providers<br/>[index.ts]"]
  node_payment_webhooks["Payment webhooks<br/>[route.ts]"]
  node_webhook_dispatch["Billing dispatch"]
  node_platform_billing["School billing"]
end

subgraph group_tenancy["Schools and operations"]
  node_school_admin["School administration<br/>[page.tsx]"]
  node_tenant_context["Tenant context<br/>[tenant.ts]"]
end

subgraph group_engagement["Engagement and creation"]
  node_community["Community spaces<br/>[community-feed.tsx]"]
  node_creator_tools["Creator tools"]
  node_analytics["Product analytics<br/>[server.ts]"]
end

subgraph group_ai["AI tutor"]
  node_mcp_server["MCP server<br/>[index.ts]"]
  node_mcp_practice["Practice tools<br/>[practice.ts]"]
  node_mcp_analytics["Analytics tools<br/>[analytics.ts]"]
end

node_educator(("Educator"))
node_student(("Student"))
node_supabase[("Supabase")]

node_educator -->|"creates courses"| node_course_authoring
node_course_authoring -.->|"publishes courses"| node_course_catalog
node_student -->|"browses courses"| node_course_catalog
node_course_catalog -.->|"starts purchase"| node_checkout
node_student -->|"buys access"| node_checkout
node_checkout -->|"selects provider"| node_provider_factory
node_checkout -->|"reads session"| node_supabase
node_payment_webhooks -->|"dispatches events"| node_webhook_dispatch
node_webhook_dispatch -.->|"tracks events"| node_analytics
node_student -->|"enrolls"| node_enrollment
node_enrollment -.->|"grants access"| node_course_delivery
node_student -->|"learns"| node_course_delivery
node_course_delivery -->|"takes assessments"| node_assessments
node_assessments -.->|"earns certificates"| node_certificates
node_educator -->|"manages school"| node_school_admin
node_school_admin -->|"manages plan"| node_platform_billing
node_tenant_context -->|"resolves tenant"| node_supabase
node_school_admin -->|"builds landing pages"| node_creator_tools
node_student -->|"participates"| node_community
node_student -->|"uses AI tutor"| node_mcp_server
node_mcp_server -->|"registers tools"| node_mcp_practice
node_mcp_server -->|"registers tools"| node_mcp_analytics
node_payment_webhooks -->|"tracks payments"| node_analytics

click node_course_authoring "https://github.com/guillermoscript/lms-front/blob/master/app/%5Blocale%5D/dashboard/teacher/courses/%5BcourseId%5D/page.tsx"
click node_course_catalog "https://github.com/guillermoscript/lms-front/blob/master/app/%5Blocale%5D/(public)/courses/page.tsx"
click node_enrollment "https://github.com/guillermoscript/lms-front/blob/master/lib/services/enrollment-service.ts"
click node_course_delivery "https://github.com/guillermoscript/lms-front/blob/master/app/%5Blocale%5D/dashboard/student/courses/%5BcourseId%5D/lessons/%5BlessonId%5D/page.tsx"
click node_assessments "https://github.com/guillermoscript/lms-front/blob/master/app/%5Blocale%5D/dashboard/student/courses/%5BcourseId%5D/exams/%5BexamId%5D/page.tsx"
click node_certificates "https://github.com/guillermoscript/lms-front/blob/master/app/api/certificates/issue/route.ts"
click node_checkout "https://github.com/guillermoscript/lms-front/blob/master/app/api/payments/checkout/route.ts"
click node_provider_factory "https://github.com/guillermoscript/lms-front/blob/master/lib/payments/index.ts"
click node_payment_webhooks "https://github.com/guillermoscript/lms-front/blob/master/app/api/stripe/webhook/route.ts"
click node_webhook_dispatch "https://github.com/guillermoscript/lms-front/blob/master/lib/payments/webhook-dispatch.ts"
click node_platform_billing "https://github.com/guillermoscript/lms-front/blob/master/lib/billing/platform-billing.ts"
click node_school_admin "https://github.com/guillermoscript/lms-front/blob/master/app/%5Blocale%5D/dashboard/admin/page.tsx"
click node_tenant_context "https://github.com/guillermoscript/lms-front/blob/master/lib/supabase/tenant.ts"
click node_community "https://github.com/guillermoscript/lms-front/blob/master/components/community/community-feed.tsx"
click node_creator_tools "https://github.com/guillermoscript/lms-front/blob/master/components/admin/landing-page/landing-pages-client.tsx"
click node_analytics "https://github.com/guillermoscript/lms-front/blob/master/lib/analytics/server.ts"
click node_mcp_server "https://github.com/guillermoscript/lms-front/blob/master/mcp-server/index.ts"
click node_mcp_practice "https://github.com/guillermoscript/lms-front/blob/master/mcp-server/src/tools/practice.ts"
click node_mcp_analytics "https://github.com/guillermoscript/lms-front/blob/master/mcp-server/src/tools/analytics.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_course_authoring,node_course_catalog,node_enrollment,node_course_delivery,node_assessments,node_certificates toneBlue
class node_checkout,node_provider_factory,node_payment_webhooks,node_webhook_dispatch,node_platform_billing,node_supabase toneAmber
class node_school_admin,node_tenant_context toneMint
class node_community,node_creator_tools,node_analytics toneRose
class node_mcp_server,node_mcp_practice,node_mcp_analytics,node_educator,node_student toneIndigo
```

## Components

### Learning

- [Course authoring](https://github.com/guillermoscript/lms-front/blob/master/app/%5Blocale%5D/dashboard/teacher/courses/%5BcourseId%5D/page.tsx): `app/[locale]/dashboard/teacher/courses/[courseId]/page.tsx`
- [Course catalog](https://github.com/guillermoscript/lms-front/blob/master/app/%5Blocale%5D/(public)/courses/page.tsx): `app/[locale]/(public)/courses/page.tsx`
- [Enrollment](https://github.com/guillermoscript/lms-front/blob/master/lib/services/enrollment-service.ts): `lib/services/enrollment-service.ts`
- [Course delivery](https://github.com/guillermoscript/lms-front/blob/master/app/%5Blocale%5D/dashboard/student/courses/%5BcourseId%5D/lessons/%5BlessonId%5D/page.tsx): `app/[locale]/dashboard/student/courses/[courseId]/lessons/[lessonId]/page.tsx`
- [Exams and exercises](https://github.com/guillermoscript/lms-front/blob/master/app/%5Blocale%5D/dashboard/student/courses/%5BcourseId%5D/exams/%5BexamId%5D/page.tsx): `app/[locale]/dashboard/student/courses/[courseId]/exams/[examId]/page.tsx`
- [Certificates](https://github.com/guillermoscript/lms-front/blob/master/app/api/certificates/issue/route.ts): `app/api/certificates/issue/route.ts`

### Commerce

- [Checkout](https://github.com/guillermoscript/lms-front/blob/master/app/api/payments/checkout/route.ts): `app/api/payments/checkout/route.ts`
- [Payment providers](https://github.com/guillermoscript/lms-front/blob/master/lib/payments/index.ts): `lib/payments/index.ts`
- [Payment webhooks](https://github.com/guillermoscript/lms-front/blob/master/app/api/stripe/webhook/route.ts): `app/api/stripe/webhook/route.ts`
- [Billing dispatch](https://github.com/guillermoscript/lms-front/blob/master/lib/payments/webhook-dispatch.ts): `lib/payments/webhook-dispatch.ts`
- [School billing](https://github.com/guillermoscript/lms-front/blob/master/lib/billing/platform-billing.ts): `lib/billing/platform-billing.ts`

### Schools and operations

- [School administration](https://github.com/guillermoscript/lms-front/blob/master/app/%5Blocale%5D/dashboard/admin/page.tsx): `app/[locale]/dashboard/admin/page.tsx`
- [Tenant context](https://github.com/guillermoscript/lms-front/blob/master/lib/supabase/tenant.ts): `lib/supabase/tenant.ts`

### Engagement and creation

- [Community spaces](https://github.com/guillermoscript/lms-front/blob/master/components/community/community-feed.tsx): `components/community/community-feed.tsx`
- [Creator tools](https://github.com/guillermoscript/lms-front/blob/master/components/admin/landing-page/landing-pages-client.tsx): `components/admin/landing-page/landing-pages-client.tsx`
- [Product analytics](https://github.com/guillermoscript/lms-front/blob/master/lib/analytics/server.ts): `lib/analytics/server.ts`

### AI tutor

- [MCP server](https://github.com/guillermoscript/lms-front/blob/master/mcp-server/index.ts): `mcp-server/index.ts`
- [Practice tools](https://github.com/guillermoscript/lms-front/blob/master/mcp-server/src/tools/practice.ts): `mcp-server/src/tools/practice.ts`
- [Analytics tools](https://github.com/guillermoscript/lms-front/blob/master/mcp-server/src/tools/analytics.ts): `mcp-server/src/tools/analytics.ts`

### Other components

- **Educator**
- **Student**
- **Supabase**

## Connections

- Educator → Course authoring: creates courses (evidence: `README.md`)
- Course authoring → Course catalog: publishes courses
- Student → Course catalog: browses courses (evidence: `README.md`)
- Course catalog → Checkout: starts purchase
- Student → Checkout: buys access (evidence: `README.md`)
- Checkout → Payment providers: selects provider (evidence: `lib/payments/index.ts`)
- Checkout → Supabase: reads session (evidence: `app/api/payments/checkout/route.ts`)
- Payment webhooks → Billing dispatch: dispatches events (evidence: `app/api/stripe/webhook/route.ts`)
- Billing dispatch → Product analytics: tracks events (evidence: `lib/payments/webhook-dispatch.ts`)
- Student → Enrollment: enrolls (evidence: `README.md`)
- Enrollment → Course delivery: grants access
- Student → Course delivery: learns (evidence: `README.md`)
- Course delivery → Exams and exercises: takes assessments (evidence: `README.md`)
- Exams and exercises → Certificates: earns certificates
- Educator → School administration: manages school (evidence: `README.md`)
- School administration → School billing: manages plan (evidence: `README.md`)
- Tenant context → Supabase: resolves tenant (evidence: `lib/supabase/tenant.ts`)
- School administration → Creator tools: builds landing pages (evidence: `README.md`)
- Student → Community spaces: participates (evidence: `README.md`)
- Student → MCP server: uses AI tutor (evidence: `README.md`)
- MCP server → Practice tools: registers tools (evidence: `mcp-server/index.ts`)
- MCP server → Analytics tools: registers tools (evidence: `mcp-server/index.ts`)
- Payment webhooks → Product analytics: tracks payments (evidence: `app/api/stripe/webhook/route.ts`)
