mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-20 13:48:16 +02:00
Add project documentation and initial analysis reports
This commit is contained in:
1 parent
907510bb70
commit
a025ac44df
13 files changed
+643
-9
No files matched your search
@@ -0,0 +1,40 @@
|
||||
# Backend Architecture
|
||||
|
||||
## Overview
|
||||
|
||||
The PriceFlow backend is a high-performance API and worker service built with Python and FastAPI. It handles product management, scraping logic, database operations, and notifications.
|
||||
|
||||
## Technology Stack
|
||||
|
||||
- **Framework**: FastAPI (Python 3.12)
|
||||
- **Server**: Uvicorn (ASGI)
|
||||
- **Database**: PostgreSQL (via SQLAlchemy ORM)
|
||||
- **Migrations**: Alembic
|
||||
|
||||
## Core Components
|
||||
|
||||
### 1. API Layer (`app/routers`)
|
||||
|
||||
Exposes REST endpoints for the frontend to consume. Handles request validation via Pydantic schemas.
|
||||
|
||||
### 2. Service Layer (`app/services`)
|
||||
|
||||
Contains the business logic, including:
|
||||
|
||||
- **Scraping**: Logic to control Playwright/Browserless.
|
||||
- **AI Analysis**: Integration with LiteLLM for image processing.
|
||||
- **Notifications**: Apprise integration.
|
||||
|
||||
### 3. Data Layer (`app/models.py`)
|
||||
|
||||
Defines the database schema using SQLAlchemy.
|
||||
|
||||
- **Models**: Products, Prices, Users (if applicable).
|
||||
|
||||
### 4. Background Workers
|
||||
|
||||
Uses `APScheduler` or similar mechanisms (implied from deps) to run periodic scraping tasks.
|
||||
|
||||
## Scraping Architecture
|
||||
|
||||
The backend delegates browser rendering to a separate `Browserless` service (Docker container) via WebSocket, ensuring the main API remains responsive.
|
||||
Reference in new issue
Block a user