# morilhat-paul/template architecture

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

- Interactive diagram: https://gitdiagram.com/morilhat-paul/template
- Repository: https://github.com/morilhat-paul/template

## Overview

##### Project type and purpose
- This is a “template” C project intended to provide reusable utility libraries (“my” and “chained_list”), a simple application entry-point (sources/main.c), plus a full build/test/CI setup.
- Its purpose is to serve as a starting point for Epitech C assignments: you link against the two libraries and run your own code.

##### File structure
- Top-level directories:
- /            → public headers for the template application
- lib/my/             → “my” utility library (strings, arrays, maths, I/O)
- lib/chained_list/   → singly-linked list operations
- sources/            → main.c, template.c, helper functions
- tests/              → unitary and functional test suites
- .github/workflows/  → CI definitions
- Build scripts:
- Makefile at root orchestrates building application, libraries, and tests.
- Each lib subdir has its own Makefile for isolated compilation.
- CI: GitHub Actions workflows build and run tests on every push.

##### README for additional insights
- Confirms modular separation: core application + two independent static libraries + test harness.

a. Main components
- Application Module (sources/main.c, template.c, is_helper.c)
- Utility Library “my” (lib/my/include + lib/my/sources)
- Library “chained_list” (lib/chained_list/include + sources)
- Build System (Makefiles)
- Test Suite (tests/unitary & tests/functional)
- Continuous Integration (GitHub workflows)

b. Relationships & interactions
- Application Module → links against → “my” library + “chained_list” library
- Tests → depend on → compiled libraries + application code
- Makefile → orchestrates → compile libs → compile main → compile/run tests
- CI Workflow → triggers → Makefile targets + code coverage reporting

c. Architectural patterns & design principles
- Modular static libraries: clear separation of concerns (string/math utilities vs data-structure utilities).
- Layered build: each library has its own Makefile, root Makefile aggregates.
- Test-driven organization: unitary tests map to each function; functional tests validate end-to-end behavior.

d. Key technologies/frameworks
- C99 standard
- GNU Make
- Bash (functional tests)
- GitHub Actions for CI
- Codecov for coverage reports

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Code Layer
    subgraph "Code Layer"
        direction TB
        LibMy["Lib: my"]:::code
        LibChained["Lib: chained_list"]:::code
        AppModule["App Module"]:::code
    end

    %% Build Layer
    subgraph "Build System" 
        direction TB
        RootMake["Root Makefile"]:::artifact
        LibAggregateMake["Lib Aggregate Makefile"]:::artifact
        TestMake["Test Makefile"]:::artifact
    end

    %% Test Layer
    subgraph "Test Suite"
        direction TB
        UnitTests["Unitary Tests"]:::test
        FuncTests["Functional Tests"]:::test
    end

    %% CI Layer
    subgraph "CI Pipeline"
        direction TB
        CIWorkflow["CI Workflows"]:::ci
    end

    %% Relationships
    RootMake -->|"orchestrates build"| LibAggregateMake
    RootMake -->|"orchestrates build"| AppModule
    LibAggregateMake -->|"builds"| LibMy
    LibAggregateMake -->|"builds"| LibChained
    RootMake -->|"runs"| TestMake
    TestMake -->|"executes"| UnitTests
    TestMake -->|"executes"| FuncTests
    AppModule -->|"links against"| LibMy
    AppModule -->|"links against"| LibChained
    UnitTests -->|"link/app to"| LibMy
    UnitTests -->|"link/app to"| LibChained
    FuncTests -->|"link/app to"| LibMy
    FuncTests -->|"link/app to"| LibChained
    CIWorkflow -->|"triggers"| RootMake
    CIWorkflow -->|"triggers"| TestMake

    %% Click Events
    click AppModule "https://github.com/morilhat-paul/template/tree/main/sources"
    click LibMy "https://github.com/morilhat-paul/template/tree/main/lib/my"
    click LibChained "https://github.com/morilhat-paul/template/tree/main/lib/chained_list"
    click RootMake "https://github.com/morilhat-paul/template/tree/main/Makefile"
    click LibAggregateMake "https://github.com/morilhat-paul/template/tree/main/lib/Makefile"
    click TestMake "https://github.com/morilhat-paul/template/tree/main/tests/Makefile"
    click UnitTests "https://github.com/morilhat-paul/template/tree/main/tests/unitary/"
    click FuncTests "https://github.com/morilhat-paul/template/tree/main/tests/functional/"
    click CIWorkflow "https://github.com/morilhat-paul/template/blob/main/.github/workflows/workflow.yaml"
    click CIWorkflow "https://github.com/morilhat-paul/template/blob/main/.github/workflows/upload_tests.yaml"

    %% Styles
    classDef code fill:#cdefff,stroke:#0366d6,color:#0366d6;
    classDef artifact fill:#d0f0c0,stroke:#228B22,color:#228B22;
    classDef test fill:#ffd8b1,stroke:#ff8c00,color:#ff8c00;
    classDef ci fill:#e1c4e6,stroke:#800080,color:#800080;
```
