# kirimusha/client_server_app_polytech architecture

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

- Interactive diagram: https://gitdiagram.com/kirimusha/client_server_app_polytech
- Repository: https://github.com/kirimusha/client_server_app_polytech

## Overview

This is a client–server application for finding shortest paths in an unweighted graph, with TCP and UDP modes. The main workflow takes graph edges and endpoint names from the client, converts names to numeric vertices, sends a request, and returns a path or error from the server. The client also supports graph-file input; UDP adds acknowledged, retried packet delivery. The graph follows documented behavior and sampled source; some server request-handling details are omitted, so uncertain internal links are not shown.

Main entry points: [`server/Server.cpp`](https://github.com/kirimusha/client_server_app_polytech/blob/master/server/Server.cpp) (Request handling), [`client/ClientMain.cpp`](https://github.com/kirimusha/client_server_app_polytech/blob/master/client/ClientMain.cpp) (Client entry), [`client/Client.cpp`](https://github.com/kirimusha/client_server_app_polytech/blob/master/client/Client.cpp) (Client requests), [`common/Protocol.cpp`](https://github.com/kirimusha/client_server_app_polytech/blob/master/common/Protocol.cpp) (Request encoding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client input and requests"]
  node_client_main["Client entry<br/>[ClientMain.cpp]"]
  node_client["Client requests<br/>[Client.cpp]"]
end

subgraph group_transport["Network protocols"]
  node_udp_protocol["UDP packets<br/>[UDPProtocol.h]"]
  node_network{{"TCP / UDP network"}}
end

subgraph group_server["Server and graph search"]
  node_server_main["Server entry<br/>[ServerMain.cpp]"]
  node_server["Request handling<br/>[Server.cpp]"]
  node_graph["Graph model<br/>[Graph.cpp]"]
  node_dijkstra["Shortest-path search<br/>[Dijkstra.h]"]
end

subgraph group_shared["Shared utilities"]
  node_parser["Input parsing<br/>[InputParser.cpp]"]
  node_file_reader["File input<br/>[FileReader.cpp]"]
  node_validator["Input validation<br/>[Validator.cpp]"]
  node_protocol["Request encoding<br/>[Protocol.cpp]"]
  node_logger["Logging<br/>[Logger.cpp]"]
end

node_user(("User"))

node_user -->|"provides input"| node_client_main
node_client_main -->|"parses input"| node_parser
node_client_main -.->|"reads graph file"| node_file_reader
node_client_main -->|"validates input"| node_validator
node_client_main -->|"submits request"| node_client
node_client -->|"encodes request"| node_protocol
node_client -.->|"frames UDP"| node_udp_protocol
node_client -->|"sends request"| node_network
node_network -->|"delivers request"| node_server
node_server_main -->|"starts server"| node_server
node_server -->|"decodes request"| node_protocol
node_server -.->|"handles UDP packets"| node_udp_protocol
node_server -->|"builds graph"| node_graph
node_server -->|"searches path"| node_dijkstra
node_server -->|"encodes response"| node_protocol
node_server -->|"sends response"| node_network
node_client -->|"logs events"| node_logger
node_server -->|"logs events"| node_logger

click node_client_main "https://github.com/kirimusha/client_server_app_polytech/blob/master/client/ClientMain.cpp"
click node_parser "https://github.com/kirimusha/client_server_app_polytech/blob/master/utils/InputParser.cpp"
click node_file_reader "https://github.com/kirimusha/client_server_app_polytech/blob/master/utils/FileReader.cpp"
click node_validator "https://github.com/kirimusha/client_server_app_polytech/blob/master/utils/Validator.cpp"
click node_client "https://github.com/kirimusha/client_server_app_polytech/blob/master/client/Client.cpp"
click node_protocol "https://github.com/kirimusha/client_server_app_polytech/blob/master/common/Protocol.cpp"
click node_udp_protocol "https://github.com/kirimusha/client_server_app_polytech/blob/master/common/UDPProtocol.h"
click node_server_main "https://github.com/kirimusha/client_server_app_polytech/blob/master/server/ServerMain.cpp"
click node_server "https://github.com/kirimusha/client_server_app_polytech/blob/master/server/Server.cpp"
click node_graph "https://github.com/kirimusha/client_server_app_polytech/blob/master/common/Graph.cpp"
click node_dijkstra "https://github.com/kirimusha/client_server_app_polytech/blob/master/common/Dijkstra.h"
click node_logger "https://github.com/kirimusha/client_server_app_polytech/blob/master/utils/Logger.cpp"

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_client_main,node_client,node_user toneBlue
class node_udp_protocol,node_network toneAmber
class node_server_main,node_server,node_graph,node_dijkstra toneMint
class node_parser,node_file_reader,node_validator,node_protocol,node_logger toneRose
```

## Components

### Client input and requests

- [Client entry](https://github.com/kirimusha/client_server_app_polytech/blob/master/client/ClientMain.cpp): `client/ClientMain.cpp`
- [Client requests](https://github.com/kirimusha/client_server_app_polytech/blob/master/client/Client.cpp): `client/Client.cpp`

### Network protocols

- [UDP packets](https://github.com/kirimusha/client_server_app_polytech/blob/master/common/UDPProtocol.h): `common/UDPProtocol.h`
- **TCP / UDP network**

### Server and graph search

- [Server entry](https://github.com/kirimusha/client_server_app_polytech/blob/master/server/ServerMain.cpp): `server/ServerMain.cpp`
- [Request handling](https://github.com/kirimusha/client_server_app_polytech/blob/master/server/Server.cpp): `server/Server.cpp`
- [Graph model](https://github.com/kirimusha/client_server_app_polytech/blob/master/common/Graph.cpp): `common/Graph.cpp`
- [Shortest-path search](https://github.com/kirimusha/client_server_app_polytech/blob/master/common/Dijkstra.h): `common/Dijkstra.h`

### Shared utilities

- [Input parsing](https://github.com/kirimusha/client_server_app_polytech/blob/master/utils/InputParser.cpp): `utils/InputParser.cpp`
- [File input](https://github.com/kirimusha/client_server_app_polytech/blob/master/utils/FileReader.cpp): `utils/FileReader.cpp`
- [Input validation](https://github.com/kirimusha/client_server_app_polytech/blob/master/utils/Validator.cpp): `utils/Validator.cpp`
- [Request encoding](https://github.com/kirimusha/client_server_app_polytech/blob/master/common/Protocol.cpp): `common/Protocol.cpp`
- [Logging](https://github.com/kirimusha/client_server_app_polytech/blob/master/utils/Logger.cpp): `utils/Logger.cpp`

### Other components

- **User**

## Connections

- User → Client entry: provides input
- Client entry → Input parsing: parses input
- Client entry → File input: reads graph file
- Client entry → Input validation: validates input
- Client entry → Client requests: submits request
- Client requests → Request encoding: encodes request
- Client requests → UDP packets: frames UDP
- Client requests → TCP / UDP network: sends request
- TCP / UDP network → Request handling: delivers request
- Server entry → Request handling: starts server
- Request handling → Request encoding: decodes request
- Request handling → UDP packets: handles UDP packets
- Request handling → Graph model: builds graph
- Request handling → Shortest-path search: searches path
- Request handling → Request encoding: encodes response
- Request handling → TCP / UDP network: sends response
- Client requests → Logging: logs events
- Request handling → Logging: logs events
