# danielfrrokaj/react-lms architecture

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

- Interactive diagram: https://gitdiagram.com/danielfrrokaj/react-lms
- Repository: https://github.com/danielfrrokaj/react-lms

## Overview

This React LMS serves administrators, teachers, and students through role-protected routes. Users sign in against demo data, then manage courses and enrollment, build course sections and learning materials, submit assignments, and review grades and feedback. Pages call in-memory services backed by shared mock data; the model includes course, section, subsection, task, and grade records. The graph preserves the documented role capabilities, but some pages and service calls were not excerpted, so their internal links are omitted rather than inferred.

Main entry points: [`lms/src/services/courseService.ts`](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/services/courseService.ts) (Course service), [`lms/src/pages/Dashboard.tsx`](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/Dashboard.tsx) (Role dashboard), [`lms/src/contexts/AuthContext.tsx`](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/contexts/AuthContext.tsx) (Authentication state), [`lms/src/services/userService.ts`](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/services/userService.ts) (User service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["Router and app<br/>[App.tsx]"]
  node_dashboard["Role dashboard<br/>[Dashboard.tsx]"]
  node_layout["Role navigation<br/>[Layout.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_login["Login<br/>[Login.tsx]"]
  node_auth["Authentication state<br/>[AuthContext.tsx]"]
  node_protected["Route guard<br/>[ProtectedRoute.tsx]"]
end

subgraph group_admin["Administration"]
  node_admincourses["Course administration<br/>[Courses.tsx]"]
  node_adminusers["User administration<br/>[Users.tsx]"]
  node_admindash["Admin overview<br/>[Dashboard.tsx]"]
end

subgraph group_learning["Teaching and learning"]
  node_teachercourses["Teacher courses<br/>[Courses.tsx]"]
  node_teacherdetail["Course authoring<br/>[CourseDetail.tsx]"]
  node_teacherassign["Grade submissions<br/>[Assignments.tsx]"]
  node_teacherdash["Teacher overview<br/>[Dashboard.tsx]"]
  node_studentcourses["Student courses<br/>[Courses.tsx]"]
  node_studentdetail["Course materials<br/>[CourseDetail.tsx]"]
  node_studentassign["Assignment work<br/>[Assignments.tsx]"]
  node_studentdash["Student overview<br/>[Dashboard.tsx]"]
  node_editor["Rich text editor<br/>[RichTextEditor.tsx]"]
end

subgraph group_data["Domain data"]
  node_coursesvc["Course service<br/>[courseService.ts]"]
  node_usersvc["User service<br/>[userService.ts]"]
  node_gradesvc["Grade service<br/>[gradeService.ts]"]
  node_mockdata["Demo data<br/>[mockData.ts]"]
end

node_user(("User"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_app -->|"guards routes"| node_protected
node_app -->|"routes to"| node_dashboard
node_login -->|"signs in"| node_auth
node_protected -->|"checks access"| node_auth
node_dashboard -->|"reads role"| node_auth
node_dashboard -->|"dispatches"| node_admindash
node_dashboard -->|"dispatches"| node_teacherdash
node_dashboard -->|"dispatches"| node_studentdash
node_layout -->|"reads session"| node_auth
node_admincourses -->|"manages courses"| node_coursesvc
node_admincourses -->|"assigns teachers"| node_usersvc
node_adminusers -->|"manages users"| node_usersvc
node_admindash -->|"reads course data"| node_coursesvc
node_admindash -->|"reads user data"| node_usersvc
node_teachercourses -->|"reads courses"| node_coursesvc
node_teachercourses -->|"reads users"| node_usersvc
node_teacherdetail -->|"edits content"| node_editor
node_teacherdetail -.->|"manages sections"| node_coursesvc
node_teacherassign -->|"grades work"| node_gradesvc
node_studentcourses -->|"reads courses"| node_coursesvc
node_studentdetail -->|"loads course"| node_coursesvc
node_studentassign -->|"tracks attempts"| node_gradesvc
node_studentdash -->|"reads courses"| node_coursesvc
node_studentdash -->|"reads grades"| node_gradesvc
node_auth -->|"loads demo users"| node_mockdata
node_coursesvc -->|"reads and updates"| node_mockdata
node_usersvc -->|"reads and updates"| node_mockdata
node_gradesvc -->|"reads and updates"| node_mockdata

click node_app "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/App.tsx"
click node_dashboard "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/Dashboard.tsx"
click node_layout "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/components/common/Layout.tsx"
click node_login "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/auth/Login.tsx"
click node_auth "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/contexts/AuthContext.tsx"
click node_protected "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/utils/ProtectedRoute.tsx"
click node_admincourses "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/admin/Courses.tsx"
click node_adminusers "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/admin/Users.tsx"
click node_admindash "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/admin/Dashboard.tsx"
click node_teachercourses "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/teacher/Courses.tsx"
click node_teacherdetail "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/teacher/CourseDetail.tsx"
click node_teacherassign "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/teacher/Assignments.tsx"
click node_teacherdash "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/teacher/Dashboard.tsx"
click node_studentcourses "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/student/Courses.tsx"
click node_studentdetail "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/student/CourseDetail.tsx"
click node_studentassign "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/student/Assignments.tsx"
click node_studentdash "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/student/Dashboard.tsx"
click node_editor "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/components/common/RichTextEditor.tsx"
click node_coursesvc "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/services/courseService.ts"
click node_usersvc "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/services/userService.ts"
click node_gradesvc "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/services/gradeService.ts"
click node_mockdata "https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/services/mockData.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_app,node_dashboard,node_layout,node_user toneBlue
class node_login,node_auth,node_protected toneAmber
class node_admincourses,node_adminusers,node_admindash toneMint
class node_teachercourses,node_teacherdetail,node_teacherassign,node_teacherdash,node_studentcourses,node_studentdetail,node_studentassign,node_studentdash,node_editor toneRose
class node_coursesvc,node_usersvc,node_gradesvc,node_mockdata toneIndigo
```

## Components

### Application shell

- [Router and app](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/App.tsx): `lms/src/App.tsx`
- [Role dashboard](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/Dashboard.tsx): `lms/src/pages/Dashboard.tsx`
- [Role navigation](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/components/common/Layout.tsx): `lms/src/components/common/Layout.tsx`

### Identity and access

- [Login](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/auth/Login.tsx): `lms/src/pages/auth/Login.tsx`
- [Authentication state](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/contexts/AuthContext.tsx): `lms/src/contexts/AuthContext.tsx`
- [Route guard](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/utils/ProtectedRoute.tsx): `lms/src/utils/ProtectedRoute.tsx`

### Administration

- [Course administration](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/admin/Courses.tsx): `lms/src/pages/admin/Courses.tsx`
- [User administration](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/admin/Users.tsx): `lms/src/pages/admin/Users.tsx`
- [Admin overview](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/admin/Dashboard.tsx): `lms/src/pages/admin/Dashboard.tsx`

### Teaching and learning

- [Teacher courses](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/teacher/Courses.tsx): `lms/src/pages/teacher/Courses.tsx`
- [Course authoring](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/teacher/CourseDetail.tsx): `lms/src/pages/teacher/CourseDetail.tsx`
- [Grade submissions](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/teacher/Assignments.tsx): `lms/src/pages/teacher/Assignments.tsx`
- [Teacher overview](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/teacher/Dashboard.tsx): `lms/src/pages/teacher/Dashboard.tsx`
- [Student courses](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/student/Courses.tsx): `lms/src/pages/student/Courses.tsx`
- [Course materials](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/student/CourseDetail.tsx): `lms/src/pages/student/CourseDetail.tsx`
- [Assignment work](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/student/Assignments.tsx): `lms/src/pages/student/Assignments.tsx`
- [Student overview](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/pages/student/Dashboard.tsx): `lms/src/pages/student/Dashboard.tsx`
- [Rich text editor](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/components/common/RichTextEditor.tsx): `lms/src/components/common/RichTextEditor.tsx`

### Domain data

- [Course service](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/services/courseService.ts): `lms/src/services/courseService.ts`
- [User service](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/services/userService.ts): `lms/src/services/userService.ts`
- [Grade service](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/services/gradeService.ts): `lms/src/services/gradeService.ts`
- [Demo data](https://github.com/danielfrrokaj/react-lms/blob/main/lms/src/services/mockData.ts): `lms/src/services/mockData.ts`

### Other components

- **User**

## Connections

- User → Router and app: opens (evidence: `README.md`)
- Router and app → Login: routes to (evidence: `lms/src/App.tsx`)
- Router and app → Route guard: guards routes (evidence: `lms/src/App.tsx`)
- Router and app → Role dashboard: routes to (evidence: `lms/src/App.tsx`)
- Login → Authentication state: signs in (evidence: `lms/src/pages/auth/Login.tsx`)
- Route guard → Authentication state: checks access (evidence: `lms/src/utils/ProtectedRoute.tsx`)
- Role dashboard → Authentication state: reads role (evidence: `lms/src/pages/Dashboard.tsx`)
- Role dashboard → Admin overview: dispatches (evidence: `lms/src/pages/Dashboard.tsx`)
- Role dashboard → Teacher overview: dispatches (evidence: `lms/src/pages/Dashboard.tsx`)
- Role dashboard → Student overview: dispatches (evidence: `lms/src/pages/Dashboard.tsx`)
- Role navigation → Authentication state: reads session (evidence: `lms/src/components/common/Layout.tsx`)
- Course administration → Course service: manages courses (evidence: `lms/src/pages/admin/Courses.tsx`)
- Course administration → User service: assigns teachers (evidence: `lms/src/pages/admin/Courses.tsx`)
- User administration → User service: manages users (evidence: `lms/src/pages/admin/Users.tsx`)
- Admin overview → Course service: reads course data (evidence: `lms/src/pages/admin/Dashboard.tsx`)
- Admin overview → User service: reads user data (evidence: `lms/src/pages/admin/Dashboard.tsx`)
- Teacher courses → Course service: reads courses (evidence: `lms/src/pages/teacher/Courses.tsx`)
- Teacher courses → User service: reads users (evidence: `lms/src/pages/teacher/Courses.tsx`)
- Course authoring → Rich text editor: edits content (evidence: `lms/src/pages/teacher/CourseDetail.tsx`)
- Course authoring → Course service: manages sections (evidence: `lms/src/pages/teacher/CourseDetail.tsx`)
- Grade submissions → Grade service: grades work (evidence: `lms/src/pages/teacher/Assignments.tsx`)
- Student courses → Course service: reads courses (evidence: `lms/src/pages/student/Courses.tsx`)
- Course materials → Course service: loads course (evidence: `lms/src/pages/student/CourseDetail.tsx`)
- Assignment work → Grade service: tracks attempts (evidence: `lms/src/pages/student/Assignments.tsx`)
- Student overview → Course service: reads courses (evidence: `lms/src/pages/student/Dashboard.tsx`)
- Student overview → Grade service: reads grades (evidence: `lms/src/pages/student/Dashboard.tsx`)
- Authentication state → Demo data: loads demo users (evidence: `lms/src/contexts/AuthContext.tsx`)
- Course service → Demo data: reads and updates (evidence: `lms/src/services/courseService.ts`)
- User service → Demo data: reads and updates (evidence: `lms/src/services/userService.ts`)
- Grade service → Demo data: reads and updates (evidence: `lms/src/services/gradeService.ts`)
