How ipunsoumya/photo-curator works
Purpose and entry points
This is a full-stack photo-curation application: a browser UI drives a Python backend that manages photo batches, review decisions, training/classification, and integration with an Immich photo service. The frontend boots at frontend/src/main.jsx and renders the application shell in frontend/src/App.jsx. The backend API starts from backend/main.py.
Frontend application and user state
The Vite-based React frontend provides distinct workflow screens for authentication, active photo review, historical batches, settings, and training metrics:
• frontend/src/pages/Login.jsx
• frontend/src/pages/ReviewQueue.jsx
• frontend/src/pages/BatchHistory.jsx
• frontend/src/pages/Settings.jsx
• frontend/src/pages/TrainingStats.jsx
frontend/src/context/AuthContext.jsx owns client-side authentication state, while frontend/src/api.js is the boundary for requests to the backend. UI components should not directly depend on backend services or persistence details.
API routing and workflow boundary
The backend separates HTTP concerns by domain routes:
• backend/routes/auth.py
• backend/routes/photos.py
• backend/routes/batches.py
• backend/routes/decisions.py
• backend/routes/training.py
backend/main.py composes the application and route layer. The primary control flow is: authenticated frontend request → domain route → service layer → database and/or external provider → API response. Batch and photo routes likely establish review work; decision routes record human curation outcomes; training routes expose or initiate learning/classification-related operations.
Persistence and application configuration
backend/config.py centralizes runtime configuration, including values needed by database and external integrations. backend/database.py is the persistence boundary, backed in the repository by backend/photocurator.db, indicating a local SQLite deployment model. Routes and services should access storage through this module rather than coupling directly to the database file.
The database is the durable source for application-owned state such as authentication-related records, batches, review decisions, sessions, and training data. Immich remains the likely system of record for upstream photo assets.
Curation, learning, and automation services
The core decisioning pipeline is implemented in the service layer:
• backend/services/classifier.py
• backend/services/rule_extractor.py
• backend/services/prompt_builder.py
• backend/services/llm_client.py
• backend/services/scheduler.py
Human decisions from the review workflow can feed rule extraction and classifier behavior. prompt_builder.py prepares structured context for llm_client.py, creating a clear boundary between local curation logic and an external LLM provider. scheduler.py is the likely orchestration point for deferred, periodic, or batch-oriented processing rather than request-time UI handling.
External systems and session boundaries
backend/services/immich.py encapsulates communication with Immich and should isolate remote photo retrieval or update semantics from routes and classifiers. backend/services/session.py supports server-side session/authentication lifecycle, with backend/routes/auth.py as its HTTP-facing counterpart.
Material runtime dependencies are Python backend packages declared in backend/requirements.txt and the Node/Vite frontend declared in frontend/package.json. The main infrastructure boundaries are: React browser client, Python API process, local SQLite database, Immich service, and an LLM service accessed through backend/services/llm_client.py.
Main entry points: database.py Persistence boundary · config.py Runtime configuration · App.jsx Application shell · api.js Backend API client
Components 18
React frontend
- Frontend bootstrap
frontend/src/main.jsx - Application shell
frontend/src/App.jsx - Auth state
frontend/src/context/AuthContext.jsx - Backend API client
frontend/src/api.js - Curation workflows · Login, review queue, batch history, settings, and training metrics screens.
Python backend
- API application
backend/main.py - Domain routes · Authentication, photos, batches, decisions, and training endpoints.
- Session lifecycle
backend/services/session.py - Curation services · Establishes review work and records curation outcomes.
- Classifier
backend/services/classifier.py - Rule extraction · Derives curation rules from human decisions.
backend/services/rule_extractor.py - Prompt builder
backend/services/prompt_builder.py - Batch scheduler · Runs deferred or periodic processing.
backend/services/scheduler.py - Persistence boundary · Routes and services access application-owned state through this module.
backend/database.py - Runtime configuration · Supplies database and provider integration settings.
backend/config.py
Infrastructure & providers
- Local SQLite state · Durable application state for accounts, batches, decisions, sessions, and training data.
backend/photocurator.db - Immich integration · Isolates remote photo retrieval and update semantics.
backend/services/immich.py - LLM provider client
backend/services/llm_client.py
Connections 22
- Frontend bootstrap → Application shell: renders
- Application shell → Auth state: uses
- Application shell → Curation workflows: hosts
- Curation workflows → Backend API client: requests
- Auth state → Backend API client: authenticates requests
- Backend API client → API application: HTTP
- API application → Domain routes: composes
- Domain routes → Session lifecycle: auth endpoints
- Domain routes → Curation services: review and training operations
- Session lifecycle → Persistence boundary: stores sessions
- Curation services → Persistence boundary: reads and writes state
- Curation services → Immich integration: retrieves and updates photos
- Curation services → Classifier: classifies review work
- Curation services → Rule extraction: feeds human decisions
- Rule extraction → Classifier: updates rules
- Classifier → Prompt builder: builds AI context
- Prompt builder → LLM provider client: sends prompt
- Batch scheduler → Curation services: runs batch processing
- Persistence boundary → Local SQLite state: persists through
- Runtime configuration → Persistence boundary: configures
- Runtime configuration → Immich integration: configures
- Runtime configuration → LLM provider client: configures