# mrlion73/morpion architecture

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

- Interactive diagram: https://gitdiagram.com/mrlion73/morpion
- Repository: https://github.com/mrlion73/morpion

## Overview

##### Project type and purpose
- This is a small C++ desktop GUI application (a “Morpion” or Tic-Tac-Toe clone), primarily used as a learning exercise for CMake, CPack, and GitHub workflows.

##### File structure
- Top-level:
- README.md, LICENSE, .gitignore – documentation and metadata
- src/ – all source code and build scripts
- Inside src/:
- CMakeLists.txt – build configuration
- main.cpp – application entry point
- mainwindow.h/.cpp – GUI window class (View + Controller logic)
- No separate “model” directory, so game logic likely lives in mainwindow.cpp or main.cpp.

##### README for additional insights
- Build uses CMake (MinGW Makefiles)
- Packaging uses CPack, requires a “deploy” folder with DLLs
- No mention of external services or databases – it’s purely a local desktop app

##### Main components
a. Source & Build Layer
– CMakeLists.txt (generator of build system)
– Build tool: cmake / mingw-make
– CPack (packaging tool)
b. Runtime Components
– Executable (“Morpion.exe”)
– GUI Layer (MainWindow class + Qt or WinAPI underneath)
– External DLL dependencies (listed in deploy folder)
c. Developer Workflow
– GitHub repo (push/pull triggers CI, releases)
– Release artifacts (ZIP with deploy folder)

##### Relationships & data flow
- CMakeLists.txt feeds into the build tool → produces the executable and resource object files.
- CPack reads build outputs + “deploy” folder → packages final installer/ZIP.
- The executable dynamically loads required DLLs shipped alongside.

##### Architectural patterns & tech stack
- Technology: C++17 (or similar), CMake, CPack, MinGW, Windows resource compiler (.rc/.res)
- Pattern: Single-binary desktop app, combining View (mainwindow UI) and Controller (game rules) in one module.
- No external services, no database.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Project Metadata
    subgraph "Project Metadata"
        MD1[".gitignore"]:::metadata
        MD2["LICENSE"]:::metadata
        MD3["README.md"]:::metadata
    end

    %% Source Code & Resources
    subgraph "Source Code & Resources"
        SC1["main.cpp"]:::code
        SC2["mainwindow.h/.cpp"]:::code
        SC3["ressources/icons"]:::codeResources
    end

    %% Build Pipeline
    subgraph "Build Pipeline"
        CML["CMakeLists.txt"]:::buildTools
        BT["Build Tool (cmake / mingw-make)"]:::buildTools
        CML -->|"configures"| BT
        BT -->|"compiles & links"| EXE["Morpion.exe"]:::runtime
    end

    %% Packaging
    subgraph "Packaging"
        DEPLOY["deploy folder (DLLs)"]:::external
        CPACK["CPack"]:::packaging
        EXE & DEPLOY -->|"inputs"| CPACK
        CPACK -->|"produces"| DIST["ZIP/Installer"]:::packaging
    end

    %% Runtime Interaction
    subgraph "Runtime Components"
        EXE -->|"initializes GUI"| GUI["GUI (MainWindow)"]:::runtime
        EXE -->|"loads embedded resources"| SC3
        EXE -->|"dynamically loads"| DLLS["External DLLs"]:::external
    end

    %% Developer Workflow
    subgraph "Developer Workflow"
        REPO["GitHub Repo"]:::external
        REPO -->|"push/pull triggers CI & releases"| DIST
    end

    %% Click Events
    click MD1 "https://github.com/mrlion73/morpion/blob/main/.gitignore"
    click MD2 "https://github.com/mrlion73/morpion/tree/main/LICENSE"
    click MD3 "https://github.com/mrlion73/morpion/blob/main/README.md"
    click CML "https://github.com/mrlion73/morpion/blob/main/src/CMakeLists.txt"
    click SC1 "https://github.com/mrlion73/morpion/blob/main/src/main.cpp"
    click SC2 "https://github.com/mrlion73/morpion/blob/main/src/mainwindow.h"
    click SC2 "https://github.com/mrlion73/morpion/blob/main/src/mainwindow.cpp"
    click SC3 "https://github.com/mrlion73/morpion/tree/main/src/ressources/icons"
    click SC3 "https://github.com/mrlion73/morpion/blob/main/src/ressources/icons/icon.rc"
    click SC3 "https://github.com/mrlion73/morpion/blob/main/src/ressources/icons/icon.res"

    %% Styles
    classDef buildTools fill:#D6EAF8,stroke:#1B4F72,stroke-width:1px
    classDef code fill:#D5F5E3,stroke:#145A32,stroke-width:1px
    classDef codeResources fill:#D5F5E3,stroke:#117A65,stroke-width:1px
    classDef packaging fill:#FAD7A0,stroke:#B9770E,stroke-width:1px
    classDef runtime fill:#FCF3CF,stroke:#7D6608,stroke-width:1px
    classDef external fill:#E5E8E8,stroke:#424949,stroke-width:1px
    classDef metadata fill:#F2F3F4,stroke:#566573,stroke-width:1px
```
