# pakvakunchik/parser-for-marketplaces architecture

> Architecture diagram of the GitHub repository pakvakunchik/parser-for-marketplaces, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pakvakunchik/parser-for-marketplaces
- Repository: https://github.com/pakvakunchik/parser-for-marketplaces

## Overview

This is a FastAPI product-catalog API. Its main workflow accepts a barcode, looks up supplier data, creates or updates a product, and returns product details; a separate endpoint selects a product, cleans its raw data, generates AI text, and saves the result. The graph includes the API/UI entry points, domain services, integrations, and persistence. The README is empty, and several integrations were not excerpted, so their external-service links are shown as unverified or omitted.

Main entry points: [`src/routers/routers.py`](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/routers/routers.py) (Product routes), [`src/services/product_service.py`](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/services/product_service.py) (Product service), [`src/repositories/product_repository.py`](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/repositories/product_repository.py) (Product repository), [`src/integrations/github_ai.py`](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/integrations/github_ai.py) (AI generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and UI"]
  node_app["FastAPI app<br/>[main.py]"]
  node_routes["Product routes<br/>[routers.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
end

subgraph group_domain["Product workflows"]
  node_product_service["Product service<br/>[product_service.py]"]
  node_supplier_check["Supplier lookup"]
  node_cleaner["Raw data cleaner"]
  node_photo["Photo service<br/>[photo_service.py]"]
  node_constants["Product constants<br/>[constants.py]"]
  node_exceptions["Product errors"]
end

subgraph group_integrations["External integrations"]
  node_supplier_api["Supplier API client<br/>[supplier_api.py]"]
  node_ai_generator["AI generator<br/>[github_ai.py]"]
  node_prompts["AI prompts<br/>[prompts.py]"]
  node_config["Runtime settings<br/>[config.py]"]
end

subgraph group_persistence["Persistence"]
  node_repository["Product repository"]
  node_product_model["Product model<br/>[models.py]"]
  node_db_session["Database sessions<br/>[session.py]"]
  node_database[("Database")]
end

node_user(("API user"))
node_supplier{{"Supplier service"}}
node_ai_service{{"AI service"}}

node_user -->|"sends requests"| node_app
node_app -->|"mounts routes"| node_routes
node_routes -->|"handles barcode"| node_product_service
node_routes -->|"selects product"| node_repository
node_routes -->|"cleans raw data"| node_cleaner
node_routes -->|"generates text"| node_ai_generator
node_routes -->|"gets session"| node_db_session
node_routes -->|"validates responses"| node_schemas
node_routes -->|"uses keywords"| node_constants
node_routes -->|"handles errors"| node_exceptions
node_product_service -->|"looks up barcode"| node_supplier_check
node_supplier_check -->|"fetches item"| node_supplier_api
node_product_service -->|"reads and writes"| node_repository
node_product_service -->|"gets photo"| node_photo
node_repository -->|"queries products"| node_product_model
node_db_session -->|"configures engine"| node_config
node_db_session -->|"opens sessions"| node_database
node_repository -->|"executes queries"| node_database
node_product_model -.->|"persists product data"| node_database
node_supplier_api -.->|"requests item data"| node_supplier
node_ai_generator -.->|"requests generation"| node_ai_service
node_ai_generator -->|"uses prompts"| node_prompts

click node_app "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/main.py"
click node_routes "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/routers/routers.py"
click node_product_service "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/services/product_service.py"
click node_supplier_check "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/services/supplier_services.py"
click node_cleaner "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/services/rawdata_cleaner_service.py"
click node_photo "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/services/photo_service.py"
click node_repository "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/repositories/product_repository.py"
click node_product_model "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/database/models.py"
click node_db_session "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/database/session.py"
click node_supplier_api "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/integrations/supplier_api.py"
click node_ai_generator "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/integrations/github_ai.py"
click node_prompts "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/integrations/ai/prompts.py"
click node_config "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/core/config.py"
click node_schemas "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/schemas/schemas.py"
click node_constants "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/core/constants.py"
click node_exceptions "https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/exceptions/product_exceptions.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_routes,node_schemas,node_user toneBlue
class node_product_service,node_supplier_check,node_cleaner,node_photo,node_constants,node_exceptions toneAmber
class node_supplier_api,node_ai_generator,node_prompts,node_config toneMint
class node_repository,node_product_model,node_db_session,node_database toneRose
class node_supplier,node_ai_service toneIndigo
```

## Components

### API and UI

- [FastAPI app](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/main.py): `src/main.py`
- [Product routes](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/routers/routers.py): `src/routers/routers.py`
- [API schemas](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/schemas/schemas.py): `src/schemas/schemas.py`

### Product workflows

- [Product service](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/services/product_service.py): `src/services/product_service.py`
- [Supplier lookup](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/services/supplier_services.py): `src/services/supplier_services.py`
- [Raw data cleaner](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/services/rawdata_cleaner_service.py): `src/services/rawdata_cleaner_service.py`
- [Photo service](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/services/photo_service.py): `src/services/photo_service.py`
- [Product constants](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/core/constants.py): `src/core/constants.py`
- [Product errors](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/exceptions/product_exceptions.py): `src/exceptions/product_exceptions.py`

### External integrations

- [Supplier API client](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/integrations/supplier_api.py): `src/integrations/supplier_api.py`
- [AI generator](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/integrations/github_ai.py): `src/integrations/github_ai.py`
- [AI prompts](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/integrations/ai/prompts.py): `src/integrations/ai/prompts.py`
- [Runtime settings](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/core/config.py): `src/core/config.py`

### Persistence

- [Product repository](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/repositories/product_repository.py): `src/repositories/product_repository.py`
- [Product model](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/database/models.py): `src/database/models.py`
- [Database sessions](https://github.com/pakvakunchik/parser-for-marketplaces/blob/main/src/database/session.py): `src/database/session.py`
- **Database**

### Other components

- **API user**
- **Supplier service**
- **AI service**

## Connections

- API user → FastAPI app: sends requests (evidence: `src/main.py`)
- FastAPI app → Product routes: mounts routes (evidence: `src/main.py`)
- Product routes → Product service: handles barcode (evidence: `src/routers/routers.py`)
- Product routes → Product repository: selects product (evidence: `src/routers/routers.py`)
- Product routes → Raw data cleaner: cleans raw data (evidence: `src/routers/routers.py`)
- Product routes → AI generator: generates text (evidence: `src/routers/routers.py`)
- Product routes → Database sessions: gets session (evidence: `src/routers/routers.py`)
- Product routes → API schemas: validates responses (evidence: `src/routers/routers.py`)
- Product routes → Product constants: uses keywords (evidence: `src/routers/routers.py`)
- Product routes → Product errors: handles errors (evidence: `src/routers/routers.py`)
- Product service → Supplier lookup: looks up barcode (evidence: `src/services/product_service.py`)
- Supplier lookup → Supplier API client: fetches item (evidence: `src/services/supplier_services.py`)
- Product service → Product repository: reads and writes (evidence: `src/services/product_service.py`)
- Product service → Photo service: gets photo (evidence: `src/services/product_service.py`)
- Product repository → Product model: queries products (evidence: `src/repositories/product_repository.py`)
- Database sessions → Runtime settings: configures engine (evidence: `src/database/session.py`)
- Database sessions → Database: opens sessions (evidence: `src/database/session.py`)
- Product repository → Database: executes queries (evidence: `src/repositories/product_repository.py`)
- Product model → Database: persists product data
- Supplier API client → Supplier service: requests item data
- AI generator → AI service: requests generation
- AI generator → AI prompts: uses prompts (evidence: `src/integrations/github_ai.py`)
