# zulangga053/prak-dis-dec architecture

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

- Interactive diagram: https://gitdiagram.com/zulangga053/prak-dis-dec
- Repository: https://github.com/zulangga053/prak-dis-dec

## Overview

This repository is a collection of learning exercises and example applications, rather than one integrated product. The visible workflows include distributed-systems demonstrations, database examples, a BlackSheep web application, a Flask blog, and small service examples. The BlackSheep app configures services and request features before serving; the Flask app registers authentication, blog, and database functionality. Several chapter READMEs and subsystems were not provided, so their capabilities and connections are not expanded beyond what the tree and excerpts support.

Main entry points: [`05/workspace-05/blacksheep_lb/app/main.py`](https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/app/main.py) (Application Setup), [`07/flask-app/flaskr/__init__.py`](https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/flaskr/__init__.py) (App Factory), [`07/flask-app/flaskr/db.py`](https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/flaskr/db.py) (Database Access), [`07/flask-app/flaskr/blog.py`](https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/flaskr/blog.py) (Blog Operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_distributed["Distributed Systems"]
  node_concurrency["Concurrency Demos"]
  node_raft["Raft Example<br/>[raft.py]"]
  node_raft_module["Raft Module<br/>[raft_module.py]"]
  node_vector_clock["Vector Clocks<br/>[vector_clock.py]"]
  node_vclocks["Clock Demo<br/>[vclocks.py]"]
end

subgraph group_black["BlackSheep Example"]
  node_black_request["Web Requests"]
  node_black_app["Application Setup<br/>[main.py]"]
  node_black_services["Service Registration<br/>[services.py]"]
  node_black_settings["Settings<br/>[settings.py]"]
  node_black_auth["Authentication Setup<br/>[auth.py]"]
  node_black_errors["Error Handlers<br/>[errors.py]"]
  node_black_templates["Template Setup<br/>[templating.py]"]
  node_black_domain["Domain Models<br/>[common.py]"]
  node_resilience["Failure Detection"]
  node_heartbeat["Heartbeat Check<br/>[check-server.py]"]
end

subgraph group_flask["Flask Blog"]
  node_flask_user(("Blog User"))
  node_flask_app["App Factory<br/>[__init__.py]"]
  node_flask_auth["Authentication<br/>[auth.py]"]
  node_flask_blog["Blog Operations<br/>[blog.py]"]
  node_flask_db["Database Access<br/>[db.py]"]
  node_flask_store[("SQLite Store<br/>[flaskr.sqlite]")]
  node_flask_schema["Blog Schema<br/>[schema.sql]"]
end

subgraph group_data["Database Examples"]
  node_client_schema["Client and Schema"]
  node_sql_examples[("SQL Examples")]
  node_service_examples["Service Examples"]
end

node_learner(("Learner"))

node_learner -->|"studies"| node_client_schema
node_learner -->|"studies"| node_concurrency
node_learner -->|"studies"| node_raft
node_learner -->|"studies"| node_vector_clock
node_learner -->|"studies"| node_sql_examples
node_learner -->|"uses"| node_black_request
node_learner -->|"uses"| node_flask_app
node_black_request -.->|"routes through"| node_black_app
node_black_app -->|"configures"| node_black_services
node_black_services -->|"loads"| node_black_settings
node_black_app -->|"configures"| node_black_auth
node_black_app -->|"configures"| node_black_errors
node_black_app -->|"configures"| node_black_templates
node_black_templates -->|"uses"| node_black_settings
node_black_app -.->|"uses"| node_black_domain
node_flask_user -->|"accesses"| node_flask_app
node_flask_app -->|"registers"| node_flask_auth
node_flask_app -->|"registers"| node_flask_blog
node_flask_app -->|"initializes"| node_flask_db
node_flask_auth -->|"queries"| node_flask_db
node_flask_blog -->|"checks login"| node_flask_auth
node_flask_blog -->|"queries and updates"| node_flask_db
node_flask_db -.->|"connects"| node_flask_store
node_flask_db -->|"loads schema"| node_flask_schema

click node_client_schema "https://github.com/zulangga053/prak-dis-dec/tree/main/02/workspace-01"
click node_concurrency "https://github.com/zulangga053/prak-dis-dec/tree/main/03"
click node_raft "https://github.com/zulangga053/prak-dis-dec/blob/main/03/raft.py"
click node_raft_module "https://github.com/zulangga053/prak-dis-dec/blob/main/03/raft_module.py"
click node_vector_clock "https://github.com/zulangga053/prak-dis-dec/blob/main/03/vector_clock.py"
click node_vclocks "https://github.com/zulangga053/prak-dis-dec/blob/main/03/vclocks.py"
click node_sql_examples "https://github.com/zulangga053/prak-dis-dec/tree/main/04"
click node_black_request "https://github.com/zulangga053/prak-dis-dec/tree/main/05/workspace-05/blacksheep_lb/app/controllers"
click node_black_app "https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/app/main.py"
click node_black_services "https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/app/services.py"
click node_black_settings "https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/app/settings.py"
click node_black_auth "https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/app/auth.py"
click node_black_errors "https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/app/errors.py"
click node_black_templates "https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/app/templating.py"
click node_black_domain "https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/domain/common.py"
click node_resilience "https://github.com/zulangga053/prak-dis-dec/tree/main/05/workspace-05/failure-detection"
click node_heartbeat "https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/heartbeat/check-server.py"
click node_flask_app "https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/flaskr/__init__.py"
click node_flask_auth "https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/flaskr/auth.py"
click node_flask_blog "https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/flaskr/blog.py"
click node_flask_db "https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/flaskr/db.py"
click node_flask_store "https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/instance/flaskr.sqlite"
click node_flask_schema "https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/flaskr/schema.sql"
click node_service_examples "https://github.com/zulangga053/prak-dis-dec/tree/main/08/src"

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_concurrency,node_raft,node_raft_module,node_vector_clock,node_vclocks toneBlue
class node_black_request,node_black_app,node_black_services,node_black_settings,node_black_auth,node_black_errors,node_black_templates,node_black_domain,node_resilience,node_heartbeat toneAmber
class node_flask_user,node_flask_app,node_flask_auth,node_flask_blog,node_flask_db,node_flask_store,node_flask_schema toneMint
class node_client_schema,node_sql_examples,node_service_examples toneRose
class node_learner toneIndigo
```

## Components

### Distributed Systems

- [Concurrency Demos](https://github.com/zulangga053/prak-dis-dec/tree/main/03): `03`
- [Raft Example](https://github.com/zulangga053/prak-dis-dec/blob/main/03/raft.py): `03/raft.py`
- [Raft Module](https://github.com/zulangga053/prak-dis-dec/blob/main/03/raft_module.py): `03/raft_module.py`
- [Vector Clocks](https://github.com/zulangga053/prak-dis-dec/blob/main/03/vector_clock.py): `03/vector_clock.py`
- [Clock Demo](https://github.com/zulangga053/prak-dis-dec/blob/main/03/vclocks.py): `03/vclocks.py`

### BlackSheep Example

- [Web Requests](https://github.com/zulangga053/prak-dis-dec/tree/main/05/workspace-05/blacksheep_lb/app/controllers): `05/workspace-05/blacksheep_lb/app/controllers`
- [Application Setup](https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/app/main.py): `05/workspace-05/blacksheep_lb/app/main.py`
- [Service Registration](https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/app/services.py): `05/workspace-05/blacksheep_lb/app/services.py`
- [Settings](https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/app/settings.py): `05/workspace-05/blacksheep_lb/app/settings.py`
- [Authentication Setup](https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/app/auth.py): `05/workspace-05/blacksheep_lb/app/auth.py`
- [Error Handlers](https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/app/errors.py): `05/workspace-05/blacksheep_lb/app/errors.py`
- [Template Setup](https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/app/templating.py): `05/workspace-05/blacksheep_lb/app/templating.py`
- [Domain Models](https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/blacksheep_lb/domain/common.py): `05/workspace-05/blacksheep_lb/domain/common.py`
- [Failure Detection](https://github.com/zulangga053/prak-dis-dec/tree/main/05/workspace-05/failure-detection): `05/workspace-05/failure-detection`
- [Heartbeat Check](https://github.com/zulangga053/prak-dis-dec/blob/main/05/workspace-05/heartbeat/check-server.py): `05/workspace-05/heartbeat/check-server.py`

### Flask Blog

- **Blog User**
- [App Factory](https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/flaskr/__init__.py): `07/flask-app/flaskr/__init__.py`
- [Authentication](https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/flaskr/auth.py): `07/flask-app/flaskr/auth.py`
- [Blog Operations](https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/flaskr/blog.py): `07/flask-app/flaskr/blog.py`
- [Database Access](https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/flaskr/db.py): `07/flask-app/flaskr/db.py`
- [SQLite Store](https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/instance/flaskr.sqlite): `07/flask-app/instance/flaskr.sqlite`
- [Blog Schema](https://github.com/zulangga053/prak-dis-dec/blob/main/07/flask-app/flaskr/schema.sql): `07/flask-app/flaskr/schema.sql`

### Database Examples

- [Client and Schema](https://github.com/zulangga053/prak-dis-dec/tree/main/02/workspace-01): `02/workspace-01`
- [SQL Examples](https://github.com/zulangga053/prak-dis-dec/tree/main/04): `04`
- [Service Examples](https://github.com/zulangga053/prak-dis-dec/tree/main/08/src): `08/src`

### Other components

- **Learner**

## Connections

- Learner → Client and Schema: studies
- Learner → Concurrency Demos: studies
- Learner → Raft Example: studies
- Learner → Vector Clocks: studies
- Learner → SQL Examples: studies
- Learner → Web Requests: uses
- Learner → App Factory: uses
- Web Requests → Application Setup: routes through
- Application Setup → Service Registration: configures (evidence: `05/workspace-05/blacksheep_lb/app/main.py`)
- Service Registration → Settings: loads (evidence: `05/workspace-05/blacksheep_lb/app/services.py`)
- Application Setup → Authentication Setup: configures (evidence: `05/workspace-05/blacksheep_lb/app/main.py`)
- Application Setup → Error Handlers: configures (evidence: `05/workspace-05/blacksheep_lb/app/main.py`)
- Application Setup → Template Setup: configures (evidence: `05/workspace-05/blacksheep_lb/app/main.py`)
- Template Setup → Settings: uses (evidence: `05/workspace-05/blacksheep_lb/app/templating.py`)
- Application Setup → Domain Models: uses
- Blog User → App Factory: accesses
- App Factory → Authentication: registers (evidence: `07/flask-app/flaskr/__init__.py`)
- App Factory → Blog Operations: registers (evidence: `07/flask-app/flaskr/__init__.py`)
- App Factory → Database Access: initializes (evidence: `07/flask-app/flaskr/__init__.py`)
- Authentication → Database Access: queries (evidence: `07/flask-app/flaskr/auth.py`)
- Blog Operations → Authentication: checks login (evidence: `07/flask-app/flaskr/blog.py`)
- Blog Operations → Database Access: queries and updates (evidence: `07/flask-app/flaskr/blog.py`)
- Database Access → SQLite Store: connects
- Database Access → Blog Schema: loads schema (evidence: `07/flask-app/flaskr/db.py`)
