# niklasg-127/hausarbeit-dlmdwpmp01 architecture

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

- Interactive diagram: https://gitdiagram.com/niklasg-127/hausarbeit-dlmdwpmp01
- Repository: https://github.com/niklasg-127/hausarbeit-dlmdwpmp01

## Overview

This small FastAPI application creates orders, keeps them in process memory, and accepts payment requests for those orders. The route layer validates requests and selects a payment method; the order domain enforces payment state and delegates payment execution to a concrete method. The README describes the REST API, while the sampled source shows the route and domain calls; no external payment processor or persistent database is present.

Main entry points: [`main.py`](https://github.com/niklasg-127/hausarbeit-dlmdwpmp01/blob/main/main.py) (FastAPI routes), [`bestellung.py`](https://github.com/niklasg-127/hausarbeit-dlmdwpmp01/blob/main/bestellung.py) (Order state), [`zahlungsmethoden.py`](https://github.com/niklasg-127/hausarbeit-dlmdwpmp01/blob/main/zahlungsmethoden.py) (Payment methods)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_routes["FastAPI routes<br/>[main.py]"]
end

subgraph group_orders["Orders"]
  node_registry[("In-memory orders<br/>[main.py]")]
  node_order["Order state<br/>[bestellung.py]"]
end

subgraph group_payments["Payments"]
  node_methods["Payment methods"]
end

node_client(("API client"))

node_client -->|"sends requests"| node_routes
node_routes -->|"creates order"| node_order
node_routes -->|"stores and looks up"| node_registry
node_routes -->|"selects method"| node_methods
node_order -->|"executes payment"| node_methods

click node_routes "https://github.com/niklasg-127/hausarbeit-dlmdwpmp01/blob/main/main.py"
click node_registry "https://github.com/niklasg-127/hausarbeit-dlmdwpmp01/blob/main/main.py"
click node_order "https://github.com/niklasg-127/hausarbeit-dlmdwpmp01/blob/main/bestellung.py"
click node_methods "https://github.com/niklasg-127/hausarbeit-dlmdwpmp01/blob/main/zahlungsmethoden.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_routes,node_client toneBlue
class node_registry,node_order toneAmber
class node_methods toneMint
```

## Components

### API

- [FastAPI routes](https://github.com/niklasg-127/hausarbeit-dlmdwpmp01/blob/main/main.py): `main.py`

### Orders

- [In-memory orders](https://github.com/niklasg-127/hausarbeit-dlmdwpmp01/blob/main/main.py): `main.py`
- [Order state](https://github.com/niklasg-127/hausarbeit-dlmdwpmp01/blob/main/bestellung.py): `bestellung.py`

### Payments

- [Payment methods](https://github.com/niklasg-127/hausarbeit-dlmdwpmp01/blob/main/zahlungsmethoden.py): `zahlungsmethoden.py`

### Other components

- **API client**

## Connections

- API client → FastAPI routes: sends requests (evidence: `README.md`)
- FastAPI routes → Order state: creates order (evidence: `main.py`)
- FastAPI routes → In-memory orders: stores and looks up (evidence: `main.py`)
- FastAPI routes → Payment methods: selects method (evidence: `main.py`)
- Order state → Payment methods: executes payment (evidence: `bestellung.py`)
