# chuckablack/python-52-weeks architecture

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

- Interactive diagram: https://gitdiagram.com/chuckablack/python-52-weeks
- Repository: https://github.com/chuckablack/python-52-weeks

## Overview

This repository is a changing collection of Python teaching examples, not one integrated application. Its broad curriculum ranges from language fundamentals and file formats to networking, web monitoring, concurrency, and messaging. A substantial example is Quokka: a service monitor checks configured services and reports status through a REST API; a separate worker consumes queued capture, port-scan, and traceroute requests. The graph highlights these example domains and core modules. Connections are limited to relationships visible in supplied excerpts or the source index; most lesson files were not inspected.

Main entry points: [`m10_messaging_worker/quokka_worker.py`](https://github.com/chuckablack/python-52-weeks/blob/main/m10_messaging_worker/quokka_worker.py) (Worker Receiver), [`m09_server/service_monitor.py`](https://github.com/chuckablack/python-52-weeks/blob/main/m09_server/service_monitor.py) (Service Monitor Loop), [`m01_basics`](https://github.com/chuckablack/python-52-weeks/tree/main/m01_basics) (Basic Language Lessons), [`m04_networking`](https://github.com/chuckablack/python-52-weeks/tree/main/m04_networking) (Network Tool Examples)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_fundamentals["Python Fundamentals"]
  node_basics["Basic Language Lessons"]
  node_create_utils["Device Creation Helpers<br/>[create_utils.py]"]
  node_intermediate["Intermediate Lessons"]
  node_file_examples["File Format Examples"]
  node_development["Development Examples"]
end

subgraph group_networking["Networking Examples"]
  node_network_examples["Network Tool Examples"]
  node_device_class["Device Model<br/>[Device.py]"]
  node_device_connect["Device Connections<br/>[connect.py]"]
  node_device_facts["Device Facts<br/>[facts.py]"]
  node_device_types["Device Types<br/>[misc_types.py]"]
end

subgraph group_quokka["Quokka Monitoring"]
  node_service_monitor["Service Monitor Loop<br/>[service_monitor.py]"]
  node_monitor_checks["Protocol Checks<br/>[ServiceMonitor.py]"]
  node_quokka_api["Quokka REST API<br/>[quokka_server.py]"]
  node_quokka_db["Quokka Data Access<br/>[db_apis.py]"]
  node_quokka_ui["Quokka Web UI<br/>[Services.js]"]
end

subgraph group_messaging["Messaging Workers"]
  node_worker_receiver["Worker Receiver<br/>[quokka_worker.py]"]
  node_capture_worker["Capture Worker<br/>[CaptureThread.py]"]
  node_portscan_worker["Port Scan Worker<br/>[PortscanThread.py]"]
  node_traceroute_worker["Traceroute Worker"]
end

node_learner(("Learner"))
node_rabbitmq["RabbitMQ Queue"]
node_external_services(("Monitored Services"))
node_message_api(("Quokka Service API"))

node_learner -->|"studies"| node_basics
node_learner -->|"studies"| node_network_examples
node_learner -->|"studies"| node_quokka_api
node_service_monitor -->|"calls checks"| node_monitor_checks
node_service_monitor -->|"checks services"| node_external_services
node_service_monitor -->|"reads and updates"| node_message_api
node_worker_receiver -->|"consumes messages"| node_rabbitmq
node_worker_receiver -->|"dispatches capture"| node_capture_worker
node_worker_receiver -->|"dispatches scans"| node_portscan_worker
node_worker_receiver -->|"dispatches traces"| node_traceroute_worker

click node_basics "https://github.com/chuckablack/python-52-weeks/tree/main/m01_basics"
click node_create_utils "https://github.com/chuckablack/python-52-weeks/blob/main/m01_basics/util/create_utils.py"
click node_intermediate "https://github.com/chuckablack/python-52-weeks/tree/main/m01b_intermediate"
click node_file_examples "https://github.com/chuckablack/python-52-weeks/tree/main/m02_files"
click node_development "https://github.com/chuckablack/python-52-weeks/tree/main/m03_development_process"
click node_network_examples "https://github.com/chuckablack/python-52-weeks/tree/main/m04_networking"
click node_device_class "https://github.com/chuckablack/python-52-weeks/blob/main/m06_classes/Device.py"
click node_device_connect "https://github.com/chuckablack/python-52-weeks/blob/main/m06_classes/connect.py"
click node_device_facts "https://github.com/chuckablack/python-52-weeks/blob/main/m06_classes/facts.py"
click node_device_types "https://github.com/chuckablack/python-52-weeks/blob/main/m06_classes/misc_types.py"
click node_service_monitor "https://github.com/chuckablack/python-52-weeks/blob/main/m09_server/service_monitor.py"
click node_monitor_checks "https://github.com/chuckablack/python-52-weeks/blob/main/m09_server/ServiceMonitor.py"
click node_quokka_api "https://github.com/chuckablack/python-52-weeks/blob/main/m09_server/quokka_server.py"
click node_quokka_db "https://github.com/chuckablack/python-52-weeks/blob/main/m09_server/db_apis.py"
click node_quokka_ui "https://github.com/chuckablack/python-52-weeks/blob/main/m09_ui/src/components/Services.js"
click node_worker_receiver "https://github.com/chuckablack/python-52-weeks/blob/main/m10_messaging_worker/quokka_worker.py"
click node_capture_worker "https://github.com/chuckablack/python-52-weeks/blob/main/m10_messaging_worker/CaptureThread.py"
click node_portscan_worker "https://github.com/chuckablack/python-52-weeks/blob/main/m10_messaging_worker/PortscanThread.py"
click node_traceroute_worker "https://github.com/chuckablack/python-52-weeks/blob/main/m10_messaging_worker/TracerouteThread.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_basics,node_create_utils,node_intermediate,node_file_examples,node_development toneBlue
class node_network_examples,node_device_class,node_device_connect,node_device_facts,node_device_types toneAmber
class node_service_monitor,node_monitor_checks,node_quokka_api,node_quokka_db,node_quokka_ui,node_message_api toneMint
class node_worker_receiver,node_capture_worker,node_portscan_worker,node_traceroute_worker,node_rabbitmq toneRose
class node_learner,node_external_services toneIndigo
```

## Components

### Python Fundamentals

- [Basic Language Lessons](https://github.com/chuckablack/python-52-weeks/tree/main/m01_basics): `m01_basics`
- [Device Creation Helpers](https://github.com/chuckablack/python-52-weeks/blob/main/m01_basics/util/create_utils.py): `m01_basics/util/create_utils.py`
- [Intermediate Lessons](https://github.com/chuckablack/python-52-weeks/tree/main/m01b_intermediate): `m01b_intermediate`
- [File Format Examples](https://github.com/chuckablack/python-52-weeks/tree/main/m02_files): `m02_files`
- [Development Examples](https://github.com/chuckablack/python-52-weeks/tree/main/m03_development_process): `m03_development_process`

### Networking Examples

- [Network Tool Examples](https://github.com/chuckablack/python-52-weeks/tree/main/m04_networking): `m04_networking`
- [Device Model](https://github.com/chuckablack/python-52-weeks/blob/main/m06_classes/Device.py): `m06_classes/Device.py`
- [Device Connections](https://github.com/chuckablack/python-52-weeks/blob/main/m06_classes/connect.py): `m06_classes/connect.py`
- [Device Facts](https://github.com/chuckablack/python-52-weeks/blob/main/m06_classes/facts.py): `m06_classes/facts.py`
- [Device Types](https://github.com/chuckablack/python-52-weeks/blob/main/m06_classes/misc_types.py): `m06_classes/misc_types.py`

### Quokka Monitoring

- [Service Monitor Loop](https://github.com/chuckablack/python-52-weeks/blob/main/m09_server/service_monitor.py): `m09_server/service_monitor.py`
- [Protocol Checks](https://github.com/chuckablack/python-52-weeks/blob/main/m09_server/ServiceMonitor.py): `m09_server/ServiceMonitor.py`
- [Quokka REST API](https://github.com/chuckablack/python-52-weeks/blob/main/m09_server/quokka_server.py): `m09_server/quokka_server.py`
- [Quokka Data Access](https://github.com/chuckablack/python-52-weeks/blob/main/m09_server/db_apis.py): `m09_server/db_apis.py`
- [Quokka Web UI](https://github.com/chuckablack/python-52-weeks/blob/main/m09_ui/src/components/Services.js): `m09_ui/src/components/Services.js`

### Messaging Workers

- [Worker Receiver](https://github.com/chuckablack/python-52-weeks/blob/main/m10_messaging_worker/quokka_worker.py): `m10_messaging_worker/quokka_worker.py`
- [Capture Worker](https://github.com/chuckablack/python-52-weeks/blob/main/m10_messaging_worker/CaptureThread.py): `m10_messaging_worker/CaptureThread.py`
- [Port Scan Worker](https://github.com/chuckablack/python-52-weeks/blob/main/m10_messaging_worker/PortscanThread.py): `m10_messaging_worker/PortscanThread.py`
- [Traceroute Worker](https://github.com/chuckablack/python-52-weeks/blob/main/m10_messaging_worker/TracerouteThread.py): `m10_messaging_worker/TracerouteThread.py`

### Other components

- **Learner**
- **RabbitMQ Queue**
- **Monitored Services**
- **Quokka Service API**

## Connections

- Learner → Basic Language Lessons: studies
- Learner → Network Tool Examples: studies
- Learner → Quokka REST API: studies
- Service Monitor Loop → Protocol Checks: calls checks (evidence: `m09_server/service_monitor.py`)
- Service Monitor Loop → Monitored Services: checks services
- Service Monitor Loop → Quokka Service API: reads and updates (evidence: `m09_server/service_monitor.py`)
- Worker Receiver → RabbitMQ Queue: consumes messages (evidence: `m10_messaging_worker/quokka_worker.py`)
- Worker Receiver → Capture Worker: dispatches capture (evidence: `m10_messaging_worker/quokka_worker.py`)
- Worker Receiver → Port Scan Worker: dispatches scans (evidence: `m10_messaging_worker/quokka_worker.py`)
- Worker Receiver → Traceroute Worker: dispatches traces (evidence: `m10_messaging_worker/quokka_worker.py`)
