# john-helder/pandora-backend architecture

> Architecture diagram of the GitHub repository john-helder/pandora-backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/john-helder/pandora-backend
- Repository: https://github.com/john-helder/pandora-backend

## Overview

Pandora is a FastAPI backend for temporary, session-scoped spreadsheet analysis. A client creates a session and uploads CSV/XLSX files; the backend parses and stages datasets, then exposes profiling, normalization, matching, joining, and transformation workflows. Pipeline execution applies bounded operations and returns results without persisting them as derived datasets. The graph reflects documented capabilities and indexed module references; some route/service internals were not excerpted, so uncertain call relationships are omitted.

Main entry points: [`app/application/services/session_service.py`](https://github.com/john-helder/pandora-backend/blob/main/app/application/services/session_service.py) (Session service), [`app/main.py`](https://github.com/john-helder/pandora-backend/blob/main/app/main.py) (FastAPI app), [`app/api/routes/sessions.py`](https://github.com/john-helder/pandora-backend/blob/main/app/api/routes/sessions.py) (Session routes), [`app/api/routes/matching.py`](https://github.com/john-helder/pandora-backend/blob/main/app/api/routes/matching.py) (Matching routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_api_entry["FastAPI app<br/>[main.py]"]
  node_session_routes["Session routes<br/>[sessions.py]"]
  node_join_routes["Join routes<br/>[joining.py]"]
  node_match_routes["Matching routes<br/>[matching.py]"]
  node_transform_routes["Transform routes<br/>[transformations.py]"]
  node_pipeline_routes["Pipeline route<br/>[pipelines.py]"]
end

subgraph group_app["Application workflows"]
  node_session_service["Session service<br/>[session_service.py]"]
  node_profile_service["Profiling service"]
  node_normalize_service["Normalization service"]
  node_match_service["Matching service"]
  node_join_service["Joining service"]
  node_transform_service["Transformation service"]
  node_pipeline_service["Pipeline service"]
end

subgraph group_domain["Domain model"]
  node_dataset["Dataset entity<br/>[dataset.py]"]
  node_session["Session entity<br/>[session.py]"]
end

subgraph group_infra["Infrastructure"]
  node_reader_factory["Reader factory<br/>[factory.py]"]
  node_csv_reader["CSV reader<br/>[csv_reader.py]"]
  node_xlsx_reader["XLSX reader<br/>[xlsx_reader.py]"]
  node_storage[("Temporary storage")]
end

node_client(("API client"))

node_client -->|"sends requests"| node_api_entry
node_api_entry -->|"registers routes"| node_session_routes
node_api_entry -->|"configures storage"| node_storage
node_api_entry -->|"configures service"| node_session_service
node_session_routes -->|"handles sessions"| node_session_service
node_join_routes -->|"gets datasets"| node_session_service
node_join_routes -->|"requests joins"| node_join_service
node_match_routes -->|"gets datasets"| node_session_service
node_match_routes -->|"requests matches"| node_match_service
node_match_routes -->|"normalizes columns"| node_normalize_service
node_session_routes -->|"profiles datasets"| node_profile_service
node_session_routes -->|"normalizes columns"| node_normalize_service
node_transform_routes -->|"gets datasets"| node_session_service
node_transform_routes -->|"transforms data"| node_transform_service
node_pipeline_routes -->|"gets datasets"| node_session_service
node_pipeline_routes -->|"executes pipeline"| node_pipeline_service
node_pipeline_service -->|"applies operations"| node_transform_service
node_session_service -->|"creates reader"| node_reader_factory
node_session_service -->|"stages and stores"| node_storage
node_reader_factory -->|"selects reader"| node_csv_reader
node_reader_factory -->|"selects reader"| node_xlsx_reader

click node_api_entry "https://github.com/john-helder/pandora-backend/blob/main/app/main.py"
click node_session_routes "https://github.com/john-helder/pandora-backend/blob/main/app/api/routes/sessions.py"
click node_join_routes "https://github.com/john-helder/pandora-backend/blob/main/app/api/routes/joining.py"
click node_match_routes "https://github.com/john-helder/pandora-backend/blob/main/app/api/routes/matching.py"
click node_transform_routes "https://github.com/john-helder/pandora-backend/blob/main/app/api/routes/transformations.py"
click node_pipeline_routes "https://github.com/john-helder/pandora-backend/blob/main/app/api/routes/pipelines.py"
click node_session_service "https://github.com/john-helder/pandora-backend/blob/main/app/application/services/session_service.py"
click node_profile_service "https://github.com/john-helder/pandora-backend/blob/main/app/application/services/data_profiling_service.py"
click node_normalize_service "https://github.com/john-helder/pandora-backend/blob/main/app/application/services/data_normalization_service.py"
click node_match_service "https://github.com/john-helder/pandora-backend/blob/main/app/application/services/data_matching_service.py"
click node_join_service "https://github.com/john-helder/pandora-backend/blob/main/app/application/services/data_joining_service.py"
click node_transform_service "https://github.com/john-helder/pandora-backend/blob/main/app/application/services/data_transformation_service.py"
click node_pipeline_service "https://github.com/john-helder/pandora-backend/blob/main/app/application/services/pipeline_service.py"
click node_dataset "https://github.com/john-helder/pandora-backend/blob/main/app/domain/entities/dataset.py"
click node_session "https://github.com/john-helder/pandora-backend/blob/main/app/domain/entities/session.py"
click node_reader_factory "https://github.com/john-helder/pandora-backend/blob/main/app/infrastructure/readers/factory.py"
click node_csv_reader "https://github.com/john-helder/pandora-backend/blob/main/app/infrastructure/readers/csv_reader.py"
click node_xlsx_reader "https://github.com/john-helder/pandora-backend/blob/main/app/infrastructure/readers/xlsx_reader.py"
click node_storage "https://github.com/john-helder/pandora-backend/blob/main/app/infrastructure/storage/local_temporary_storage.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_api_entry,node_session_routes,node_join_routes,node_match_routes,node_transform_routes,node_pipeline_routes,node_client toneBlue
class node_session_service,node_profile_service,node_normalize_service,node_match_service,node_join_service,node_transform_service,node_pipeline_service toneAmber
class node_dataset,node_session toneMint
class node_reader_factory,node_csv_reader,node_xlsx_reader,node_storage toneRose
```

## Components

### HTTP API

- [FastAPI app](https://github.com/john-helder/pandora-backend/blob/main/app/main.py): `app/main.py`
- [Session routes](https://github.com/john-helder/pandora-backend/blob/main/app/api/routes/sessions.py): `app/api/routes/sessions.py`
- [Join routes](https://github.com/john-helder/pandora-backend/blob/main/app/api/routes/joining.py): `app/api/routes/joining.py`
- [Matching routes](https://github.com/john-helder/pandora-backend/blob/main/app/api/routes/matching.py): `app/api/routes/matching.py`
- [Transform routes](https://github.com/john-helder/pandora-backend/blob/main/app/api/routes/transformations.py): `app/api/routes/transformations.py`
- [Pipeline route](https://github.com/john-helder/pandora-backend/blob/main/app/api/routes/pipelines.py): `app/api/routes/pipelines.py`

### Application workflows

- [Session service](https://github.com/john-helder/pandora-backend/blob/main/app/application/services/session_service.py): `app/application/services/session_service.py`
- [Profiling service](https://github.com/john-helder/pandora-backend/blob/main/app/application/services/data_profiling_service.py): `app/application/services/data_profiling_service.py`
- [Normalization service](https://github.com/john-helder/pandora-backend/blob/main/app/application/services/data_normalization_service.py): `app/application/services/data_normalization_service.py`
- [Matching service](https://github.com/john-helder/pandora-backend/blob/main/app/application/services/data_matching_service.py): `app/application/services/data_matching_service.py`
- [Joining service](https://github.com/john-helder/pandora-backend/blob/main/app/application/services/data_joining_service.py): `app/application/services/data_joining_service.py`
- [Transformation service](https://github.com/john-helder/pandora-backend/blob/main/app/application/services/data_transformation_service.py): `app/application/services/data_transformation_service.py`
- [Pipeline service](https://github.com/john-helder/pandora-backend/blob/main/app/application/services/pipeline_service.py): `app/application/services/pipeline_service.py`

### Domain model

- [Dataset entity](https://github.com/john-helder/pandora-backend/blob/main/app/domain/entities/dataset.py): `app/domain/entities/dataset.py`
- [Session entity](https://github.com/john-helder/pandora-backend/blob/main/app/domain/entities/session.py): `app/domain/entities/session.py`

### Infrastructure

- [Reader factory](https://github.com/john-helder/pandora-backend/blob/main/app/infrastructure/readers/factory.py): `app/infrastructure/readers/factory.py`
- [CSV reader](https://github.com/john-helder/pandora-backend/blob/main/app/infrastructure/readers/csv_reader.py): `app/infrastructure/readers/csv_reader.py`
- [XLSX reader](https://github.com/john-helder/pandora-backend/blob/main/app/infrastructure/readers/xlsx_reader.py): `app/infrastructure/readers/xlsx_reader.py`
- [Temporary storage](https://github.com/john-helder/pandora-backend/blob/main/app/infrastructure/storage/local_temporary_storage.py): `app/infrastructure/storage/local_temporary_storage.py`

### Other components

- **API client**

## Connections

- API client → FastAPI app: sends requests (evidence: `README.md`)
- FastAPI app → Session routes: registers routes (evidence: `app/main.py`)
- FastAPI app → Temporary storage: configures storage (evidence: `app/main.py`)
- FastAPI app → Session service: configures service (evidence: `app/main.py`)
- Session routes → Session service: handles sessions (evidence: `app/api/routes/sessions.py`)
- Join routes → Session service: gets datasets (evidence: `app/api/routes/joining.py`)
- Join routes → Joining service: requests joins (evidence: `app/api/routes/joining.py`)
- Matching routes → Session service: gets datasets (evidence: `app/api/routes/matching.py`)
- Matching routes → Matching service: requests matches (evidence: `app/api/routes/matching.py`)
- Matching routes → Normalization service: normalizes columns (evidence: `app/api/routes/matching.py`)
- Session routes → Profiling service: profiles datasets (evidence: `app/api/routes/sessions.py`)
- Session routes → Normalization service: normalizes columns (evidence: `app/api/routes/sessions.py`)
- Transform routes → Session service: gets datasets (evidence: `app/api/routes/transformations.py`)
- Transform routes → Transformation service: transforms data (evidence: `app/api/routes/transformations.py`)
- Pipeline route → Session service: gets datasets (evidence: `app/api/routes/pipelines.py`)
- Pipeline route → Pipeline service: executes pipeline (evidence: `app/api/routes/pipelines.py`)
- Pipeline service → Transformation service: applies operations (evidence: `app/application/services/pipeline_service.py`)
- Session service → Reader factory: creates reader (evidence: `app/application/services/session_service.py`)
- Session service → Temporary storage: stages and stores (evidence: `app/application/services/session_service.py`)
- Reader factory → CSV reader: selects reader (evidence: `app/infrastructure/readers/factory.py`)
- Reader factory → XLSX reader: selects reader (evidence: `app/infrastructure/readers/factory.py`)
