# eidu/sample-learning-app architecture

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

- Interactive diagram: https://gitdiagram.com/eidu/sample-learning-app
- Repository: https://github.com/eidu/sample-learning-app

## Overview

##### Main Components

a. Application Layer:
- Sample Learning App (Android Application)
- EIDU Platform Integration
- Learning Package Management

b. Development Infrastructure:
- Custom KtLint Rules System
- Build System (Gradle)
- CI/CD Pipeline

**Top Tier: Application Components**

**Middle Tier: Integration Layer**

**Bottom Tier: Infrastructure**

##### Key Elements

a. Application Components (Top Tier):
- Main Activity (entry point)
- Learning Unit Run ViewModel (business logic)
- UI Components (using Jetpack Compose, indicated by EiduScaffold)
- Theme System
- Utility Services (Stopwatch, ForegroundStopwatch)

b. Integration Layer (Middle Tier):
- EIDU Platform Interface
- Learning Package Handler
- Asset Management System (connecting to /assets directory)

c. Infrastructure Components (Bottom Tier):
- Custom KtLint Rules Engine
- Build System Configuration
- Testing Framework
- Resource Management

##### Relationships and Data Flow

- User interaction flow through the UI
- Data flow between ViewModel and UI
- Learning package asset loading
- Integration points with EIDU platform
- Build and validation processes

##### Technical Details to Highlight

- Kotlin-based architecture
- Android Jetpack components usage
- Custom lint rules implementation
- Resource management system
- Test infrastructure

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Application
        MA["Main Activity"]:::app
        LVM["Learning Unit Run ViewModel"]:::app
        UI["UI Components (EiduScaffold)"]:::app
        Theme["Theme System"]:::app
        Utils["Utility Services"]:::app
        SLA["Sample Learning App"]:::app
    end

    subgraph Integration
        EPI["EIDU Platform Interface"]:::integration
        LPH["Learning Package Handler"]:::integration
        AMS["Asset Management System"]:::integration
    end

    subgraph Infrastructure
        KLS["Custom KtLint Rules"]:::infra
        BS["Build System"]:::infra
        TF["Testing Framework"]:::infra
        CICD["CI/CD Pipeline"]:::infra
    end

    %% Application Layer Relationships
    SLA --> MA
    MA --> LVM
    MA --> UI
    UI --> Theme
    LVM --> Utils

    %% Integration Layer Relationships
    MA --> EPI
    LVM --> LPH
    LPH --> AMS

    %% Infrastructure Relationships
    KLS --> BS
    BS --> CICD
    TF --> CICD

    %% Click Events
    click SLA "https://github.com/EIDU/sample-learning-app/blob/main/sample-learning-app/src/main/kotlin/com/eidu/integration/sample/app/IntegrationSampleApplication.kt"
    click MA "https://github.com/EIDU/sample-learning-app/blob/main/sample-learning-app/src/main/kotlin/com/eidu/integration/sample/app/ui/MainActivity.kt"
    click LVM "https://github.com/EIDU/sample-learning-app/blob/main/sample-learning-app/src/main/kotlin/com/eidu/integration/sample/app/ui/LearningUnitRunViewModel.kt"
    click UI "https://github.com/EIDU/sample-learning-app/blob/main/sample-learning-app/src/main/kotlin/com/eidu/integration/sample/app/shared/EiduScaffold.kt"
    click Theme "https://github.com/EIDU/sample-learning-app/tree/main/sample-learning-app/src/main/kotlin/com/eidu/integration/sample/app/theme"
    click Utils "https://github.com/EIDU/sample-learning-app/tree/main/sample-learning-app/src/main/kotlin/com/eidu/integration/sample/app/util"
    click KLS "https://github.com/EIDU/sample-learning-app/tree/main/custom-ktlint-rules/src/main/kotlin/com/eidu/custom_ktlint_rules"
    click LPH "https://github.com/EIDU/sample-learning-app/blob/main/learning-package/units.json"
    click AMS "https://github.com/EIDU/sample-learning-app/tree/main/learning-package/assets"
    click CICD "https://github.com/EIDU/sample-learning-app/blob/main/.github/workflows/ci.yml"
    click TF "https://github.com/EIDU/sample-learning-app/blob/main/sample-learning-app/src/test/kotlin/com/eidu/integration/sample/app/ui/LearningUnitRunViewModelTest.kt"

    %% Styling
    classDef app fill:#2196F3,stroke:#1565C0,color:white
    classDef integration fill:#4CAF50,stroke:#2E7D32,color:white
    classDef infra fill:#FF9800,stroke:#EF6C00,color:white

    %% Legend
    subgraph Legend
        L1["Application Components"]:::app
        L2["Integration Layer"]:::integration
        L3["Infrastructure"]:::infra
    end
```
