# the-pixel-pushers/ctp-project architecture

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

- Interactive diagram: https://gitdiagram.com/the-pixel-pushers/ctp-project
- Repository: https://github.com/the-pixel-pushers/ctp-project
- Video tour (about a minute): https://gitdiagram.com/the-pixel-pushers/ctp-project/video

## Overview

PhotoCull is a photo-quality culling application: the backend accepts batches of image uploads, validates and prepares each image, runs blur and exposure analysis, and returns per-image results. The frontend currently presents upload and gallery experiences backed by mock data; the sampled sources do not show it calling the API, so no frontend-to-backend connection is asserted. The backend entry point, processing path, shared image preparation, analyzer implementations, and mock-driven gallery are evidenced; several backend routes and analyzer modules are indexed but unsampled.

Main entry points: [`backend/app/processing.py`](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/processing.py) (Batch processing), [`backend/app/analyzers/base.py`](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/base.py) (Analyzer contract), [`backend/app/analyzers/overexposure/analyzer.py`](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/overexposure/analyzer.py) (Overexposure analysis), [`backend/app/analyzers/underexposure/analyzer.py`](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/underexposure/analyzer.py) (Underexposure analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["PhotoCull interface"]
  node_app["App and navigation<br/>[App.tsx]"]
  node_uploadview["Upload interface<br/>[UploadView.tsx]"]
  node_gallery["Gallery and filters<br/>[GalleryView.tsx]"]
  node_photocard["Photo card<br/>[PhotoCard.tsx]"]
  node_mockdata["Mock photo data<br/>[mockData.ts]"]
end

subgraph group_service["Analysis service"]
  node_fastapi["FastAPI application<br/>[main.py]"]
  node_routes["Upload API routes<br/>[api.py]"]
  node_config["Runtime settings<br/>[config.py]"]
  node_batch["Batch processing<br/>[processing.py]"]
  node_schemas["Response schemas<br/>[schemas.py]"]
  node_registry["Analyzer registry<br/>[registry.py]"]
end

subgraph group_vision["Image quality analysis"]
  node_imageprep["Image preparation<br/>[imaging.py]"]
  node_contract["Analyzer contract<br/>[base.py]"]
  node_blur["Blur analysis<br/>[analyzer.py]"]
  node_blursettings["Blur settings<br/>[settings.py]"]
  node_luma["Luma helpers<br/>[luma.py]"]
  node_over["Overexposure analysis<br/>[analyzer.py]"]
  node_oversettings["Overexposure settings<br/>[settings.py]"]
  node_under["Underexposure analysis<br/>[analyzer.py]"]
  node_undersettings["Underexposure settings<br/>[settings.py]"]
end

node_photographer(("Photographer"))
node_apiuser(("API client"))

node_photographer -->|"uses"| node_app
node_app -->|"renders"| node_uploadview
node_app -->|"renders"| node_gallery
node_gallery -->|"reads"| node_mockdata
node_gallery -->|"renders"| node_photocard
node_uploadview -->|"reads"| node_mockdata
node_apiuser -.->|"uploads batch"| node_fastapi
node_fastapi -->|"loads"| node_config
node_fastapi -->|"builds"| node_registry
node_fastapi -->|"mounts"| node_routes
node_routes -->|"dispatches"| node_batch
node_routes -->|"reads"| node_config
node_routes -->|"returns"| node_schemas
node_batch -->|"validates with"| node_config
node_batch -->|"prepares"| node_imageprep
node_batch -->|"runs"| node_contract
node_batch -->|"builds results"| node_schemas
node_registry -->|"registers"| node_contract
node_blur -->|"implements"| node_contract
node_blur -->|"analyzes"| node_imageprep
node_blur -->|"uses"| node_blursettings
node_over -->|"implements"| node_contract
node_over -->|"analyzes"| node_imageprep
node_over -->|"uses"| node_luma
node_over -->|"uses"| node_oversettings
node_under -->|"implements"| node_contract
node_under -->|"analyzes"| node_imageprep
node_under -->|"uses"| node_luma
node_under -->|"uses"| node_undersettings

click node_app "https://github.com/the-pixel-pushers/ctp-project/blob/main/frontend/src/App.tsx"
click node_uploadview "https://github.com/the-pixel-pushers/ctp-project/blob/main/frontend/src/components/UploadView.tsx"
click node_gallery "https://github.com/the-pixel-pushers/ctp-project/blob/main/frontend/src/components/GalleryView.tsx"
click node_photocard "https://github.com/the-pixel-pushers/ctp-project/blob/main/frontend/src/components/PhotoCard.tsx"
click node_mockdata "https://github.com/the-pixel-pushers/ctp-project/blob/main/frontend/src/data/mockData.ts"
click node_fastapi "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/main.py"
click node_routes "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/api.py"
click node_config "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/config.py"
click node_batch "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/processing.py"
click node_schemas "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/schemas.py"
click node_registry "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/registry.py"
click node_imageprep "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/imaging.py"
click node_contract "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/base.py"
click node_blur "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/blur/analyzer.py"
click node_blursettings "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/blur/settings.py"
click node_luma "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/luma.py"
click node_over "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/overexposure/analyzer.py"
click node_oversettings "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/overexposure/settings.py"
click node_under "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/underexposure/analyzer.py"
click node_undersettings "https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/underexposure/settings.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_uploadview,node_gallery,node_photocard,node_mockdata,node_apiuser toneBlue
class node_fastapi,node_routes,node_config,node_batch,node_schemas,node_registry toneAmber
class node_imageprep,node_contract,node_blur,node_blursettings,node_luma,node_over,node_oversettings,node_under,node_undersettings toneMint
class node_photographer toneIndigo
```

## Components

### PhotoCull interface

- [App and navigation](https://github.com/the-pixel-pushers/ctp-project/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Upload interface](https://github.com/the-pixel-pushers/ctp-project/blob/main/frontend/src/components/UploadView.tsx): `frontend/src/components/UploadView.tsx`
- [Gallery and filters](https://github.com/the-pixel-pushers/ctp-project/blob/main/frontend/src/components/GalleryView.tsx): `frontend/src/components/GalleryView.tsx`
- [Photo card](https://github.com/the-pixel-pushers/ctp-project/blob/main/frontend/src/components/PhotoCard.tsx): `frontend/src/components/PhotoCard.tsx`
- [Mock photo data](https://github.com/the-pixel-pushers/ctp-project/blob/main/frontend/src/data/mockData.ts): `frontend/src/data/mockData.ts`

### Analysis service

- [FastAPI application](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/main.py): `backend/app/main.py`
- [Upload API routes](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/api.py): `backend/app/api.py`
- [Runtime settings](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/config.py): `backend/app/config.py`
- [Batch processing](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/processing.py): `backend/app/processing.py`
- [Response schemas](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/schemas.py): `backend/app/schemas.py`
- [Analyzer registry](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/registry.py): `backend/app/analyzers/registry.py`

### Image quality analysis

- [Image preparation](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/imaging.py): `backend/app/imaging.py`
- [Analyzer contract](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/base.py): `backend/app/analyzers/base.py`
- [Blur analysis](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/blur/analyzer.py): `backend/app/analyzers/blur/analyzer.py`
- [Blur settings](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/blur/settings.py): `backend/app/analyzers/blur/settings.py`
- [Luma helpers](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/luma.py): `backend/app/analyzers/luma.py`
- [Overexposure analysis](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/overexposure/analyzer.py): `backend/app/analyzers/overexposure/analyzer.py`
- [Overexposure settings](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/overexposure/settings.py): `backend/app/analyzers/overexposure/settings.py`
- [Underexposure analysis](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/underexposure/analyzer.py): `backend/app/analyzers/underexposure/analyzer.py`
- [Underexposure settings](https://github.com/the-pixel-pushers/ctp-project/blob/main/backend/app/analyzers/underexposure/settings.py): `backend/app/analyzers/underexposure/settings.py`

### Other components

- **Photographer**
- **API client**

## Connections

- Photographer → App and navigation: uses (evidence: `frontend/src/App.tsx`)
- App and navigation → Upload interface: renders (evidence: `frontend/src/App.tsx`)
- App and navigation → Gallery and filters: renders (evidence: `frontend/src/App.tsx`)
- Gallery and filters → Mock photo data: reads (evidence: `frontend/src/components/GalleryView.tsx`)
- Gallery and filters → Photo card: renders (evidence: `frontend/src/components/GalleryView.tsx`)
- Upload interface → Mock photo data: reads (evidence: `frontend/src/components/UploadView.tsx`)
- API client → FastAPI application: uploads batch
- FastAPI application → Runtime settings: loads (evidence: `backend/app/main.py`)
- FastAPI application → Analyzer registry: builds (evidence: `backend/app/main.py`)
- FastAPI application → Upload API routes: mounts (evidence: `backend/app/main.py`)
- Upload API routes → Batch processing: dispatches (evidence: `backend/app/api.py`)
- Upload API routes → Runtime settings: reads (evidence: `backend/app/api.py`)
- Upload API routes → Response schemas: returns (evidence: `backend/app/api.py`)
- Batch processing → Runtime settings: validates with (evidence: `backend/app/processing.py`)
- Batch processing → Image preparation: prepares (evidence: `backend/app/processing.py`)
- Batch processing → Analyzer contract: runs (evidence: `backend/app/processing.py`)
- Batch processing → Response schemas: builds results (evidence: `backend/app/processing.py`)
- Analyzer registry → Analyzer contract: registers (evidence: `backend/app/analyzers/registry.py`)
- Blur analysis → Analyzer contract: implements (evidence: `backend/app/analyzers/blur/analyzer.py`)
- Blur analysis → Image preparation: analyzes (evidence: `backend/app/analyzers/blur/analyzer.py`)
- Blur analysis → Blur settings: uses (evidence: `backend/app/analyzers/blur/analyzer.py`)
- Overexposure analysis → Analyzer contract: implements (evidence: `backend/app/analyzers/overexposure/analyzer.py`)
- Overexposure analysis → Image preparation: analyzes (evidence: `backend/app/analyzers/overexposure/analyzer.py`)
- Overexposure analysis → Luma helpers: uses (evidence: `backend/app/analyzers/overexposure/analyzer.py`)
- Overexposure analysis → Overexposure settings: uses (evidence: `backend/app/analyzers/overexposure/analyzer.py`)
- Underexposure analysis → Analyzer contract: implements (evidence: `backend/app/analyzers/underexposure/analyzer.py`)
- Underexposure analysis → Image preparation: analyzes (evidence: `backend/app/analyzers/underexposure/analyzer.py`)
- Underexposure analysis → Luma helpers: uses (evidence: `backend/app/analyzers/underexposure/analyzer.py`)
- Underexposure analysis → Underexposure settings: uses (evidence: `backend/app/analyzers/underexposure/analyzer.py`)
