# autocurve/autocurve-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/autocurve/autocurve-assistant
- Repository: https://github.com/autocurve/autocurve-assistant

## Overview

AutoCurve is a used-car valuation app combining Craigslist listing data with AI photo-based condition scoring. The main workflow gathers vehicle details and photos, estimates a make/model-specific base price, adjusts it by the visual condition score, and presents comparable listings and market context. The repository includes both a Streamlit interface and a FastAPI/static-web entry point. The README documents Reddit discussion search and the API workflow; the static page implementation was not sampled, so its request wiring is not asserted.

Main entry points: [`AutoCurve/frontend.py`](https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/frontend.py) (Streamlit interface), [`AutoCurve/api.py`](https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/api.py) (FastAPI service), [`AutoCurve/backend.py`](https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/backend.py) (Photo condition analysis), [`AutoCurve/static/index.html`](https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/static/index.html) (Web interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User Interfaces"]
  node_streamlit["Streamlit interface<br/>[frontend.py]"]
  node_webpage["Web interface<br/>[index.html]"]
  node_api["FastAPI service<br/>[api.py]"]
  node_results["Estimate and comparisons<br/>[api.py]"]
end

subgraph group_valuation["Valuation Data"]
  node_valuation["Valuation engine<br/>[backend.py]"]
  node_listings[("Listings dataset<br/>[database.xlsx]")]
end

subgraph group_condition["Condition Scoring"]
  node_vision["Photo condition analysis<br/>[backend.py]"]
  node_limiter["OpenRouter token bucket<br/>[rate_limiter.py]"]
  node_openrouter{{"OpenRouter vision API"}}
end

subgraph group_context["Market Context"]
  node_community["Discussion search<br/>[backend.py]"]
  node_search{{"DuckDuckGo search"}}
end

node_user(("Vehicle shopper"))

node_user -->|"enters details"| node_streamlit
node_streamlit -->|"requests estimate"| node_valuation
node_streamlit -->|"submits photos"| node_vision
node_user -.->|"uses app"| node_webpage
node_webpage -.->|"sends requests"| node_api
node_api -->|"calls valuation"| node_valuation
node_api -->|"requests scoring"| node_vision
node_valuation -->|"loads listings"| node_listings
node_vision -->|"checks quota"| node_limiter
node_vision -->|"sends images"| node_openrouter
node_api -->|"returns estimate"| node_results
node_streamlit -->|"requests discussions"| node_community
node_community -->|"searches Reddit"| node_search

click node_streamlit "https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/frontend.py"
click node_webpage "https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/static/index.html"
click node_api "https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/api.py"
click node_valuation "https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/backend.py"
click node_listings "https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/database.xlsx"
click node_vision "https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/backend.py"
click node_limiter "https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/rate_limiter.py"
click node_results "https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/api.py"
click node_community "https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/backend.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_streamlit,node_webpage,node_api,node_results toneBlue
class node_valuation,node_listings toneAmber
class node_vision,node_limiter,node_openrouter toneMint
class node_community,node_search toneRose
class node_user toneIndigo
```

## Components

### User Interfaces

- [Streamlit interface](https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/frontend.py): `AutoCurve/frontend.py`
- [Web interface](https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/static/index.html): `AutoCurve/static/index.html`
- [FastAPI service](https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/api.py): `AutoCurve/api.py`
- [Estimate and comparisons](https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/api.py): `AutoCurve/api.py`

### Valuation Data

- [Valuation engine](https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/backend.py): `AutoCurve/backend.py`
- [Listings dataset](https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/database.xlsx): `AutoCurve/database.xlsx`

### Condition Scoring

- [Photo condition analysis](https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/backend.py): `AutoCurve/backend.py`
- [OpenRouter token bucket](https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/rate_limiter.py): `AutoCurve/rate_limiter.py`
- **OpenRouter vision API**

### Market Context

- [Discussion search](https://github.com/autocurve/autocurve-assistant/blob/main/AutoCurve/backend.py): `AutoCurve/backend.py`
- **DuckDuckGo search**

### Other components

- **Vehicle shopper**

## Connections

- Vehicle shopper → Streamlit interface: enters details (evidence: `AutoCurve/frontend.py`)
- Streamlit interface → Valuation engine: requests estimate (evidence: `AutoCurve/frontend.py`)
- Streamlit interface → Photo condition analysis: submits photos (evidence: `AutoCurve/frontend.py`)
- Vehicle shopper → Web interface: uses app (evidence: `README.md`)
- Web interface → FastAPI service: sends requests
- FastAPI service → Valuation engine: calls valuation (evidence: `AutoCurve/api.py`)
- FastAPI service → Photo condition analysis: requests scoring (evidence: `AutoCurve/api.py`)
- Valuation engine → Listings dataset: loads listings (evidence: `AutoCurve/backend.py`)
- Photo condition analysis → OpenRouter token bucket: checks quota (evidence: `AutoCurve/backend.py`)
- Photo condition analysis → OpenRouter vision API: sends images (evidence: `AutoCurve/backend.py`)
- FastAPI service → Estimate and comparisons: returns estimate (evidence: `AutoCurve/api.py`)
- Streamlit interface → Discussion search: requests discussions (evidence: `AutoCurve/frontend.py`)
- Discussion search → DuckDuckGo search: searches Reddit (evidence: `AutoCurve/backend.py`)
