# swathilal710/cmpt360-361 architecture

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

- Interactive diagram: https://gitdiagram.com/swathilal710/cmpt360-361
- Repository: https://github.com/swathilal710/cmpt360-361

## Overview

This repository contains two small TCP socket-programming examples. In Practice, a user enters a number through the client; the server prompts, receives it, and returns a confirmation. In Labs/lab2, the client displays the server’s phone-book menu and sends a choice; the server currently prints that choice without implementing the menu operations. The README provides no further product context, so the map is based on the sampled source files.

Main entry points: [`Practice/client.py`](https://github.com/swathilal710/cmpt360-361/blob/main/Practice/client.py) (Number client), [`Labs/lab2/server.py`](https://github.com/swathilal710/cmpt360-361/blob/main/Labs/lab2/server.py) (Menu server), [`Labs/lab2/client.py`](https://github.com/swathilal710/cmpt360-361/blob/main/Labs/lab2/client.py) (Menu client), [`Practice/server.py`](https://github.com/swathilal710/cmpt360-361/blob/main/Practice/server.py) (Number server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_practice["Practice example"]
  node_practice_client["Number client<br/>[client.py]"]
  node_practice_server["Number server<br/>[server.py]"]
end

subgraph group_lab2["Lab 2 example"]
  node_lab_client["Menu client<br/>[client.py]"]
  node_lab_server["Menu server<br/>[server.py]"]
end

node_practice_user(("Number user"))
node_lab_user(("Phone-book user"))

node_practice_user -->|"enters number"| node_practice_client
node_practice_client -->|"connects and sends"| node_practice_server
node_practice_server -->|"sends prompt and reply"| node_practice_client
node_practice_client -->|"prints reply"| node_practice_user
node_lab_user -->|"selects choice"| node_lab_client
node_lab_client -->|"connects and sends choice"| node_lab_server
node_lab_server -->|"sends menu"| node_lab_client
node_lab_server -->|"prints choice"| node_lab_user

click node_practice_client "https://github.com/swathilal710/cmpt360-361/blob/main/Practice/client.py"
click node_practice_server "https://github.com/swathilal710/cmpt360-361/blob/main/Practice/server.py"
click node_lab_client "https://github.com/swathilal710/cmpt360-361/blob/main/Labs/lab2/client.py"
click node_lab_server "https://github.com/swathilal710/cmpt360-361/blob/main/Labs/lab2/server.py"

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_practice_client,node_practice_server,node_practice_user,node_lab_user toneBlue
class node_lab_client,node_lab_server toneAmber
```

## Components

### Practice example

- [Number client](https://github.com/swathilal710/cmpt360-361/blob/main/Practice/client.py): `Practice/client.py`
- [Number server](https://github.com/swathilal710/cmpt360-361/blob/main/Practice/server.py): `Practice/server.py`

### Lab 2 example

- [Menu client](https://github.com/swathilal710/cmpt360-361/blob/main/Labs/lab2/client.py): `Labs/lab2/client.py`
- [Menu server](https://github.com/swathilal710/cmpt360-361/blob/main/Labs/lab2/server.py): `Labs/lab2/server.py`

### Other components

- **Number user**
- **Phone-book user**

## Connections

- Number user → Number client: enters number (evidence: `Practice/client.py`)
- Number client → Number server: connects and sends (evidence: `Practice/client.py`)
- Number server → Number client: sends prompt and reply (evidence: `Practice/server.py`)
- Number client → Number user: prints reply (evidence: `Practice/client.py`)
- Phone-book user → Menu client: selects choice (evidence: `Labs/lab2/client.py`)
- Menu client → Menu server: connects and sends choice (evidence: `Labs/lab2/client.py`)
- Menu server → Menu client: sends menu (evidence: `Labs/lab2/server.py`)
- Menu server → Phone-book user: prints choice (evidence: `Labs/lab2/server.py`)
