# joaoptoaldo/sistemas-distribuidos architecture

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

- Interactive diagram: https://gitdiagram.com/joaoptoaldo/sistemas-distribuidos
- Repository: https://github.com/joaoptoaldo/sistemas-distribuidos

## Overview

This is a Portuguese-language teaching repository of practical distributed-systems examples, not one integrated application. Its examples demonstrate parallel tasks and thread pools, TCP/UDP sockets, RPC, multicast, JSON handling, and progressively larger exercises such as concurrent log processing and a UDP registration/token protocol. The graph shows documented or indexed calls where supported; several capabilities are represented by their source paths alone because the sampled evidence does not establish their runtime wiring.

Main entry points: [`desafios/desafio003/DesafioThreadPool/Controller/LogController.cs`](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio003/DesafioThreadPool/Controller/LogController.cs) (Log processing coordinator), [`desafios/desafio004_UDP/DesafioUDP/Cliente/Controllers/ClienteController.cs`](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio004_UDP/DesafioUDP/Cliente/Controllers/ClienteController.cs) (Registration client), [`2.1-threads-pool`](https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/2.1-threads-pool) (Thread-pool examples), [`1.2-threads`](https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/1.2-threads) (Parallel sum and filter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_threads["Threads and concurrency"]
  node_thread_examples["Thread examples<br/>[1.1-threads]"]
  node_parallel_tasks["Parallel sum and filter<br/>[1.2-threads]"]
  node_thread_server["Threaded TCP echo<br/>[Servidor.cs]"]
  node_thread_pool["Thread-pool examples<br/>[2.1-threads-pool]"]
end

subgraph group_sockets["Socket communication"]
  node_tcp_examples["TCP socket examples<br/>[src]"]
  node_tcp_communicators["TCP communicators<br/>[src]"]
  node_udp_examples["UDP communicator example<br/>[src]"]
end

subgraph group_rpc["RPC and serialization"]
  node_rpc_clients["RPC clients<br/>[4.1-RPC]"]
  node_grpc_service["gRPC person service"]
  node_grpc_contract["Person contract<br/>[person.proto]"]
  node_json_examples["JSON examples<br/>[python]"]
end

subgraph group_multicast["Multicast"]
  node_multicast_examples["Multicast examples<br/>[6.1-multicast]"]
end

subgraph group_exercises["Applied exercises"]
  node_log_controller["Log processing coordinator<br/>[LogController.cs]"]
  node_log_reader["Log chunk reader<br/>[LeitorLogs.cs]"]
  node_log_pool["Log worker pool<br/>[WorkerPool.cs]"]
  node_log_aggregator["Result aggregator"]
  node_udp_client["Registration client"]
  node_udp_communicator["UDP communicator facade<br/>[Comunicador.cs]"]
  node_udp_protocol["Message protocol<br/>[Protocolo.cs]"]
  node_udp_server["Registration server"]
  node_token_model["Expiring token<br/>[Token.cs]"]
  node_sales_example["Concurrent branch totals"]
  node_data_tasks["Concurrent data loading"]
end

node_parallel_tasks -->|"runs tasks"| node_thread_pool
node_parallel_tasks -->|"runs tasks"| node_thread_pool
node_log_controller -->|"reads chunks"| node_log_reader
node_log_controller -->|"submits chunks"| node_log_pool
node_log_controller -->|"collects results"| node_log_pool
node_log_controller -->|"aggregates results"| node_log_aggregator
node_udp_client -->|"sends and receives"| node_udp_communicator
node_udp_client -->|"formats messages"| node_udp_protocol
node_udp_server -->|"parses messages"| node_udp_protocol
node_udp_server -->|"checks validity"| node_token_model
node_udp_communicator -->|"delegates client mode"| node_udp_client
node_data_tasks -->|"runs concurrent tasks"| node_thread_examples
node_sales_example -.->|"starts worker threads"| node_thread_pool

click node_thread_examples "https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/1.1-threads"
click node_parallel_tasks "https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/1.2-threads"
click node_thread_server "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/1.3-threads/csharp/Servidor.cs"
click node_thread_pool "https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/2.1-threads-pool"
click node_tcp_examples "https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/3.1-sockets/src"
click node_tcp_communicators "https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/3.2-sockets/Sockets%20TCP%20(com%20comunicador)/src"
click node_udp_examples "https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/3.3-sockets/Sockets%20UDP%20(com%20comunicador)/src"
click node_rpc_clients "https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/4.1-RPC"
click node_grpc_service "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/4.1-RPC/C%23/Grpc/PersonGrpc.Server/PersonServiceImpl.cs"
click node_grpc_contract "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/4.1-RPC/C%23/Grpc/PersonGrpc.Contracts/Protos/person.proto"
click node_json_examples "https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/7.1-JSON/python"
click node_multicast_examples "https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/6.1-multicast"
click node_log_controller "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio003/DesafioThreadPool/Controller/LogController.cs"
click node_log_reader "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio003/DesafioThreadPool/Service/LeitorLogs.cs"
click node_log_pool "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio003/DesafioThreadPool/Service/WorkerPool.cs"
click node_log_aggregator "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio003/DesafioThreadPool/Service/AgregadorResultados.cs"
click node_udp_client "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio004_UDP/DesafioUDP/Cliente/Controllers/ClienteController.cs"
click node_udp_communicator "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio004_UDP/DesafioUDP/Comunicador/Comunicador.cs"
click node_udp_protocol "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio004_UDP/DesafioUDP/Comunicador/Protocolo.cs"
click node_udp_server "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio004_UDP/DesafioUDP/Servidor/Controllers/ServidorController.cs"
click node_token_model "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio004_UDP/DesafioUDP/Servidor/Models/Token.cs"
click node_sales_example "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio002/csharp/ex02/Controller/FilialController.cs"
click node_data_tasks "https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio001/java/ex01/src/controller/DadosController.java"

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_thread_examples,node_parallel_tasks,node_thread_server,node_thread_pool toneBlue
class node_tcp_examples,node_tcp_communicators,node_udp_examples toneAmber
class node_rpc_clients,node_grpc_service,node_grpc_contract,node_json_examples toneMint
class node_multicast_examples toneRose
class node_log_controller,node_log_reader,node_log_pool,node_log_aggregator,node_udp_client,node_udp_communicator,node_udp_protocol,node_udp_server,node_token_model,node_sales_example,node_data_tasks toneIndigo
```

## Components

### Threads and concurrency

- [Thread examples](https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/1.1-threads): `1.1-threads`
- [Parallel sum and filter](https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/1.2-threads): `1.2-threads`
- [Threaded TCP echo](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/1.3-threads/csharp/Servidor.cs): `1.3-threads/csharp/Servidor.cs`
- [Thread-pool examples](https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/2.1-threads-pool): `2.1-threads-pool`

### Socket communication

- [TCP socket examples](https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/3.1-sockets/src): `3.1-sockets/src`
- [TCP communicators](https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/3.2-sockets/Sockets%20TCP%20(com%20comunicador)/src): `3.2-sockets/Sockets TCP (com comunicador)/src`
- [UDP communicator example](https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/3.3-sockets/Sockets%20UDP%20(com%20comunicador)/src): `3.3-sockets/Sockets UDP (com comunicador)/src`

### RPC and serialization

- [RPC clients](https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/4.1-RPC): `4.1-RPC`
- [gRPC person service](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/4.1-RPC/C%23/Grpc/PersonGrpc.Server/PersonServiceImpl.cs): `4.1-RPC/C#/Grpc/PersonGrpc.Server/PersonServiceImpl.cs`
- [Person contract](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/4.1-RPC/C%23/Grpc/PersonGrpc.Contracts/Protos/person.proto): `4.1-RPC/C#/Grpc/PersonGrpc.Contracts/Protos/person.proto`
- [JSON examples](https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/7.1-JSON/python): `7.1-JSON/python`

### Multicast

- [Multicast examples](https://github.com/joaoptoaldo/sistemas-distribuidos/tree/main/6.1-multicast): `6.1-multicast`

### Applied exercises

- [Log processing coordinator](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio003/DesafioThreadPool/Controller/LogController.cs): `desafios/desafio003/DesafioThreadPool/Controller/LogController.cs`
- [Log chunk reader](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio003/DesafioThreadPool/Service/LeitorLogs.cs): `desafios/desafio003/DesafioThreadPool/Service/LeitorLogs.cs`
- [Log worker pool](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio003/DesafioThreadPool/Service/WorkerPool.cs): `desafios/desafio003/DesafioThreadPool/Service/WorkerPool.cs`
- [Result aggregator](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio003/DesafioThreadPool/Service/AgregadorResultados.cs): `desafios/desafio003/DesafioThreadPool/Service/AgregadorResultados.cs`
- [Registration client](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio004_UDP/DesafioUDP/Cliente/Controllers/ClienteController.cs): `desafios/desafio004_UDP/DesafioUDP/Cliente/Controllers/ClienteController.cs`
- [UDP communicator facade](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio004_UDP/DesafioUDP/Comunicador/Comunicador.cs): `desafios/desafio004_UDP/DesafioUDP/Comunicador/Comunicador.cs`
- [Message protocol](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio004_UDP/DesafioUDP/Comunicador/Protocolo.cs): `desafios/desafio004_UDP/DesafioUDP/Comunicador/Protocolo.cs`
- [Registration server](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio004_UDP/DesafioUDP/Servidor/Controllers/ServidorController.cs): `desafios/desafio004_UDP/DesafioUDP/Servidor/Controllers/ServidorController.cs`
- [Expiring token](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio004_UDP/DesafioUDP/Servidor/Models/Token.cs): `desafios/desafio004_UDP/DesafioUDP/Servidor/Models/Token.cs`
- [Concurrent branch totals](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio002/csharp/ex02/Controller/FilialController.cs): `desafios/desafio002/csharp/ex02/Controller/FilialController.cs`
- [Concurrent data loading](https://github.com/joaoptoaldo/sistemas-distribuidos/blob/main/desafios/desafio001/java/ex01/src/controller/DadosController.java): `desafios/desafio001/java/ex01/src/controller/DadosController.java`

## Connections

- Parallel sum and filter → Thread-pool examples: runs tasks (evidence: `1.2-threads/java/ex01/src/controller/SomaController.java`)
- Parallel sum and filter → Thread-pool examples: runs tasks (evidence: `1.2-threads/java/ex02/src/controller/FiltroController.java`)
- Log processing coordinator → Log chunk reader: reads chunks (evidence: `desafios/desafio003/DesafioThreadPool/Controller/LogController.cs`)
- Log processing coordinator → Log worker pool: submits chunks (evidence: `desafios/desafio003/DesafioThreadPool/Controller/LogController.cs`)
- Log processing coordinator → Log worker pool: collects results (evidence: `desafios/desafio003/DesafioThreadPool/Controller/LogController.cs`)
- Log processing coordinator → Result aggregator: aggregates results (evidence: `desafios/desafio003/DesafioThreadPool/Controller/LogController.cs`)
- Registration client → UDP communicator facade: sends and receives (evidence: `desafios/desafio004_UDP/DesafioUDP/Cliente/Controllers/ClienteController.cs`)
- Registration client → Message protocol: formats messages (evidence: `desafios/desafio004_UDP/DesafioUDP/Cliente/Controllers/ClienteController.cs`)
- Registration server → Message protocol: parses messages (evidence: `desafios/desafio004_UDP/DesafioUDP/Servidor/Controllers/ServidorController.cs`)
- Registration server → Expiring token: checks validity (evidence: `desafios/desafio004_UDP/DesafioUDP/Servidor/Controllers/ServidorController.cs`)
- UDP communicator facade → Registration client: delegates client mode (evidence: `desafios/desafio004_UDP/DesafioUDP/Comunicador/Comunicador.cs`)
- Concurrent data loading → Thread examples: runs concurrent tasks (evidence: `desafios/desafio001/java/ex01/src/controller/DadosController.java`)
- Concurrent branch totals → Thread-pool examples: starts worker threads
