# arhmm7/cdis architecture

> Architecture diagram of the GitHub repository arhmm7/cdis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arhmm7/cdis
- Repository: https://github.com/arhmm7/cdis

## Overview

This is a small C TCP server skeleton. The principal workflow is startup initializing a listening socket, then accepting client connections and dispatching each to a thread that receives and logs bytes. The parser implementation is empty and is not called by the server; the datastore provides initialization and hashing code but is not wired into the request path. The README is empty, so the map reflects only the shown source; it does not imply command processing or responses.

Main entry points: [`src/rserver.c`](https://github.com/arhmm7/cdis/blob/main/src/rserver.c) (Socket server), [`src/main.c`](https://github.com/arhmm7/cdis/blob/main/src/main.c) (Program entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Server runtime"]
  node_main["Program entry<br/>[main.c]"]
  node_server["Socket server<br/>[rserver.c]"]
end

subgraph group_request["Request handling"]
  node_client_handler["Client thread<br/>[rserver.c]"]
  node_parser["Request parser<br/>[rparser.c]"]
end

subgraph group_storage["Data storage"]
  node_datastore[("Hash table<br/>[rdatastore.c]")]
end

node_client(("TCP client"))

node_main -->|"initializes socket"| node_server
node_main -->|"starts loop"| node_server
node_server -->|"spawns thread"| node_client_handler
node_client -->|"sends bytes"| node_client_handler

click node_main "https://github.com/arhmm7/cdis/blob/main/src/main.c"
click node_server "https://github.com/arhmm7/cdis/blob/main/src/rserver.c"
click node_client_handler "https://github.com/arhmm7/cdis/blob/main/src/rserver.c"
click node_parser "https://github.com/arhmm7/cdis/blob/main/src/rparser.c"
click node_datastore "https://github.com/arhmm7/cdis/blob/main/src/rdatastore.c"

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_main,node_server,node_client toneBlue
class node_client_handler,node_parser toneAmber
class node_datastore toneMint
```

## Components

### Server runtime

- [Program entry](https://github.com/arhmm7/cdis/blob/main/src/main.c): `src/main.c`
- [Socket server](https://github.com/arhmm7/cdis/blob/main/src/rserver.c): `src/rserver.c`

### Request handling

- [Client thread](https://github.com/arhmm7/cdis/blob/main/src/rserver.c): `src/rserver.c`
- [Request parser](https://github.com/arhmm7/cdis/blob/main/src/rparser.c): `src/rparser.c`

### Data storage

- [Hash table](https://github.com/arhmm7/cdis/blob/main/src/rdatastore.c): `src/rdatastore.c`

### Other components

- **TCP client**

## Connections

- Program entry → Socket server: initializes socket (evidence: `src/main.c`)
- Program entry → Socket server: starts loop (evidence: `src/main.c`)
- Socket server → Client thread: spawns thread (evidence: `src/rserver.c`)
- TCP client → Client thread: sends bytes (evidence: `src/rserver.c`)
