# cjhammel/craftroom_inventory architecture

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

- Interactive diagram: https://gitdiagram.com/cjhammel/craftroom_inventory
- Repository: https://github.com/cjhammel/craftroom_inventory

## Overview

CraftRoom Product Inventory is a web app for cataloguing craft stamps. Users browse and filter a collection, inspect a stamp, and add or edit records with optional image upload and AI suggestions; they can also manage storage locations and AI settings. The React pages call the FastAPI routes, which own backend operations over stamp and location data. The backend also handles image processing, configuration, and optional AI-server requests. Relationships among frontend pages and routes are supported by excerpts or README endpoint documentation; unsampled implementation details are not inferred.

Main entry points: [`backend/app/main.py`](https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/main.py) (FastAPI routes), [`frontend/src/App.jsx`](https://github.com/cjhammel/craftroom_inventory/blob/main/frontend/src/App.jsx) (React app router), [`frontend/src/pages/StampForm.jsx`](https://github.com/cjhammel/craftroom_inventory/blob/main/frontend/src/pages/StampForm.jsx) (Stamp editor), [`backend/app/crud.py`](https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/crud.py) (Catalog operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Inventory UI"]
  node_app["React app router<br/>[App.jsx]"]
  node_listing["Stamp search<br/>[StampsList.jsx]"]
  node_detail["Stamp details<br/>[StampDetail.jsx]"]
  node_form["Stamp editor<br/>[StampForm.jsx]"]
  node_settings["Location and AI settings<br/>[Settings.jsx]"]
end

subgraph group_api["Application API"]
  node_api_routes["FastAPI routes<br/>[main.py]"]
  node_schemas["Request and response schemas<br/>[schemas.py]"]
end

subgraph group_domain["Catalog Data"]
  node_crud["Catalog operations<br/>[crud.py]"]
  node_models["Stamp and location models<br/>[models.py]"]
  node_database[("Database sessions<br/>[database.py]")]
end

subgraph group_services["Supporting Services"]
  node_config["App configuration<br/>[config.py]"]
  node_image["Image processing<br/>[image_utils.py]"]
end

node_user(("Inventory user"))
node_ai["AI analysis server"]
node_yaml["Runtime YAML config<br/>[config.yaml]"]
node_sqlite[("SQLite catalog")]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_listing
node_app -->|"routes to"| node_detail
node_app -->|"routes to"| node_form
node_app -->|"routes to"| node_settings
node_listing -->|"requests stamps"| node_api_routes
node_detail -->|"requests record"| node_api_routes
node_form -->|"submits record"| node_api_routes
node_form -->|"requests analysis"| node_api_routes
node_settings -->|"manages settings"| node_api_routes
node_api_routes -->|"validates data"| node_schemas
node_api_routes -->|"calls operations"| node_crud
node_crud -->|"queries entities"| node_models
node_crud -->|"uses session"| node_database
node_database -->|"initializes tables"| node_models
node_database -->|"persists data"| node_sqlite
node_api_routes -->|"processes uploads"| node_image
node_api_routes -->|"reads and updates"| node_config
node_config -->|"loads and saves"| node_yaml
node_api_routes -->|"sends image analysis"| node_ai

click node_app "https://github.com/cjhammel/craftroom_inventory/blob/main/frontend/src/App.jsx"
click node_listing "https://github.com/cjhammel/craftroom_inventory/blob/main/frontend/src/pages/StampsList.jsx"
click node_detail "https://github.com/cjhammel/craftroom_inventory/blob/main/frontend/src/pages/StampDetail.jsx"
click node_form "https://github.com/cjhammel/craftroom_inventory/blob/main/frontend/src/pages/StampForm.jsx"
click node_settings "https://github.com/cjhammel/craftroom_inventory/blob/main/frontend/src/pages/Settings.jsx"
click node_api_routes "https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/main.py"
click node_schemas "https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/schemas.py"
click node_crud "https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/crud.py"
click node_models "https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/models.py"
click node_database "https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/database.py"
click node_config "https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/config.py"
click node_image "https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/image_utils.py"
click node_yaml "https://github.com/cjhammel/craftroom_inventory/blob/main/config/config.yaml"

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_app,node_listing,node_detail,node_form,node_settings,node_user toneBlue
class node_api_routes,node_schemas,node_sqlite toneAmber
class node_crud,node_models,node_database,node_ai toneMint
class node_config,node_image toneRose
class node_yaml toneTeal
```

## Components

### Inventory UI

- [React app router](https://github.com/cjhammel/craftroom_inventory/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Stamp search](https://github.com/cjhammel/craftroom_inventory/blob/main/frontend/src/pages/StampsList.jsx): `frontend/src/pages/StampsList.jsx`
- [Stamp details](https://github.com/cjhammel/craftroom_inventory/blob/main/frontend/src/pages/StampDetail.jsx): `frontend/src/pages/StampDetail.jsx`
- [Stamp editor](https://github.com/cjhammel/craftroom_inventory/blob/main/frontend/src/pages/StampForm.jsx): `frontend/src/pages/StampForm.jsx`
- [Location and AI settings](https://github.com/cjhammel/craftroom_inventory/blob/main/frontend/src/pages/Settings.jsx): `frontend/src/pages/Settings.jsx`

### Application API

- [FastAPI routes](https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/main.py): `backend/app/main.py`
- [Request and response schemas](https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/schemas.py): `backend/app/schemas.py`

### Catalog Data

- [Catalog operations](https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/crud.py): `backend/app/crud.py`
- [Stamp and location models](https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/models.py): `backend/app/models.py`
- [Database sessions](https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/database.py): `backend/app/database.py`

### Supporting Services

- [App configuration](https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/config.py): `backend/app/config.py`
- [Image processing](https://github.com/cjhammel/craftroom_inventory/blob/main/backend/app/image_utils.py): `backend/app/image_utils.py`

### Other components

- **Inventory user**
- **AI analysis server**
- [Runtime YAML config](https://github.com/cjhammel/craftroom_inventory/blob/main/config/config.yaml): `config/config.yaml`
- **SQLite catalog**

## Connections

- Inventory user → React app router: uses (evidence: `README.md`)
- React app router → Stamp search: routes to (evidence: `frontend/src/App.jsx`)
- React app router → Stamp details: routes to (evidence: `frontend/src/App.jsx`)
- React app router → Stamp editor: routes to (evidence: `frontend/src/App.jsx`)
- React app router → Location and AI settings: routes to (evidence: `frontend/src/App.jsx`)
- Stamp search → FastAPI routes: requests stamps (evidence: `frontend/src/pages/StampsList.jsx`)
- Stamp details → FastAPI routes: requests record (evidence: `frontend/src/pages/StampDetail.jsx`)
- Stamp editor → FastAPI routes: submits record (evidence: `frontend/src/pages/StampForm.jsx`)
- Stamp editor → FastAPI routes: requests analysis (evidence: `frontend/src/pages/StampForm.jsx`)
- Location and AI settings → FastAPI routes: manages settings (evidence: `frontend/src/pages/Settings.jsx`)
- FastAPI routes → Request and response schemas: validates data (evidence: `backend/app/main.py`)
- FastAPI routes → Catalog operations: calls operations (evidence: `backend/app/main.py`)
- Catalog operations → Stamp and location models: queries entities (evidence: `backend/app/crud.py`)
- Catalog operations → Database sessions: uses session (evidence: `backend/app/crud.py`)
- Database sessions → Stamp and location models: initializes tables (evidence: `backend/app/database.py`)
- Database sessions → SQLite catalog: persists data (evidence: `README.md`)
- FastAPI routes → Image processing: processes uploads (evidence: `backend/app/main.py`)
- FastAPI routes → App configuration: reads and updates (evidence: `backend/app/main.py`)
- App configuration → Runtime YAML config: loads and saves (evidence: `backend/app/config.py`)
- FastAPI routes → AI analysis server: sends image analysis (evidence: `README.md`)
