# raghunandhang/simple-wsgi-app architecture

> Architecture diagram of the GitHub repository raghunandhang/simple-wsgi-app, 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/raghunandhang/simple-wsgi-app
- Repository: https://github.com/raghunandhang/simple-wsgi-app

## Overview

This is a minimal WSGI teaching web app. A browser request reaches the built-in WSGI server, which dispatches to the application’s URL router; the router selects a page handler, which builds HTML and sets the response status and headers. The server then delivers the WSGI response. The README also documents request logging and the home page’s request details. Source excerpts support the runtime calls; the README supplies the protocol-level request/response relationship.

Main entry points: [`wsgi_server.py`](https://github.com/raghunandhang/simple-wsgi-app/blob/main/wsgi_server.py) (WSGI server), [`simple_wsgi_app.py`](https://github.com/raghunandhang/simple-wsgi-app/blob/main/simple_wsgi_app.py) (URL router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Web runtime"]
  node_server["WSGI server<br/>[wsgi_server.py]"]
  node_router["URL router<br/>[simple_wsgi_app.py]"]
  node_handlers["Page handlers<br/>[simple_wsgi_app.py]"]
end

node_browser(("Browser"))

node_browser -->|"sends request"| node_server
node_server -->|"dispatches to"| node_router
node_router -->|"routes request"| node_handlers
node_handlers -->|"returns response"| node_server
node_server -->|"serves response"| node_browser

click node_server "https://github.com/raghunandhang/simple-wsgi-app/blob/main/wsgi_server.py"
click node_router "https://github.com/raghunandhang/simple-wsgi-app/blob/main/simple_wsgi_app.py"
click node_handlers "https://github.com/raghunandhang/simple-wsgi-app/blob/main/simple_wsgi_app.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_server,node_router,node_handlers,node_browser toneBlue
```

## Components

### Web runtime

- [WSGI server](https://github.com/raghunandhang/simple-wsgi-app/blob/main/wsgi_server.py): `wsgi_server.py`
- [URL router](https://github.com/raghunandhang/simple-wsgi-app/blob/main/simple_wsgi_app.py): `simple_wsgi_app.py`
- [Page handlers](https://github.com/raghunandhang/simple-wsgi-app/blob/main/simple_wsgi_app.py): `simple_wsgi_app.py`

### Other components

- **Browser**

## Connections

- Browser → WSGI server: sends request (evidence: `README.md`)
- WSGI server → URL router: dispatches to (evidence: `wsgi_server.py`)
- URL router → Page handlers: routes request (evidence: `simple_wsgi_app.py`)
- Page handlers → WSGI server: returns response (evidence: `README.md`)
- WSGI server → Browser: serves response (evidence: `README.md`)
