# dsuth10/legends-of-learning-4 architecture

> Architecture diagram of the GitHub repository dsuth10/legends-of-learning-4, 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/dsuth10/legends-of-learning-4
- Repository: https://github.com/dsuth10/legends-of-learning-4

## Overview

Legends of Learning is a classroom learning platform that combines teacher-managed classes and quests with student quest completion, character progression, rewards, equipment, and clans. The principal workflow is a teacher assigning learning activity, a student completing it and receiving progression rewards, and teachers monitoring class and engagement outcomes. The README documents these major capabilities; the sampled code confirms authentication, role-based dashboard routing, student import, and backup behavior. Other subsystem links are kept broad because their route and service implementations were not sampled.

Main entry points: [`app/routes/student_main.py`](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/student_main.py) (Student Dashboard), [`app/routes/teacher/blueprint.py`](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/teacher/blueprint.py) (Teacher Dashboard), [`app/routes/adventures/student.py`](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/adventures/student.py) (Student Adventures), [`app/routes/main.py`](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/main.py) (Home Router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Dashboards"]
  node_home["Home Router<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_authforms["Auth Forms<br/>[auth.py]"]
  node_studentdash["Student Dashboard<br/>[student_main.py]"]
  node_teacherdash["Teacher Dashboard<br/>[blueprint.py]"]
end

subgraph group_learning["Learning Activities"]
  node_adventurestudent["Student Adventures<br/>[student.py]"]
  node_adventureteacher["Teacher Adventures<br/>[teacher.py]"]
  node_adventurelife["Adventure Lifecycle"]
  node_assignments["Adventure Assignment"]
  node_quiz["Adventure Quizzes<br/>[adventure_quiz.py]"]
  node_rewards["Adventure Rewards"]
end

subgraph group_gameplay["Student Progression"]
  node_abilities["Abilities and Battle<br/>[abilities.py]"]
  node_battle["Battle Routes<br/>[battle.py]"]
  node_clans["Clan Features<br/>[clan.py]"]
end

subgraph group_management["Classroom Operations"]
  node_teacherclasses["Class Management<br/>[classes.py]"]
  node_students["Student Management<br/>[students_api.py]"]
  node_studentservice["Student Service<br/>[student_service.py]"]
  node_studentimport["Student Import"]
  node_analytics["Analytics"]
end

node_student(("Student"))
node_teacher(("Teacher"))
node_database[("Application Database<br/>[__init__.py]")]

node_student -->|"opens"| node_home
node_teacher -->|"opens"| node_home
node_home -->|"routes students"| node_studentdash
node_home -->|"routes teachers"| node_teacherdash
node_student -->|"signs in"| node_auth
node_teacher -->|"signs in"| node_auth
node_auth -->|"validates with"| node_authforms
node_auth -->|"queries users"| node_database
node_teacherdash -->|"manages classes"| node_teacherclasses
node_teacherdash -->|"manages students"| node_students
node_students -->|"imports roster"| node_studentimport
node_studentimport -->|"creates students"| node_studentservice
node_studentservice -->|"writes users"| node_database
node_teacherdash -->|"manages adventures"| node_adventureteacher
node_adventureteacher -->|"assigns activity"| node_assignments
node_studentdash -->|"opens activities"| node_adventurestudent
node_adventurestudent -->|"handles quizzes"| node_quiz
node_adventurestudent -->|"handles progress"| node_adventurelife
node_adventurestudent -->|"grants rewards"| node_rewards
node_studentdash -->|"uses abilities"| node_abilities
node_studentdash -->|"enters battles"| node_battle
node_studentdash -->|"uses clans"| node_clans
node_teacherdash -->|"views analytics"| node_analytics
node_analytics -->|"reads metrics"| node_database

click node_home "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/main.py"
click node_auth "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/auth.py"
click node_authforms "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/forms/auth.py"
click node_studentdash "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/student_main.py"
click node_teacherdash "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/teacher/blueprint.py"
click node_adventurestudent "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/adventures/student.py"
click node_adventureteacher "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/adventures/teacher.py"
click node_adventurelife "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/adventure_lifecycle.py"
click node_assignments "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/adventure_assignment.py"
click node_quiz "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/adventure_quiz.py"
click node_rewards "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/adventure_rewards.py"
click node_abilities "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/student/abilities.py"
click node_battle "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/student/battle.py"
click node_clans "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/clan.py"
click node_teacherclasses "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/teacher/classes.py"
click node_students "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/teacher/students_api.py"
click node_studentservice "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/student_service.py"
click node_studentimport "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/student_import_service.py"
click node_analytics "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/analytics_service.py"
click node_database "https://github.com/dsuth10/legends-of-learning-4/blob/main/app/models/__init__.py"

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_home,node_auth,node_authforms,node_studentdash,node_teacherdash toneBlue
class node_adventurestudent,node_adventureteacher,node_adventurelife,node_assignments,node_quiz,node_rewards,node_database toneAmber
class node_abilities,node_battle,node_clans toneMint
class node_teacherclasses,node_students,node_studentservice,node_studentimport,node_analytics toneRose
class node_student,node_teacher toneIndigo
```

## Components

### Access and Dashboards

- [Home Router](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/main.py): `app/routes/main.py`
- [Authentication](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/auth.py): `app/routes/auth.py`
- [Auth Forms](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/forms/auth.py): `app/forms/auth.py`
- [Student Dashboard](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/student_main.py): `app/routes/student_main.py`
- [Teacher Dashboard](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/teacher/blueprint.py): `app/routes/teacher/blueprint.py`

### Learning Activities

- [Student Adventures](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/adventures/student.py): `app/routes/adventures/student.py`
- [Teacher Adventures](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/adventures/teacher.py): `app/routes/adventures/teacher.py`
- [Adventure Lifecycle](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/adventure_lifecycle.py): `app/services/adventure_lifecycle.py`
- [Adventure Assignment](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/adventure_assignment.py): `app/services/adventure_assignment.py`
- [Adventure Quizzes](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/adventure_quiz.py): `app/services/adventure_quiz.py`
- [Adventure Rewards](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/adventure_rewards.py): `app/services/adventure_rewards.py`

### Student Progression

- [Abilities and Battle](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/student/abilities.py): `app/routes/student/abilities.py`
- [Battle Routes](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/student/battle.py): `app/routes/student/battle.py`
- [Clan Features](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/clan.py): `app/routes/clan.py`

### Classroom Operations

- [Class Management](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/teacher/classes.py): `app/routes/teacher/classes.py`
- [Student Management](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/routes/teacher/students_api.py): `app/routes/teacher/students_api.py`
- [Student Service](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/student_service.py): `app/services/student_service.py`
- [Student Import](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/student_import_service.py): `app/services/student_import_service.py`
- [Analytics](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/services/analytics_service.py): `app/services/analytics_service.py`

### Other components

- **Student**
- **Teacher**
- [Application Database](https://github.com/dsuth10/legends-of-learning-4/blob/main/app/models/__init__.py): `app/models/__init__.py`

## Connections

- Student → Home Router: opens
- Teacher → Home Router: opens
- Home Router → Student Dashboard: routes students
- Home Router → Teacher Dashboard: routes teachers
- Student → Authentication: signs in
- Teacher → Authentication: signs in
- Authentication → Auth Forms: validates with
- Authentication → Application Database: queries users
- Teacher Dashboard → Class Management: manages classes
- Teacher Dashboard → Student Management: manages students
- Student Management → Student Import: imports roster
- Student Import → Student Service: creates students
- Student Service → Application Database: writes users
- Teacher Dashboard → Teacher Adventures: manages adventures
- Teacher Adventures → Adventure Assignment: assigns activity
- Student Dashboard → Student Adventures: opens activities
- Student Adventures → Adventure Quizzes: handles quizzes
- Student Adventures → Adventure Lifecycle: handles progress
- Student Adventures → Adventure Rewards: grants rewards
- Student Dashboard → Abilities and Battle: uses abilities
- Student Dashboard → Battle Routes: enters battles
- Student Dashboard → Clan Features: uses clans
- Teacher Dashboard → Analytics: views analytics
- Analytics → Application Database: reads metrics
