# quinnkwolter/modulearn architecture

> Architecture diagram of the GitHub repository quinnkwolter/modulearn, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/quinnkwolter/modulearn
- Repository: https://github.com/quinnkwolter/modulearn

## Overview

##### Main Components

A. External Systems Layer:
- Canvas LMS (with LTI 1.3 integration)
- External Content Authoring Tools
- PostgreSQL Database

B. Application Core (Django Apps):
- LTI Module (Authentication & Integration)
- Accounts Module (User Management)
- Courses Module (Content Management)
- Dashboard Module (User Interfaces)
- Main Module (Core Application)

**[Client Tier]**
- ↕
**[Application Tier]**
- ↕
**[Data Tier]**

##### Component Details

a) Client Tier:
- Canvas LMS Interface
- Standalone Web Interface

b) Application Tier (Core Components):
- Within this container, create separate modules for:
- LTI Handler (OAuth2, Grade Services)
- Course Management
- User Management
- Content Delivery
- Progress Tracking
- Internal communication paths between modules

c) Data Tier:
- PostgreSQL Database
- Cache Storage (for LTI data)

##### Interaction Flows

- LTI authentication flow
- Content delivery path
- Grade submission flow
- User session management
- Database interactions

##### Technical Details

- Django WSGI/ASGI Server
- Static File Handling
- Template Layer
- URL Routing System
- Model Relationships

##### Notes Section

Annotations for:
- Authentication flows
- Grade submission process
- Content delivery pipeline
- Progress tracking mechanism

##### Data flow for progress tracking and grading

Keep the abstraction level high enough to show the overall architecture while including sufficient detail to understand the key components and their interactions. Focus on showing how the different Django apps (accounts, courses, dashboard, lti, main) interact with each other and external systems.

Remember to highlight the scalability aspects and how the system handles different types of smart content through the modular architecture.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef external fill:#85C1E9,stroke:#2E86C1
    classDef core fill:#82E0AA,stroke:#229954
    classDef auth fill:#F7DC6F,stroke:#D4AC0D
    classDef data fill:#BFC9CA,stroke:#717D7E
    classDef ui fill:#F5B041,stroke:#E67E22

    %% External Systems Layer
    subgraph ExternalSystems
        Canvas["Canvas LMS\n(LTI 1.3)"]:::external
        AuthTools["Content Authoring\nTools"]:::external
    end

    %% Client Layer
    subgraph ClientLayer
        CanvasUI["Canvas Interface"]:::ui
        WebUI["Standalone Web\nInterface"]:::ui
    end

    %% Application Core
    subgraph AppCore["ModuLearn Django Application"]
        %% LTI Module
        subgraph LTIModule
            LTIHandler["LTI Handler"]
            LTIConfig["LTI Configuration"]
            LTICache["LTI Cache Storage"]
            LTISecurity["Security Layer"]
        end
        click LTIHandler "https://github.com/QuinnKWolter/ModuLearn/tree/main/modulearn/lti/"
        click LTIConfig "https://github.com/QuinnKWolter/ModuLearn/blob/main/modulearn/lti/tool_config.py"
        click LTICache "https://github.com/QuinnKWolter/ModuLearn/blob/main/modulearn/lti/cache_data_storage.py"
        click LTISecurity "https://github.com/QuinnKWolter/ModuLearn/blob/main/modulearn/modulearn/private.key"

        %% Core Modules
        subgraph CoreModules
            AccountsMgmt["Accounts Management"]
            CourseMgmt["Course Management"]
            DashboardMgmt["Dashboard System"]
            MainApp["Main Application"]
        end
        click AccountsMgmt "https://github.com/QuinnKWolter/ModuLearn/tree/main/modulearn/accounts/"
        click CourseMgmt "https://github.com/QuinnKWolter/ModuLearn/tree/main/modulearn/courses/"
        click DashboardMgmt "https://github.com/QuinnKWolter/ModuLearn/tree/main/modulearn/dashboard/"
        click MainApp "https://github.com/QuinnKWolter/ModuLearn/tree/main/modulearn/main/"

        %% Application Services
        subgraph AppServices
            ContentDelivery["Content Delivery"]
            ProgressTracker["Progress Tracking"]
            GradeEngine["Grade Calculation"]
        end
    end

    %% Data Layer
    subgraph DataLayer
        DB[(PostgreSQL)]:::data
        Cache[(Cache Storage)]:::data
    end

    %% Frontend Assets
    subgraph FrontendAssets
        Templates["Base Templates"]
        StaticFiles["Static Files"]
    end
    click Templates "https://github.com/QuinnKWolter/ModuLearn/tree/main/modulearn/templates/"
    click StaticFiles "https://github.com/QuinnKWolter/ModuLearn/tree/main/modulearn/static/"

    %% Configuration
    subgraph Config
        Settings["Core Settings"]
        URLConf["URL Configuration"]
        WSGIConf["WSGI/ASGI Config"]
    end
    click Settings "https://github.com/QuinnKWolter/ModuLearn/blob/main/modulearn/modulearn/settings.py"
    click URLConf "https://github.com/QuinnKWolter/ModuLearn/blob/main/modulearn/modulearn/urls.py"
    click WSGIConf "https://github.com/QuinnKWolter/ModuLearn/blob/main/modulearn/modulearn/wsgi.py"

    %% Connections
    Canvas --> LTIHandler
    AuthTools --> ContentDelivery
    CanvasUI --> LTIHandler
    WebUI --> MainApp
    LTIHandler --> LTIConfig
    LTIHandler --> LTISecurity
    LTIHandler --> LTICache
    AccountsMgmt --> DB
    CourseMgmt --> DB
    DashboardMgmt --> DB
    MainApp --> DB
    ContentDelivery --> Cache
    ProgressTracker --> DB
    GradeEngine --> LTIHandler

    %% Style Applications
    class Canvas,AuthTools external
    class LTIHandler,LTIConfig,LTICache,LTISecurity auth
    class AccountsMgmt,CourseMgmt,DashboardMgmt,MainApp core
    class DB,Cache data
    class CanvasUI,WebUI ui
```
