# mykolas-alt/fp-2024 architecture

> Architecture diagram of the GitHub repository mykolas-alt/fp-2024, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mykolas-alt/fp-2024
- Repository: https://github.com/mykolas-alt/fp-2024

## Overview

##### Main Components

a) Development Environment Layer:
- Docker Container Environment
- VS Code Development Interface
- DevContainer Configuration

b) Project Structure Layer:
- Lessons Module (src/Lessons/*)
- Multiple Applications (app1-4)
- Core Libraries (Lib1, Lib2, Lib3)
- Parser Components
- Test Framework

c) Build & Testing Layer:
- Stack Build System
- Test Suite
- Doctest System

**[Development Environment Layer]**
- ↕
**[Project Structure Layer]**
- ↕
**[Build & Testing Layer]**

##### Component Relationships

- How the DevContainer encapsulates the entire development environment
- Relationship between source modules and applications
- Demonstrate how the parser components interact with the libraries
- Test coverage across components

##### Specific Implementation Details

- Rectangles: Main components (Apps, Libraries)
- Hexagons: Parser components
- Rounded rectangles: Lesson modules

##### Key Elements to Highlight

a) Multiple Application Structure:
- Relationship between app1-4 (client/server architecture for app4)
- Demonstrate how they depend on the core libraries

b) Educational Component:
- Lesson structure (Lesson01-12)
- How lessons interact with the core libraries

c) Testing Framework:
- Relationship between tests and source code
- Doctest integration

## Diagram (Mermaid)

```mermaid
graph TB
    %% Title
    title[Educational Haskell Project Architecture]:::title
    
    %% Development Environment Layer
    subgraph DevEnv[Development Environment]
        Docker["Docker Container"]
        VSCode["VS Code IDE"]
        DevConfig["DevContainer Config"]
        Docker --> VSCode
        Docker --> DevConfig
    end
    
    %% Project Structure Layer
    subgraph ProjectStructure[Project Structure]
        %% Core Libraries
        subgraph CoreLibs[Core Libraries]
            Lib1["Library 1"]:::library
            Lib2["Library 2"]:::library
            Lib3["Library 3"]:::library
        end
        
        %% Parser Components
        subgraph Parsers[Parser Components]
            MainParser["Main Parser"]:::parser
            PrimParser["Primitive Parsers"]:::parser
            PrimParser --> MainParser
        end
        
        %% Lessons
        subgraph LessonsModule[Lessons Module]
            Lesson01["Lesson 01"]:::lesson
            Lesson02["Lesson 02"]:::lesson
            LessonN["..."]:::lesson
            Lesson12["Lesson 12"]:::lesson
        end
        
        %% Applications
        subgraph Apps[Applications]
            App1["Application 1"]:::app
            App2["Application 2"]:::app
            App3["Application 3"]:::app
            subgraph App4[Application 4]
                App4Client["Client"]:::app
                App4Server["Server"]:::app
                App4Client <--> App4Server
            end
        end
    end
    
    %% Build & Testing Layer
    subgraph BuildTest[Build & Testing]
        Stack["Stack Build System"]:::build
        TestSuite["Test Suite"]:::test
        Doctest["Doctest System"]:::test
        GHWorkflow["GitHub Workflow"]:::cicd
    end
    
    %% Relationships
    CoreLibs --> Apps
    Parsers --> CoreLibs
    LessonsModule --> CoreLibs
    Stack --> ProjectStructure
    TestSuite --> ProjectStructure
    Doctest --> ProjectStructure
    DevEnv --> ProjectStructure
    
    %% Click Events
    click Docker "https://github.com/mykolas-alt/fp-2024/tree/main/.devcontainer/Dockerfile"
    click DevConfig "https://github.com/mykolas-alt/fp-2024/blob/main/.devcontainer/devcontainer.json"
    click VSCode "https://github.com/mykolas-alt/fp-2024/tree/main/.vscode/"
    click Lib1 "https://github.com/mykolas-alt/fp-2024/blob/main/src/Lib1.hs"
    click Lib2 "https://github.com/mykolas-alt/fp-2024/blob/main/src/Lib2.hs"
    click Lib3 "https://github.com/mykolas-alt/fp-2024/blob/main/src/Lib3.hs"
    click MainParser "https://github.com/mykolas-alt/fp-2024/blob/main/src/Parsers.hs"
    click PrimParser "https://github.com/mykolas-alt/fp-2024/blob/main/src/PrimitiveParsers.hs"
    click LessonsModule "https://github.com/mykolas-alt/fp-2024/tree/main/src/Lessons/"
    click Lesson01 "https://github.com/mykolas-alt/fp-2024/blob/main/src/Lessons/Lesson01.hs"
    click Lesson12 "https://github.com/mykolas-alt/fp-2024/blob/main/src/Lessons/Lesson12.hs"
    click App1 "https://github.com/mykolas-alt/fp-2024/blob/main/app1/Main.hs"
    click App2 "https://github.com/mykolas-alt/fp-2024/blob/main/app2/Main.hs"
    click App3 "https://github.com/mykolas-alt/fp-2024/blob/main/app3/Main.hs"
    click App4Client "https://github.com/mykolas-alt/fp-2024/blob/main/app4-client/Main.hs"
    click App4Server "https://github.com/mykolas-alt/fp-2024/blob/main/app4-server/Main.hs"
    click Stack "https://github.com/mykolas-alt/fp-2024/blob/main/stack.yaml"
    click TestSuite "https://github.com/mykolas-alt/fp-2024/blob/main/test/Spec.hs"
    click Doctest "https://github.com/mykolas-alt/fp-2024/blob/main/doctest/Doctest.hs"
    click GHWorkflow "https://github.com/mykolas-alt/fp-2024/blob/main/.github/workflows/haskell.yml"
    
    %% Styling
    classDef default fill:#fff,stroke:#333,stroke-width:2px;
    classDef title fill:#f9f,stroke:#333,stroke-width:4px;
    classDef app fill:#ff9,stroke:#333;
    classDef library fill:#9f9,stroke:#333;
    classDef parser fill:#f90,stroke:#333;
    classDef lesson fill:#99f,stroke:#333;
    classDef build fill:#9ff,stroke:#333;
    classDef test fill:#f9f,stroke:#333;
    classDef cicd fill:#f99,stroke:#333;
```
