# openrsi/tp_progc architecture

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

- Interactive diagram: https://gitdiagram.com/openrsi/tp_progc
- Repository: https://github.com/openrsi/tp_progc

## Overview

##### Project type and purpose
- This is an educational monorepo containing six independent C “travaux pratiques” (TP1–TP6) for a C programming course.
- Each TP folder represents one set of exercises demonstrating a particular topic (basic operators, pointers, file I/O, data structures, client-server sockets, BMP image handling, etc.).

##### File structure
- Top level:
- .gitignore, README.md – repo metadata
- TP1 … TP6 – six separate lab assignments
- evaluation, gdb, images – auxiliary scripts and docs
- Inside each TPx:
- TPx.md – exercise descriptions
- src/ – C source files and headers, sometimes a Makefile
- TP5 adds an “etudiant” directory simulating student data files
- Patterns:
- TP1–TP3: standalone small C programs illustrating basic constructs
- TP4: adds modular code with .h/.c pairs and a main.c
- TP5–TP6: client/server architecture and advanced I/O (file system for notes, BMP image processing)

##### README for additional insights
- Confirms educational goal: demonstrate compilation chain, standard libraries, system calls, buffers, structures, simple client-server, testing.

##### Essential elements
- Clear labels: name each TP module and its purpose.
- Data flow in client-server (TP5 & TP6).
- Build flow: source → compiler → binary.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% TP Modules
    subgraph "TP1 Module" 
        TP1_md["TP1.md"]:::module
        TP1_src["src/"]:::module
    end
    click TP1_md "https://github.com/openrsi/tp_progc/blob/master/TP1/TP1.md"
    click TP1_src "https://github.com/openrsi/tp_progc/tree/master/TP1/src/"

    subgraph "TP2 Module"
        TP2_md["TP2.md"]:::module
        TP2_src["src/"]:::module
    end
    click TP2_md "https://github.com/openrsi/tp_progc/blob/master/TP2/TP2.md"
    click TP2_src "https://github.com/openrsi/tp_progc/tree/master/TP2/src/"

    subgraph "TP3 Module"
        TP3_md["TP3.md"]:::module
        TP3_src["src/"]:::module
    end
    click TP3_md "https://github.com/openrsi/tp_progc/blob/master/TP3/TP3.md"
    click TP3_src "https://github.com/openrsi/tp_progc/tree/master/TP3/src/"

    subgraph "TP4 Module"
        TP4_md["TP4.md"]:::module
        TP4_src["src/"]:::module
    end
    click TP4_md "https://github.com/openrsi/tp_progc/blob/master/TP4/TP4.md"
    click TP4_src "https://github.com/openrsi/tp_progc/tree/master/TP4/src/"

    subgraph "TP5 Module"
        TP5_md["TP5.md"]:::module
        TP5_src["src/"]:::module
        TP5_client["Client"]:::module
        TP5_server["Server"]:::module
        TP5_data["Student Data Dir"]:::storage
    end
    click TP5_md "https://github.com/openrsi/tp_progc/blob/master/TP5/TP5.md"
    click TP5_src "https://github.com/openrsi/tp_progc/tree/master/TP5/src/"
    click TP5_data "https://github.com/openrsi/tp_progc/tree/master/TP5/etudiant/"

    subgraph "TP6 Module"
        TP6_md["TP6.md"]:::module
        TP6_src["src/"]:::module
        TP6_client["Client"]:::module
        TP6_server["Server"]:::module
    end
    click TP6_md "https://github.com/openrsi/tp_progc/blob/master/TP6/TP6.md"
    click TP6_src "https://github.com/openrsi/tp_progc/tree/master/TP6/src/"

    %% Network and Storage
    Net["TCP Socket"]:::network
    FS["Filesystem (Notes/BMP)"]:::storage

    %% Shared Utilities
    subgraph "Shared Utilities"
        Eval["evaluation.sh"]:::utility
        GDB["gdb/README.md"]:::utility
        Img["images/"]:::utility
    end
    click Eval "https://github.com/openrsi/tp_progc/blob/master/evaluation/evaluation.sh"
    click GDB "https://github.com/openrsi/tp_progc/blob/master/gdb/README.md"
    click Img "https://github.com/openrsi/tp_progc/tree/master/images/"

    %% Build Flow
    Dev["Developer Machine"]:::external
    Build["Make & GCC"]:::build
    Dev -->|"runs"| Build

    Build -->|"build TP1"| TP1_bin["TP1 Executable"]:::executable
    Build -->|"build TP2"| TP2_bin["TP2 Executable"]:::executable
    Build -->|"build TP3"| TP3_bin["TP3 Executable"]:::executable
    Build -->|"build TP4"| TP4_bin["TP4 Executable"]:::executable
    Build -->|"build TP5 Client/Server"| TP5_bin["TP5 Executables"]:::executable
    Build -->|"build TP6 Client/Server"| TP6_bin["TP6 Executables"]:::executable

    %% Runtime Interactions TP5
    TP5_client -->|"connect"| Net
    Net -->|"connect"| TP5_server
    TP5_server -->|"read/write"| FS

    %% Runtime Interactions TP6
    TP6_client -->|"connect"| Net
    Net -->|"connect"| TP6_server
    TP6_server -->|"read/write BMP"| FS

    %% Styles
    classDef module fill:#f2f2f2,stroke:#333,stroke-width:1px
    classDef executable fill:#d9ead3,stroke:#6aa84f,stroke-width:1px
    classDef storage fill:#fff2cc,stroke:#b45f06,stroke-width:1px
    classDef network fill:#c9daf8,stroke:#3d85c6,stroke-width:1px
    classDef utility fill:#ead1dc,stroke:#a64d79,stroke-width:1px
    classDef build fill:#ffe599,stroke:#bf9000,stroke-width:1px
    classDef external fill:#d9d2e9,stroke:#6d9eeb,stroke-width:1px
```
