# donaldgover/salon-lead-queue architecture

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

- Interactive diagram: https://gitdiagram.com/donaldgover/salon-lead-queue
- Repository: https://github.com/donaldgover/salon-lead-queue

## Overview

This FastAPI salon-management system accepts lead and catalog requests, validates them, persists records, and provides scored/reorderable lead queues plus catalog browsing and maintenance. The main user workflow is lead entry → scoring → queue management → API/dashboard results; a separate catalog workflow covers category/service maintenance and seeded catalog data. Dashboard templates and the health endpoint are documented capabilities. Relationships reflect shown calls and README claims; template rendering details and unsampled router behavior are limited to explicit evidence.

Main entry points: [`app/database.py`](https://github.com/donaldgover/salon-lead-queue/blob/master/app/database.py) (Database sessions), [`app/main.py`](https://github.com/donaldgover/salon-lead-queue/blob/master/app/main.py) (FastAPI app), [`app/routers/dashboard.py`](https://github.com/donaldgover/salon-lead-queue/blob/master/app/routers/dashboard.py) (Dashboard routes), [`app/routers/leads.py`](https://github.com/donaldgover/salon-lead-queue/blob/master/app/routers/leads.py) (Lead API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_app["FastAPI app<br/>[main.py]"]
  node_health["Health endpoint<br/>[health.py]"]
  node_schemas["Request validation<br/>[schemas.py]"]
end

subgraph group_leads["Lead workflow"]
  node_lead_api["Lead API<br/>[leads.py]"]
  node_lead_crud["Lead operations<br/>[crud.py]"]
  node_scoring["Lead scoring<br/>[scoring.py]"]
  node_queue_api["Queue API<br/>[queue.py]"]
  node_queue_manager["Queue manager<br/>[prioritization.py]"]
end

subgraph group_catalog["Service catalog"]
  node_catalog_api["Catalog API<br/>[services.py]"]
  node_catalog_ops["Catalog operations<br/>[crud.py]"]
  node_catalog_seed["Seed catalog data<br/>[catalog.py]"]
end

subgraph group_persistence["Data layer"]
  node_models["ORM models<br/>[models.py]"]
  node_database[("Database sessions<br/>[database.py]")]
  node_config["Configuration<br/>[config.py]"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard_api["Dashboard routes<br/>[dashboard.py]"]
  node_templates["HTML views"]
end

node_user(("Salon staff"))
node_postgres[("PostgreSQL")]

node_user -->|"sends requests"| node_app
node_app -->|"initializes"| node_database
node_app -->|"registers"| node_health
node_app -->|"registers"| node_lead_api
node_app -->|"registers"| node_queue_api
node_app -->|"registers"| node_catalog_api
node_app -->|"registers"| node_dashboard_api
node_lead_api -->|"validates with"| node_schemas
node_lead_api -->|"calls"| node_lead_crud
node_lead_crud -->|"calculates score"| node_scoring
node_queue_api -->|"calls"| node_queue_manager
node_queue_manager -->|"recalculates with"| node_scoring
node_catalog_api -->|"validates with"| node_schemas
node_catalog_api -->|"calls"| node_catalog_ops
node_catalog_ops -->|"seeds from"| node_catalog_seed
node_dashboard_api -->|"gets queue and stats"| node_queue_manager
node_dashboard_api -->|"gets catalog data"| node_catalog_ops
node_dashboard_api -->|"renders"| node_templates
node_database -->|"reads settings"| node_config
node_database -->|"creates tables"| node_models
node_database -.->|"connects to"| node_postgres
node_lead_crud -->|"reads and writes"| node_models
node_catalog_ops -->|"reads and writes"| node_models
node_queue_manager -->|"queries and updates"| node_models
node_lead_api -->|"gets sessions"| node_database
node_queue_api -->|"gets sessions"| node_database
node_catalog_api -->|"gets sessions"| node_database
node_dashboard_api -->|"gets sessions"| node_database

click node_app "https://github.com/donaldgover/salon-lead-queue/blob/master/app/main.py"
click node_health "https://github.com/donaldgover/salon-lead-queue/blob/master/app/routers/health.py"
click node_lead_api "https://github.com/donaldgover/salon-lead-queue/blob/master/app/routers/leads.py"
click node_lead_crud "https://github.com/donaldgover/salon-lead-queue/blob/master/app/crud.py"
click node_scoring "https://github.com/donaldgover/salon-lead-queue/blob/master/app/services/scoring.py"
click node_queue_api "https://github.com/donaldgover/salon-lead-queue/blob/master/app/routers/queue.py"
click node_queue_manager "https://github.com/donaldgover/salon-lead-queue/blob/master/app/services/prioritization.py"
click node_catalog_api "https://github.com/donaldgover/salon-lead-queue/blob/master/app/routers/services.py"
click node_catalog_ops "https://github.com/donaldgover/salon-lead-queue/blob/master/app/crud.py"
click node_catalog_seed "https://github.com/donaldgover/salon-lead-queue/blob/master/app/data/catalog.py"
click node_dashboard_api "https://github.com/donaldgover/salon-lead-queue/blob/master/app/routers/dashboard.py"
click node_templates "https://github.com/donaldgover/salon-lead-queue/tree/master/app/templates"
click node_schemas "https://github.com/donaldgover/salon-lead-queue/blob/master/app/schemas.py"
click node_models "https://github.com/donaldgover/salon-lead-queue/blob/master/app/models.py"
click node_database "https://github.com/donaldgover/salon-lead-queue/blob/master/app/database.py"
click node_config "https://github.com/donaldgover/salon-lead-queue/blob/master/app/config.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_app,node_health,node_schemas toneBlue
class node_lead_api,node_lead_crud,node_scoring,node_queue_api,node_queue_manager,node_postgres toneAmber
class node_catalog_api,node_catalog_ops,node_catalog_seed toneMint
class node_models,node_database,node_config toneRose
class node_dashboard_api,node_templates,node_user toneIndigo
```

## Components

### API entry

- [FastAPI app](https://github.com/donaldgover/salon-lead-queue/blob/master/app/main.py): `app/main.py`
- [Health endpoint](https://github.com/donaldgover/salon-lead-queue/blob/master/app/routers/health.py): `app/routers/health.py`
- [Request validation](https://github.com/donaldgover/salon-lead-queue/blob/master/app/schemas.py): `app/schemas.py`

### Lead workflow

- [Lead API](https://github.com/donaldgover/salon-lead-queue/blob/master/app/routers/leads.py): `app/routers/leads.py`
- [Lead operations](https://github.com/donaldgover/salon-lead-queue/blob/master/app/crud.py): `app/crud.py`
- [Lead scoring](https://github.com/donaldgover/salon-lead-queue/blob/master/app/services/scoring.py): `app/services/scoring.py`
- [Queue API](https://github.com/donaldgover/salon-lead-queue/blob/master/app/routers/queue.py): `app/routers/queue.py`
- [Queue manager](https://github.com/donaldgover/salon-lead-queue/blob/master/app/services/prioritization.py): `app/services/prioritization.py`

### Service catalog

- [Catalog API](https://github.com/donaldgover/salon-lead-queue/blob/master/app/routers/services.py): `app/routers/services.py`
- [Catalog operations](https://github.com/donaldgover/salon-lead-queue/blob/master/app/crud.py): `app/crud.py`
- [Seed catalog data](https://github.com/donaldgover/salon-lead-queue/blob/master/app/data/catalog.py): `app/data/catalog.py`

### Data layer

- [ORM models](https://github.com/donaldgover/salon-lead-queue/blob/master/app/models.py): `app/models.py`
- [Database sessions](https://github.com/donaldgover/salon-lead-queue/blob/master/app/database.py): `app/database.py`
- [Configuration](https://github.com/donaldgover/salon-lead-queue/blob/master/app/config.py): `app/config.py`

### Dashboard

- [Dashboard routes](https://github.com/donaldgover/salon-lead-queue/blob/master/app/routers/dashboard.py): `app/routers/dashboard.py`
- [HTML views](https://github.com/donaldgover/salon-lead-queue/tree/master/app/templates): `app/templates`

### Other components

- **Salon staff**
- **PostgreSQL**

## Connections

- Salon staff → FastAPI app: sends requests (evidence: `README.md`)
- FastAPI app → Database sessions: initializes (evidence: `app/main.py`)
- FastAPI app → Health endpoint: registers (evidence: `app/main.py`)
- FastAPI app → Lead API: registers (evidence: `app/main.py`)
- FastAPI app → Queue API: registers (evidence: `app/main.py`)
- FastAPI app → Catalog API: registers (evidence: `app/main.py`)
- FastAPI app → Dashboard routes: registers (evidence: `app/main.py`)
- Lead API → Request validation: validates with (evidence: `app/routers/leads.py`)
- Lead API → Lead operations: calls (evidence: `app/routers/leads.py`)
- Lead operations → Lead scoring: calculates score (evidence: `app/crud.py`)
- Queue API → Queue manager: calls (evidence: `app/routers/queue.py`)
- Queue manager → Lead scoring: recalculates with (evidence: `app/services/prioritization.py`)
- Catalog API → Request validation: validates with (evidence: `app/routers/services.py`)
- Catalog API → Catalog operations: calls (evidence: `app/routers/services.py`)
- Catalog operations → Seed catalog data: seeds from (evidence: `app/crud.py`)
- Dashboard routes → Queue manager: gets queue and stats (evidence: `app/routers/dashboard.py`)
- Dashboard routes → Catalog operations: gets catalog data (evidence: `app/routers/dashboard.py`)
- Dashboard routes → HTML views: renders (evidence: `app/routers/dashboard.py`)
- Database sessions → Configuration: reads settings (evidence: `app/database.py`)
- Database sessions → ORM models: creates tables (evidence: `app/database.py`)
- Database sessions → PostgreSQL: connects to
- Lead operations → ORM models: reads and writes (evidence: `app/crud.py`)
- Catalog operations → ORM models: reads and writes (evidence: `app/crud.py`)
- Queue manager → ORM models: queries and updates (evidence: `app/services/prioritization.py`)
- Lead API → Database sessions: gets sessions (evidence: `app/routers/leads.py`)
- Queue API → Database sessions: gets sessions (evidence: `app/routers/queue.py`)
- Catalog API → Database sessions: gets sessions (evidence: `app/routers/services.py`)
- Dashboard routes → Database sessions: gets sessions (evidence: `app/routers/dashboard.py`)
