# lesam24/42madrid-journey architecture

> Architecture diagram of the GitHub repository lesam24/42madrid-journey, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lesam24/42madrid-journey
- Repository: https://github.com/lesam24/42madrid-journey

## Overview

This repository is a personal archive of independent 42 Madrid coursework, not one integrated application. Its main product areas are C utility libraries and projects, Python curriculum exercises, and Piscine C exercises. The clearest runtime workflow is push_swap: initialize and validate stacks, select an algorithm, perform stack operations, optionally report benchmark data, then clean up. Most exercises are standalone; links are shown only where the excerpts support them. Several subsystem implementations were not sampled, so their internal relationships are omitted.

Main entry points: [`M1/push_swap/main.c`](https://github.com/lesam24/42madrid-journey/blob/main/M1/push_swap/main.c) (push_swap Entry), [`M1/push_swap/parsing_init.c`](https://github.com/lesam24/42madrid-journey/blob/main/M1/push_swap/parsing_init.c) (Stack Setup), [`M1/push_swap/push_swap.c`](https://github.com/lesam24/42madrid-journey/blob/main/M1/push_swap/push_swap.c) (Algorithm Dispatch), [`M1/push_swap`](https://github.com/lesam24/42madrid-journey/tree/main/M1/push_swap) (Sorting Strategies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_c_libs["C Utility Libraries"]
  node_libft["Libft"]
end

subgraph group_c_projects["C Projects"]
  node_printf["ft_printf<br/>[ft_printf.c]"]
  node_printf_render["Format Printers<br/>[ft_print_words.c]"]
  node_gnl["Line Reader<br/>[get_next_line.c]"]
  node_gnl_demo["Reader Demo<br/>[main.c]"]
  node_push_entry["push_swap Entry<br/>[main.c]"]
  node_stack_setup["Stack Setup<br/>[parsing_init.c]"]
  node_push_parse["Argument Parsing<br/>[parsing_argv.c]"]
  node_sort_dispatch["Algorithm Dispatch<br/>[push_swap.c]"]
  node_sort_algorithms["Sorting Strategies"]
  node_stack_moves["Stack Operations<br/>[move_push.c]"]
  node_benchmark["Benchmark Reporting"]
end

subgraph group_python["Python Modules"]
  node_py00["Garden Basics"]
  node_py01["Plant Models"]
  node_py02["Error Handling"]
  node_py03["Data Systems"]
end

subgraph group_piscine["Piscine Exercises"]
  node_c00["C00 Exercises"]
  node_c01["C01 Exercises"]
  node_c02["C02 Exercises"]
  node_c03["C03 Exercises"]
  node_c04["C04 Exercises"]
end

node_push_user(("Program User"))

node_push_user -->|"runs"| node_push_entry
node_push_entry -->|"initializes"| node_stack_setup
node_push_entry -->|"dispatches"| node_sort_dispatch
node_push_entry -->|"reports optionally"| node_benchmark
node_push_entry -->|"clears stacks"| node_stack_moves
node_stack_setup -.->|"parses arguments"| node_push_parse
node_sort_dispatch -.->|"selects strategy"| node_sort_algorithms
node_sort_algorithms -.->|"issues operations"| node_stack_moves
node_gnl_demo -->|"reads lines"| node_gnl
node_printf -.->|"formats values"| node_printf_render

click node_libft "https://github.com/lesam24/42madrid-journey/tree/main/M0/libft"
click node_printf "https://github.com/lesam24/42madrid-journey/blob/main/M1/ft_printf/ft_printf.c"
click node_printf_render "https://github.com/lesam24/42madrid-journey/blob/main/M1/ft_printf/ft_print_words.c"
click node_gnl "https://github.com/lesam24/42madrid-journey/blob/main/M1/get_next_line/get_next_line.c"
click node_gnl_demo "https://github.com/lesam24/42madrid-journey/blob/main/M1/get_next_line/main.c"
click node_push_entry "https://github.com/lesam24/42madrid-journey/blob/main/M1/push_swap/main.c"
click node_stack_setup "https://github.com/lesam24/42madrid-journey/blob/main/M1/push_swap/parsing_init.c"
click node_push_parse "https://github.com/lesam24/42madrid-journey/blob/main/M1/push_swap/parsing_argv.c"
click node_sort_dispatch "https://github.com/lesam24/42madrid-journey/blob/main/M1/push_swap/push_swap.c"
click node_sort_algorithms "https://github.com/lesam24/42madrid-journey/tree/main/M1/push_swap"
click node_stack_moves "https://github.com/lesam24/42madrid-journey/blob/main/M1/push_swap/move_push.c"
click node_benchmark "https://github.com/lesam24/42madrid-journey/tree/main/M1/push_swap"
click node_py00 "https://github.com/lesam24/42madrid-journey/tree/main/M2/Python%20Module%2000"
click node_py01 "https://github.com/lesam24/42madrid-journey/tree/main/M2/Python%20Module%2001"
click node_py02 "https://github.com/lesam24/42madrid-journey/tree/main/M2/Python%20Module%2002"
click node_py03 "https://github.com/lesam24/42madrid-journey/tree/main/M2/Python%20Module%2003"
click node_c00 "https://github.com/lesam24/42madrid-journey/tree/main/Piscine/C00"
click node_c01 "https://github.com/lesam24/42madrid-journey/tree/main/Piscine/C01"
click node_c02 "https://github.com/lesam24/42madrid-journey/tree/main/Piscine/C02"
click node_c03 "https://github.com/lesam24/42madrid-journey/tree/main/Piscine/C03"
click node_c04 "https://github.com/lesam24/42madrid-journey/tree/main/Piscine/C04"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_libft,node_push_user toneBlue
class node_printf,node_printf_render,node_gnl,node_gnl_demo,node_push_entry,node_stack_setup,node_push_parse,node_sort_dispatch,node_sort_algorithms,node_stack_moves,node_benchmark toneAmber
class node_py00,node_py01,node_py02,node_py03 toneMint
class node_c00,node_c01,node_c02,node_c03,node_c04 toneRose
```

## Components

### C Utility Libraries

- [Libft](https://github.com/lesam24/42madrid-journey/tree/main/M0/libft): `M0/libft`

### C Projects

- [ft_printf](https://github.com/lesam24/42madrid-journey/blob/main/M1/ft_printf/ft_printf.c): `M1/ft_printf/ft_printf.c`
- [Format Printers](https://github.com/lesam24/42madrid-journey/blob/main/M1/ft_printf/ft_print_words.c): `M1/ft_printf/ft_print_words.c`
- [Line Reader](https://github.com/lesam24/42madrid-journey/blob/main/M1/get_next_line/get_next_line.c): `M1/get_next_line/get_next_line.c`
- [Reader Demo](https://github.com/lesam24/42madrid-journey/blob/main/M1/get_next_line/main.c): `M1/get_next_line/main.c`
- [push_swap Entry](https://github.com/lesam24/42madrid-journey/blob/main/M1/push_swap/main.c): `M1/push_swap/main.c`
- [Stack Setup](https://github.com/lesam24/42madrid-journey/blob/main/M1/push_swap/parsing_init.c): `M1/push_swap/parsing_init.c`
- [Argument Parsing](https://github.com/lesam24/42madrid-journey/blob/main/M1/push_swap/parsing_argv.c): `M1/push_swap/parsing_argv.c`
- [Algorithm Dispatch](https://github.com/lesam24/42madrid-journey/blob/main/M1/push_swap/push_swap.c): `M1/push_swap/push_swap.c`
- [Sorting Strategies](https://github.com/lesam24/42madrid-journey/tree/main/M1/push_swap): `M1/push_swap`
- [Stack Operations](https://github.com/lesam24/42madrid-journey/blob/main/M1/push_swap/move_push.c): `M1/push_swap/move_push.c`
- [Benchmark Reporting](https://github.com/lesam24/42madrid-journey/tree/main/M1/push_swap): `M1/push_swap`

### Python Modules

- [Garden Basics](https://github.com/lesam24/42madrid-journey/tree/main/M2/Python%20Module%2000): `M2/Python Module 00`
- [Plant Models](https://github.com/lesam24/42madrid-journey/tree/main/M2/Python%20Module%2001): `M2/Python Module 01`
- [Error Handling](https://github.com/lesam24/42madrid-journey/tree/main/M2/Python%20Module%2002): `M2/Python Module 02`
- [Data Systems](https://github.com/lesam24/42madrid-journey/tree/main/M2/Python%20Module%2003): `M2/Python Module 03`

### Piscine Exercises

- [C00 Exercises](https://github.com/lesam24/42madrid-journey/tree/main/Piscine/C00): `Piscine/C00`
- [C01 Exercises](https://github.com/lesam24/42madrid-journey/tree/main/Piscine/C01): `Piscine/C01`
- [C02 Exercises](https://github.com/lesam24/42madrid-journey/tree/main/Piscine/C02): `Piscine/C02`
- [C03 Exercises](https://github.com/lesam24/42madrid-journey/tree/main/Piscine/C03): `Piscine/C03`
- [C04 Exercises](https://github.com/lesam24/42madrid-journey/tree/main/Piscine/C04): `Piscine/C04`

### Other components

- **Program User**

## Connections

- Program User → push_swap Entry: runs (evidence: `M1/push_swap/main.c`)
- push_swap Entry → Stack Setup: initializes (evidence: `M1/push_swap/main.c`)
- push_swap Entry → Algorithm Dispatch: dispatches (evidence: `M1/push_swap/main.c`)
- push_swap Entry → Benchmark Reporting: reports optionally (evidence: `M1/push_swap/main.c`)
- push_swap Entry → Stack Operations: clears stacks (evidence: `M1/push_swap/main.c`)
- Stack Setup → Argument Parsing: parses arguments
- Algorithm Dispatch → Sorting Strategies: selects strategy
- Sorting Strategies → Stack Operations: issues operations
- Reader Demo → Line Reader: reads lines (evidence: `M1/get_next_line/main.c`)
- ft_printf → Format Printers: formats values
