# bront888/catalogue-api architecture

> Architecture diagram of the GitHub repository bront888/catalogue-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bront888/catalogue-api
- Repository: https://github.com/bront888/catalogue-api

## Overview

Catalogue API is a small FastAPI product-management service. Clients submit validated product data, then create, list, retrieve, replace, or delete products; listing can filter by category. The API also exposes a health endpoint. Product state lives in a process-local dictionary and is lost on restart. The workflow and relationships are evidenced by README.md and main.py; tutorial.py is a separate tutorial sample, not part of the documented product.

Main entry points: [`main.py`](https://github.com/bront888/catalogue-api/blob/main/main.py) (Product and health routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_routes["Product and health routes<br/>[main.py]"]
  node_models["Product validation models<br/>[main.py]"]
end

subgraph group_catalog["Product Catalog"]
  node_store[("In-memory product state<br/>[main.py]")]
end

node_client(("API client"))

node_client -->|"sends requests"| node_routes
node_routes -->|"validates payloads"| node_models
node_routes -->|"reads and writes"| node_store
node_routes -->|"returns responses"| node_client

click node_routes "https://github.com/bront888/catalogue-api/blob/main/main.py"
click node_models "https://github.com/bront888/catalogue-api/blob/main/main.py"
click node_store "https://github.com/bront888/catalogue-api/blob/main/main.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_models,node_client toneBlue
class node_store toneAmber
```

## Components

### HTTP API

- [Product and health routes](https://github.com/bront888/catalogue-api/blob/main/main.py): `main.py`
- [Product validation models](https://github.com/bront888/catalogue-api/blob/main/main.py): `main.py`

### Product Catalog

- [In-memory product state](https://github.com/bront888/catalogue-api/blob/main/main.py): `main.py`

### Other components

- **API client**

## Connections

- API client → Product and health routes: sends requests (evidence: `README.md`)
- Product and health routes → Product validation models: validates payloads (evidence: `main.py`)
- Product and health routes → In-memory product state: reads and writes (evidence: `main.py`)
- Product and health routes → API client: returns responses (evidence: `README.md`)
