# ionut-valeriu/distributed-systems-labs architecture

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

- Interactive diagram: https://gitdiagram.com/ionut-valeriu/distributed-systems-labs
- Repository: https://github.com/ionut-valeriu/distributed-systems-labs

## Overview

This repository is a collection of independent Go exercises for distributed-systems coursework, not one integrated application. The principal workflow is to run an exercise, which performs its own computation or communication demonstration and prints a result. The exercises progress from basic Go tasks and channels to clock synchronization, leader election, consensus, and robot coordination. The README documents only Labs 01–02; later lab topics are identified by the sampled source. Connections are shown only where excerpts support them.

Main entry points: [`Lab05/ex1.go`](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab05/ex1.go) (Robot Averaging), [`Lab01/ex1.go`](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex1.go) (Prime Check), [`Lab01/ex9.go`](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex9.go) (Pair Sum), [`Lab02/ex2.go`](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex2.go) (Channel Receiver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lab01["Go Basics"]
  node_l1e1["Prime Check<br/>[ex1.go]"]
  node_l1e2["Exercise 2<br/>[ex2.go]"]
  node_l1e3["Exercise 3<br/>[ex3.go]"]
  node_l1e4["Slice Exercise<br/>[ex4.go]"]
  node_l1e5["Exercise 5<br/>[ex5.go]"]
  node_l1e6["Exercise 6<br/>[ex6.go]"]
  node_l1e7["Exercise 7<br/>[ex7.go]"]
  node_l1e8["Exercise 8<br/>[ex8.go]"]
  node_l1e9["Pair Sum<br/>[ex9.go]"]
end

subgraph group_lab02["IPC Exercises"]
  node_l2e1["Exercise 1<br/>[ex1.go]"]
  node_l2e2["Channel Receiver<br/>[ex2.go]"]
  node_l2e3["Channel Sender<br/>[ex3.go]"]
  node_l2e4["Exercise 4<br/>[ex4.go]"]
  node_l2e5["Exercise 5<br/>[ex5.go]"]
  node_l2e6["Exercise 6<br/>[ex6.go]"]
  node_l2e7["Robot Pair<br/>[ex7.go]"]
end

subgraph group_lab03["Clock Exercises"]
  node_l3e1["Clock Offset<br/>[ex1.go]"]
  node_l3e2["Lamport Events<br/>[ex2.go]"]
end

subgraph group_lab04["Consensus Exercises"]
  node_l4e1["Ring Election<br/>[ex1.go]"]
  node_l4e2["Round Election<br/>[ex2.go]"]
  node_l4e3["Vote Averaging<br/>[ex3.go]"]
end

subgraph group_lab05["Robot Coordination"]
  node_l5e1["Robot Averaging<br/>[ex1.go]"]
end

node_user(("Exercise Runner"))
node_coords["Coordinate Input<br/>[coords.txt]"]

node_user -->|"runs"| node_l1e1
node_user -->|"runs"| node_l1e9
node_user -->|"runs"| node_l2e2
node_user -->|"runs"| node_l2e3
node_user -->|"runs"| node_l2e7
node_user -->|"runs"| node_l3e1
node_user -->|"runs"| node_l3e2
node_user -->|"runs"| node_l4e1
node_user -->|"runs"| node_l4e2
node_user -->|"runs"| node_l4e3
node_user -->|"runs"| node_l5e1
node_l1e1 -->|"prints result"| node_user
node_l1e9 -->|"prints pairs"| node_user
node_l2e2 -->|"prints message"| node_user
node_l2e3 -->|"prints messages"| node_user
node_l2e7 -->|"reports positions"| node_user
node_l3e1 -->|"prints estimates"| node_user
node_l3e2 -->|"prints events"| node_user
node_l4e1 -->|"prints leader"| node_user
node_l4e2 -->|"prints leader"| node_user
node_l4e3 -->|"prints decisions"| node_user
node_l5e1 -->|"reads coordinates"| node_coords
node_l5e1 -->|"prints positions"| node_user

click node_l1e1 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex1.go"
click node_l1e2 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex2.go"
click node_l1e3 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex3.go"
click node_l1e4 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex4.go"
click node_l1e5 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex5.go"
click node_l1e6 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex6.go"
click node_l1e7 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex7.go"
click node_l1e8 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex8.go"
click node_l1e9 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex9.go"
click node_l2e1 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex1.go"
click node_l2e2 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex2.go"
click node_l2e3 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex3.go"
click node_l2e4 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex4.go"
click node_l2e5 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex5.go"
click node_l2e6 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex6.go"
click node_l2e7 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex7.go"
click node_l3e1 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab03/ex1.go"
click node_l3e2 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab03/ex2.go"
click node_l4e1 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab04/ex1.go"
click node_l4e2 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab04/ex2.go"
click node_l4e3 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab04/ex3.go"
click node_l5e1 "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab05/ex1.go"
click node_coords "https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab05/coords.txt"

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_l1e1,node_l1e2,node_l1e3,node_l1e4,node_l1e5,node_l1e6,node_l1e7,node_l1e8,node_l1e9 toneBlue
class node_l2e1,node_l2e2,node_l2e3,node_l2e4,node_l2e5,node_l2e6,node_l2e7 toneAmber
class node_l3e1,node_l3e2 toneMint
class node_l4e1,node_l4e2,node_l4e3 toneRose
class node_l5e1,node_user toneIndigo
class node_coords toneTeal
```

## Components

### Go Basics

- [Prime Check](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex1.go): `Lab01/ex1.go`
- [Exercise 2](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex2.go): `Lab01/ex2.go`
- [Exercise 3](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex3.go): `Lab01/ex3.go`
- [Slice Exercise](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex4.go): `Lab01/ex4.go`
- [Exercise 5](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex5.go): `Lab01/ex5.go`
- [Exercise 6](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex6.go): `Lab01/ex6.go`
- [Exercise 7](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex7.go): `Lab01/ex7.go`
- [Exercise 8](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex8.go): `Lab01/ex8.go`
- [Pair Sum](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab01/ex9.go): `Lab01/ex9.go`

### IPC Exercises

- [Exercise 1](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex1.go): `Lab02/ex1.go`
- [Channel Receiver](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex2.go): `Lab02/ex2.go`
- [Channel Sender](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex3.go): `Lab02/ex3.go`
- [Exercise 4](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex4.go): `Lab02/ex4.go`
- [Exercise 5](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex5.go): `Lab02/ex5.go`
- [Exercise 6](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex6.go): `Lab02/ex6.go`
- [Robot Pair](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab02/ex7.go): `Lab02/ex7.go`

### Clock Exercises

- [Clock Offset](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab03/ex1.go): `Lab03/ex1.go`
- [Lamport Events](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab03/ex2.go): `Lab03/ex2.go`

### Consensus Exercises

- [Ring Election](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab04/ex1.go): `Lab04/ex1.go`
- [Round Election](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab04/ex2.go): `Lab04/ex2.go`
- [Vote Averaging](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab04/ex3.go): `Lab04/ex3.go`

### Robot Coordination

- [Robot Averaging](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab05/ex1.go): `Lab05/ex1.go`

### Other components

- **Exercise Runner**
- [Coordinate Input](https://github.com/ionut-valeriu/distributed-systems-labs/blob/main/Lab05/coords.txt): `Lab05/coords.txt`

## Connections

- Exercise Runner → Prime Check: runs (evidence: `Lab01/ex1.go`)
- Exercise Runner → Pair Sum: runs (evidence: `Lab01/ex9.go`)
- Exercise Runner → Channel Receiver: runs (evidence: `Lab02/ex2.go`)
- Exercise Runner → Channel Sender: runs (evidence: `Lab02/ex3.go`)
- Exercise Runner → Robot Pair: runs (evidence: `Lab02/ex7.go`)
- Exercise Runner → Clock Offset: runs (evidence: `Lab03/ex1.go`)
- Exercise Runner → Lamport Events: runs (evidence: `Lab03/ex2.go`)
- Exercise Runner → Ring Election: runs (evidence: `Lab04/ex1.go`)
- Exercise Runner → Round Election: runs (evidence: `Lab04/ex2.go`)
- Exercise Runner → Vote Averaging: runs (evidence: `Lab04/ex3.go`)
- Exercise Runner → Robot Averaging: runs (evidence: `Lab05/ex1.go`)
- Prime Check → Exercise Runner: prints result (evidence: `Lab01/ex1.go`)
- Pair Sum → Exercise Runner: prints pairs (evidence: `Lab01/ex9.go`)
- Channel Receiver → Exercise Runner: prints message (evidence: `Lab02/ex2.go`)
- Channel Sender → Exercise Runner: prints messages (evidence: `Lab02/ex3.go`)
- Robot Pair → Exercise Runner: reports positions (evidence: `Lab02/ex7.go`)
- Clock Offset → Exercise Runner: prints estimates (evidence: `Lab03/ex1.go`)
- Lamport Events → Exercise Runner: prints events (evidence: `Lab03/ex2.go`)
- Ring Election → Exercise Runner: prints leader (evidence: `Lab04/ex1.go`)
- Round Election → Exercise Runner: prints leader (evidence: `Lab04/ex2.go`)
- Vote Averaging → Exercise Runner: prints decisions (evidence: `Lab04/ex3.go`)
- Robot Averaging → Coordinate Input: reads coordinates (evidence: `Lab05/ex1.go`)
- Robot Averaging → Exercise Runner: prints positions (evidence: `Lab05/ex1.go`)
