# andy1924/kintsugi architecture

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

- Interactive diagram: https://gitdiagram.com/andy1924/kintsugi
- Repository: https://github.com/andy1924/kintsugi

## Overview

Kintsugi combines a visible-mending studio with an asynchronous image-processing backend and a paid maker-service workflow. The main user path is account and photo upload, damage review and sizing, background segmentation and plan generation, then DIY guidance and completion recording; customers can instead request a maker repair. The graph also preserves authentication, private image storage, the maker network, and its quote and logistics workflows. Some route and rendering details are unsampled, so links not shown by excerpts or README documentation are omitted.

Main entry points: [`backend/kintsugi/main.py`](https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/main.py) (FastAPI application), [`backend/kintsugi/worker.py`](https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/worker.py) (Job worker), [`src/ServiceDesk.jsx`](https://github.com/andy1924/kintsugi/blob/main/src/ServiceDesk.jsx) (Service desk), [`src/Studio.jsx`](https://github.com/andy1924/kintsugi/blob/main/src/Studio.jsx) (My studio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_studio["Studio experience"]
  node_web["App entry<br/>[main.jsx]"]
  node_studio_ui["My studio<br/>[Studio.jsx]"]
  node_tutorial["Repair guides<br/>[RepairTutorial.jsx]"]
  node_service_ui["Service desk<br/>[ServiceDesk.jsx]"]
  node_brand["Brand page<br/>[BrandPage.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_processing["Damage and plans"]
  node_worker["Job worker<br/>[worker.py]"]
  node_imaging["Image preparation<br/>[imaging.py]"]
  node_analysis["Damage assessment<br/>[analysis.py]"]
  node_vision["Vision assessment<br/>[vision.py]"]
  node_compiler["Plan compiler<br/>[compiler.py]"]
end

subgraph group_platform["API and persistence"]
  node_api["FastAPI application<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_database[("Application database<br/>[db.py]")]
  node_models["Domain records<br/>[models.py]"]
  node_storage[("Private photo storage<br/>[storage.py]")]
end

subgraph group_network["Maker services"]
  node_network_backend["Maker network<br/>[network.py]"]
end

node_customer(("Customer"))
node_openai["OpenAI vision API"]
node_maker(("Maker"))
node_operator(("Network operator"))

node_customer -->|"opens"| node_web
node_web -->|"presents"| node_studio_ui
node_web -->|"presents"| node_brand
node_studio_ui -->|"requests"| node_api_client
node_studio_ui -->|"renders"| node_tutorial
node_studio_ui -->|"opens"| node_service_ui
node_service_ui -->|"requests"| node_api_client
node_api_client -->|"calls"| node_api
node_api -->|"checks sessions"| node_auth
node_api -->|"queries"| node_database
node_api -->|"uses records"| node_models
node_api -->|"stores photos"| node_storage
node_api -->|"routes services"| node_network_backend
node_worker -->|"claims jobs"| node_database
node_worker -->|"updates projects"| node_models
node_worker -->|"reads photos"| node_storage
node_worker -->|"assesses damage"| node_analysis
node_worker -->|"builds plans"| node_compiler
node_analysis -->|"uses local detection"| node_imaging
node_analysis -->|"requests assessment"| node_vision
node_vision -.->|"submits image"| node_openai
node_customer -->|"follows repair"| node_tutorial
node_customer -->|"requests maker"| node_service_ui
node_service_ui -->|"manages requests"| node_network_backend
node_maker -->|"coordinates repair"| node_service_ui
node_operator -->|"reconciles workflow"| node_network_backend

click node_web "https://github.com/andy1924/kintsugi/blob/main/src/main.jsx"
click node_studio_ui "https://github.com/andy1924/kintsugi/blob/main/src/Studio.jsx"
click node_tutorial "https://github.com/andy1924/kintsugi/blob/main/src/RepairTutorial.jsx"
click node_service_ui "https://github.com/andy1924/kintsugi/blob/main/src/ServiceDesk.jsx"
click node_brand "https://github.com/andy1924/kintsugi/blob/main/src/BrandPage.jsx"
click node_api_client "https://github.com/andy1924/kintsugi/blob/main/src/api.js"
click node_api "https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/main.py"
click node_auth "https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/auth.py"
click node_database "https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/db.py"
click node_models "https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/models.py"
click node_storage "https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/storage.py"
click node_worker "https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/worker.py"
click node_imaging "https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/imaging.py"
click node_analysis "https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/analysis.py"
click node_vision "https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/vision.py"
click node_compiler "https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/compiler.py"
click node_network_backend "https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/network.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_web,node_studio_ui,node_tutorial,node_service_ui,node_brand,node_api_client toneBlue
class node_worker,node_imaging,node_analysis,node_vision,node_compiler toneAmber
class node_api,node_auth,node_database,node_models,node_storage,node_openai toneMint
class node_network_backend toneRose
class node_customer,node_maker,node_operator toneIndigo
```

## Components

### Studio experience

- [App entry](https://github.com/andy1924/kintsugi/blob/main/src/main.jsx): `src/main.jsx`
- [My studio](https://github.com/andy1924/kintsugi/blob/main/src/Studio.jsx): `src/Studio.jsx`
- [Repair guides](https://github.com/andy1924/kintsugi/blob/main/src/RepairTutorial.jsx): `src/RepairTutorial.jsx`
- [Service desk](https://github.com/andy1924/kintsugi/blob/main/src/ServiceDesk.jsx): `src/ServiceDesk.jsx`
- [Brand page](https://github.com/andy1924/kintsugi/blob/main/src/BrandPage.jsx): `src/BrandPage.jsx`
- [API client](https://github.com/andy1924/kintsugi/blob/main/src/api.js): `src/api.js`

### Damage and plans

- [Job worker](https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/worker.py): `backend/kintsugi/worker.py`
- [Image preparation](https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/imaging.py): `backend/kintsugi/imaging.py`
- [Damage assessment](https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/analysis.py): `backend/kintsugi/analysis.py`
- [Vision assessment](https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/vision.py): `backend/kintsugi/vision.py`
- [Plan compiler](https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/compiler.py): `backend/kintsugi/compiler.py`

### API and persistence

- [FastAPI application](https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/main.py): `backend/kintsugi/main.py`
- [Authentication](https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/auth.py): `backend/kintsugi/auth.py`
- [Application database](https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/db.py): `backend/kintsugi/db.py`
- [Domain records](https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/models.py): `backend/kintsugi/models.py`
- [Private photo storage](https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/storage.py): `backend/kintsugi/storage.py`

### Maker services

- [Maker network](https://github.com/andy1924/kintsugi/blob/main/backend/kintsugi/network.py): `backend/kintsugi/network.py`

### Other components

- **Customer**
- **OpenAI vision API**
- **Maker**
- **Network operator**

## Connections

- Customer → App entry: opens (evidence: `README.md`)
- App entry → My studio: presents (evidence: `src/main.jsx`)
- App entry → Brand page: presents (evidence: `src/main.jsx`)
- My studio → API client: requests (evidence: `src/Studio.jsx`)
- My studio → Repair guides: renders (evidence: `src/Studio.jsx`)
- My studio → Service desk: opens (evidence: `src/Studio.jsx`)
- Service desk → API client: requests (evidence: `src/ServiceDesk.jsx`)
- API client → FastAPI application: calls (evidence: `README.md`)
- FastAPI application → Authentication: checks sessions (evidence: `backend/kintsugi/main.py`)
- FastAPI application → Application database: queries (evidence: `backend/kintsugi/main.py`)
- FastAPI application → Domain records: uses records (evidence: `backend/kintsugi/main.py`)
- FastAPI application → Private photo storage: stores photos (evidence: `README.md`)
- FastAPI application → Maker network: routes services (evidence: `backend/kintsugi/main.py`)
- Job worker → Application database: claims jobs (evidence: `backend/kintsugi/worker.py`)
- Job worker → Domain records: updates projects (evidence: `backend/kintsugi/worker.py`)
- Job worker → Private photo storage: reads photos (evidence: `backend/kintsugi/worker.py`)
- Job worker → Damage assessment: assesses damage (evidence: `backend/kintsugi/worker.py`)
- Job worker → Plan compiler: builds plans (evidence: `backend/kintsugi/worker.py`)
- Damage assessment → Image preparation: uses local detection (evidence: `backend/kintsugi/analysis.py`)
- Damage assessment → Vision assessment: requests assessment (evidence: `backend/kintsugi/analysis.py`)
- Vision assessment → OpenAI vision API: submits image (evidence: `README.md`)
- Customer → Repair guides: follows repair (evidence: `README.md`)
- Customer → Service desk: requests maker (evidence: `README.md`)
- Service desk → Maker network: manages requests (evidence: `src/ServiceDesk.jsx`)
- Maker → Service desk: coordinates repair (evidence: `README.md`)
- Network operator → Maker network: reconciles workflow (evidence: `README.md`)
