# saleor/saleor-platform architecture

> Architecture diagram of the GitHub repository saleor/saleor-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saleor/saleor-platform
- Repository: https://github.com/saleor/saleor-platform

## Overview

##### Project type and purpose
- This is a **local development orchestration repository** (“Saleor Platform”) that uses Docker Compose to spin up all major Saleor services (Core GraphQL API, Dashboard, Worker), plus support services (PostgreSQL, Redis, Mailpit, Jaeger).
- It is **not** a deploy-to-production setup; it’s solely for running a multi-container environment on your developer machine.

##### File structure
- Top-level files:
- docker-compose.yml – defines all services and networks
- backend.env, common.env – environment configs for containers
- setup-e2e-db.sh, replica_user.sql – helper scripts for database initialization
- .github/workflows/test-platform.yml – CI checks on the platform compose setup
- No application code here; the compose file pulls or mounts the Saleor Core (Django) and Dashboard (React) source trees for live reload.

##### README for additional insights
- Lists all services, ports, and startup steps.
- Emphasizes live reloading via shared volumes, required Docker memory and folder sharing.
- Shows service endpoints:
- Core API @ localhost:8000
- Dashboard @ localhost:9000
- Jaeger APM @ localhost:16686
- Mailpit (email testing) @ localhost:8025

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer Machine Host
    subgraph "Developer Machine / Docker Host"
        direction TB

        %% Docker Network
        subgraph "Docker Network (bridge)"
            direction TB
            API["saleor-api (Django GraphQL service)"]:::backend
            Worker["saleor-worker (Celery background tasks)"]:::backend
            Dashboard["saleor-dashboard (React Web UI)"]:::frontend
            Postgres[(PostgreSQL database)]:::datastore
            Redis[(Redis cache & broker)]:::datastore
            Mailpit["Mailpit (SMTP sink for email testing)"]:::tools
            Jaeger["Jaeger (Tracing Observability)"]:::tools
        end

        %% Configuration and Scripts
        CommonEnv["common.env"]:::config
        BackendEnv["backend.env"]:::config
        SetupDB["setup-e2e-db.sh"]:::config
        ReplicaSQL["replica_user.sql"]:::config

        %% CI and Documentation
        CI[".github/workflows/test-platform.yml"]:::tools
        README["README.md"]:::tools
    end

    %% Data Flows
    Dashboard -->|"HTTP  →"| API
    API -->|"SQL Queries →"| Postgres
    API -->|"Cache R/W →"| Redis
    API -->|"Broker →"| Redis
    Worker -->|"Broker →"| Redis
    Worker -->|"Jobs →"| Postgres
    API -->|"SMTP →"| Mailpit
    Worker -->|"SMTP →"| Mailpit
    API -->|"Traces →"| Jaeger
    Worker -->|"Traces →"| Jaeger

    %% Click Events
    click API "https://github.com/saleor/saleor-platform/blob/main/docker-compose.yml"
    click Worker "https://github.com/saleor/saleor-platform/blob/main/docker-compose.yml"
    click Dashboard "https://github.com/saleor/saleor-platform/blob/main/docker-compose.yml"
    click Postgres "https://github.com/saleor/saleor-platform/blob/main/docker-compose.yml"
    click Redis "https://github.com/saleor/saleor-platform/blob/main/docker-compose.yml"
    click Mailpit "https://github.com/saleor/saleor-platform/blob/main/docker-compose.yml"
    click Jaeger "https://github.com/saleor/saleor-platform/blob/main/docker-compose.yml"
    click CommonEnv "https://github.com/saleor/saleor-platform/blob/main/common.env"
    click BackendEnv "https://github.com/saleor/saleor-platform/blob/main/backend.env"
    click SetupDB "https://github.com/saleor/saleor-platform/blob/main/setup-e2e-db.sh"
    click ReplicaSQL "https://github.com/saleor/saleor-platform/blob/main/replica_user.sql"
    click CI "https://github.com/saleor/saleor-platform/blob/main/.github/workflows/test-platform.yml"
    click README "https://github.com/saleor/saleor-platform/blob/main/README.md"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#003366,color:#003366;
    classDef backend fill:#DFF2D8,stroke:#336600,color:#336600;
    classDef datastore fill:#FFE4B5,stroke:#CC7A00,color:#CC7A00;
    classDef tools fill:#E0E0E0,stroke:#666666,color:#333333;
    classDef config fill:#F3E5F5,stroke:#7B1FA2,color:#4A148C;
```
