The application is built around the following core components:
- FastAPI for HTTP routing and request handling
- PostgreSQL for persistent storage
- Pydantic for request/response validation
- Uvicorn as the ASGI server
- Python dotenv for environment configuration
The main application is initialized in app/main.py. It creates the FastAPI app, configures CORS, mounts static files, and includes the API router.
The main router is assembled in app/api/routes.py. It includes multiple route modules for:
- root metadata
- health checks
- prompt endpoints
- prospects
- orders
- queue routes
- notifications
- GitHub, Flickr, and YouTube integrations
A typical request follows this pattern:
- The FastAPI app receives an HTTP request
- A route handler validates or parses input
- The handler connects to PostgreSQL through the database utilities
- Queries or updates are executed
- A standardized response payload is returned using the shared metadata helper
Defines the application object and global middleware.
Contains the route modules and feature-specific endpoints.
Contains shared support code for:
- database connections
- API-key authentication
- response metadata
- health checks
The architecture favors a simple, service-oriented approach:
- route modules are feature focused
- database access is centralized
- shared metadata responses keep output consistent
- integrations are isolated into dedicated modules