# workoidz/crow-website architecture

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

- Interactive diagram: https://gitdiagram.com/workoidz/crow-website
- Repository: https://github.com/workoidz/crow-website

## Overview

Crow Website is a small C++ web server serving a browser-facing site and REST-style JSON endpoints. The main flow is a browser request reaching the Crow application, being routed to a page, API, or health response, then returned over the network; the frontend JavaScript also exercises the API. Crow’s request parsing, routing, and response types form the useful internal layer. README documents the routes and static-file behavior; source excerpts and the index establish framework relationships, but the route implementations in main.cpp were not excerpted.

Main entry points: [`src/main.cpp`](https://github.com/workoidz/crow-website/blob/main/src/main.cpp) (Web server), [`include/crow/routing.h`](https://github.com/workoidz/crow-website/blob/main/include/crow/routing.h) (Route dispatch), [`public/js/main.js`](https://github.com/workoidz/crow-website/blob/main/public/js/main.js) (API interface), [`public`](https://github.com/workoidz/crow-website/tree/main/public) (Static site files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser client"]
  node_browser["Browser"]
  node_frontend["API interface<br/>[main.js]"]
end

subgraph group_website["Website application"]
  node_server["Web server<br/>[main.cpp]"]
  node_site_files["Static site files"]
end

subgraph group_crow["Crow framework"]
  node_routes["Route dispatch<br/>[routing.h]"]
  node_request["HTTP request<br/>[http_request.h]"]
  node_response["HTTP response<br/>[http_response.h]"]
  node_json["JSON encoding<br/>[json.h]"]
  node_middleware["CORS middleware<br/>[middleware.h]"]
end

subgraph group_transport["Network transport"]
  node_asio["Async I/O<br/>[asio.hpp]"]
end

node_visitor(("Visitor"))
node_client_network(("HTTP clients"))

node_visitor -->|"uses"| node_browser
node_browser -->|"requests pages"| node_server
node_frontend -->|"tests API"| node_server
node_server -->|"serves files"| node_site_files
node_server -->|"configures routes"| node_routes
node_server -.->|"enables CORS"| node_middleware
node_client_network -->|"calls endpoints"| node_server
node_routes -->|"dispatches request"| node_request
node_routes -->|"sets response"| node_response
node_server -.->|"returns JSON"| node_json
node_server -.->|"uses I/O"| node_asio

click node_frontend "https://github.com/workoidz/crow-website/blob/main/public/js/main.js"
click node_server "https://github.com/workoidz/crow-website/blob/main/src/main.cpp"
click node_site_files "https://github.com/workoidz/crow-website/tree/main/public"
click node_routes "https://github.com/workoidz/crow-website/blob/main/include/crow/routing.h"
click node_request "https://github.com/workoidz/crow-website/blob/main/include/crow/http_request.h"
click node_response "https://github.com/workoidz/crow-website/blob/main/include/crow/http_response.h"
click node_json "https://github.com/workoidz/crow-website/blob/main/include/crow/json.h"
click node_middleware "https://github.com/workoidz/crow-website/blob/main/include/crow/middleware.h"
click node_asio "https://github.com/workoidz/crow-website/blob/main/include/asio.hpp"

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_browser,node_frontend,node_client_network toneBlue
class node_server,node_site_files toneAmber
class node_routes,node_request,node_response,node_json,node_middleware toneMint
class node_asio toneRose
class node_visitor toneIndigo
```

## Components

### Browser client

- **Browser**
- [API interface](https://github.com/workoidz/crow-website/blob/main/public/js/main.js): `public/js/main.js`

### Website application

- [Web server](https://github.com/workoidz/crow-website/blob/main/src/main.cpp): `src/main.cpp`
- [Static site files](https://github.com/workoidz/crow-website/tree/main/public): `public`

### Crow framework

- [Route dispatch](https://github.com/workoidz/crow-website/blob/main/include/crow/routing.h): `include/crow/routing.h`
- [HTTP request](https://github.com/workoidz/crow-website/blob/main/include/crow/http_request.h): `include/crow/http_request.h`
- [HTTP response](https://github.com/workoidz/crow-website/blob/main/include/crow/http_response.h): `include/crow/http_response.h`
- [JSON encoding](https://github.com/workoidz/crow-website/blob/main/include/crow/json.h): `include/crow/json.h`
- [CORS middleware](https://github.com/workoidz/crow-website/blob/main/include/crow/middleware.h): `include/crow/middleware.h`

### Network transport

- [Async I/O](https://github.com/workoidz/crow-website/blob/main/include/asio.hpp): `include/asio.hpp`

### Other components

- **Visitor**
- **HTTP clients**

## Connections

- Visitor → Browser: uses (evidence: `README.md`)
- Browser → Web server: requests pages (evidence: `README.md`)
- API interface → Web server: tests API (evidence: `README.md`)
- Web server → Static site files: serves files (evidence: `README.md`)
- Web server → Route dispatch: configures routes
- Web server → CORS middleware: enables CORS (evidence: `README.md`)
- HTTP clients → Web server: calls endpoints (evidence: `README.md`)
- Route dispatch → HTTP request: dispatches request (evidence: `include/crow/routing.h`)
- Route dispatch → HTTP response: sets response (evidence: `include/crow/routing.h`)
- Web server → JSON encoding: returns JSON (evidence: `README.md`)
- Web server → Async I/O: uses I/O (evidence: `README.md`)
