# houssam142/1337-projects architecture

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

- Interactive diagram: https://gitdiagram.com/houssam142/1337-projects
- Repository: https://github.com/houssam142/1337-projects

## Overview

##### Project type and purpose
- This repository, “1337-projects,” is a monorepo grouping eight independent C projects from the 42/1337 curriculum:
- libft      – a custom C standard library
- get_next_line – a line-reader utility
- ft_printf  – a printf re-implementation with its own tester
- FdF        – a 3D wireframe map viewer (uses MLX)
- so_long    – a simple 2D maze-style game (uses MLX, includes textures)
- push_swap  – a constrained sorting algorithm challenge
- philosophers – the Dining Philosophers concurrency exercise
- minishell  – a miniature Unix shell

##### File structure
- Top-level directories correspond one-to-one with subprojects.
- Reusable libraries live in their own modules: libft, get_next_line, ft_printf.
- Each application has a Makefile, source (.c) and header (.h) files, and in some cases assets (so_long/texture, so_long/maps) or tests (ft_printf/printfTester).
- No cross-project build script; each module builds itself.
- Graphics apps (FdF, so_long) depend on the external MLX library.

##### README for additional insights
- README only names the repo; it does not detail architecture.
- The absence of a cross-module orchestration suggests each project is self-contained.

a. Main components
- Repository root (container)
- Library modules: libft, get_next_line, ft_printf
- Executable modules: minishell, push_swap, philosophers, FdF, so_long
- Testing module: ft_printf/printfTester
- External Dependency: MLX (graphics), standard C library
- Assets: so_long textures, maps files
b. Relationships and interactions
- Tests module → ft_printf
c. Architectural patterns / design principles
- Monorepo with side-by-side modules
- Clear separation of concerns: core libraries vs standalone apps vs tests
- Each module adheres to a simple Makefile-driven build
d. Key technologies and libraries
- C99 (gcc)
- Makefiles
- MLX (X11 binding) for FdF & so_long
- POSIX (read/write, fork/exec in minishell)
- pthreads or concurrency primitives in philosophers

##### Detailed capture of essential elements
- Don’t just list folders—show their relationships.
- “libft” and “get_next_line” as reusable core layers.
- That each application layer sits on those core layers and, for two of them, on MLX.
- PrintfTester as a QA component linked to ft_printf.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Libraries
    subgraph "Core Libraries"
        direction TB
        LIBFT["libft (core library)"]:::library
        GNL["get_next_line (core utility)"]:::library
        FTPRINTF["ft_printf (core library)"]:::library
        TEST["printfTester (test suite)"]:::test
    end

    %% Executables
    subgraph "Executables"
        direction TB
        MINISHELL["minishell (Unix shell)"]:::executable
        PUSH["push_swap (sorting executable)"]:::executable
        PHILO["philosophers (Dining Philosophers)"]:::executable
        FDF["Fdf (3D wireframe viewer)"]:::executable
        SO["so_long (2D maze game)"]:::executable
    end

    %% Bundled Modules in Fdf
    subgraph "Fdf Bundled Libraries"
        direction TB
        FDF_FTPRINTF["ft_printf (bundled)"]:::library
        FDF_GNL_C["get_next_line.c"]:::library
        FDF_GNL_H["get_next_line.h"]:::library
        FDF_GNL_UTILS["get_next_line_utils.c"]:::library
    end

    %% so_long Assets
    subgraph "so_long Assets"
        direction TB
        SO_TEXTURE["texture/"]:::executable
        SO_MAPS["maps/"]:::executable
        SO_BONUS["bonus/"]:::executable
    end

    %% Minibundles in minishell
    subgraph "minishell Bundled Libraries"
        direction TB
        MS_LIBFT["libft (bundled)"]:::library
        MS_GNL["get_next_line (bundled)"]:::library
    end

    %% External Dependency
    MLX["MLX (Graphics Library)"]:::external

    %% Dependencies Arrows
    LIBFT -->|includes| MINISHELL
    LIBFT -->|includes| PUSH
    LIBFT -->|includes| PHILO
    LIBFT -->|includes| FDF
    LIBFT -->|includes| SO

    GNL -->|includes| MINISHELL
    GNL -->|includes| PUSH
    GNL -->|includes| PHILO
    GNL -->|includes| FDF
    GNL -->|includes| SO

    FTPRINTF -->|includes| FDF
    FTPRINTF -->|includes| SO
    TEST -->|tests| FTPRINTF

    MINISHELL -->|bundles| MS_LIBFT
    MINISHELL -->|bundles| MS_GNL

    FDF -->|bundles| FDF_FTPRINTF
    FDF -->|bundles| FDF_GNL_C
    FDF -->|bundles| FDF_GNL_H
    FDF -->|bundles| FDF_GNL_UTILS

    SO -->|uses assets| SO_TEXTURE
    SO -->|uses assets| SO_MAPS
    SO -->|bonus mode| SO_BONUS

    FDF -->|uses| MLX
    SO -->|uses| MLX

    %% Click Events
    click LIBFT "https://github.com/houssam142/1337-projects/tree/main/libft/"
    click GNL "https://github.com/houssam142/1337-projects/tree/main/get_next_line/"
    click FTPRINTF "https://github.com/houssam142/1337-projects/tree/main/ft_printf/"
    click TEST "https://github.com/houssam142/1337-projects/tree/main/ft_printf/printfTester/"
    click FDF "https://github.com/houssam142/1337-projects/tree/main/Fdf/"
    click FDF_FTPRINTF "https://github.com/houssam142/1337-projects/tree/main/Fdf/ft_printf/"
    click FDF_GNL_C "https://github.com/houssam142/1337-projects/blob/main/Fdf/get_next_line.c"
    click FDF_GNL_H "https://github.com/houssam142/1337-projects/blob/main/Fdf/get_next_line.h"
    click FDF_GNL_UTILS "https://github.com/houssam142/1337-projects/blob/main/Fdf/get_next_line_utils.c"
    click SO "https://github.com/houssam142/1337-projects/tree/main/so_long/"
    click SO_TEXTURE "https://github.com/houssam142/1337-projects/tree/main/so_long/texture/"
    click SO_MAPS "https://github.com/houssam142/1337-projects/tree/main/so_long/maps/"
    click SO_BONUS "https://github.com/houssam142/1337-projects/tree/main/so_long/bonus/"
    click PUSH "https://github.com/houssam142/1337-projects/tree/main/push_swap/"
    click PHILO "https://github.com/houssam142/1337-projects/tree/main/philosophers/philo/"
    click MINISHELL "https://github.com/houssam142/1337-projects/tree/main/minishell/"
    click MS_LIBFT "https://github.com/houssam142/1337-projects/tree/main/minishell/libft/"
    click MS_GNL "https://github.com/houssam142/1337-projects/tree/main/minishell/get_next_line/"

    %% Styles
    classDef library fill:#add8e6,stroke:#333,stroke-width:1px
    classDef executable fill:#8fbc8f,stroke:#333,stroke-width:1px
    classDef external fill:#ffa500,stroke:#333,stroke-width:1px
    classDef test fill:#d3d3d3,stroke:#333,stroke-width:1px
```
