# 0llrayll0/pandora-architect architecture

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

- Interactive diagram: https://gitdiagram.com/0llrayll0/pandora-architect
- Repository: https://github.com/0llrayll0/pandora-architect

## Overview

Pandora Architect is a local repository-analysis application. A user registers a repository, starts an analysis, follows its progress, then explores metrics, dependencies, cycles, hotspots, history, and the architecture map; an optional AI report adds architectural recommendations. The backend discovers and analyzes source, resolves imports, computes graph results, and stores run snapshots in SQLite. The map reflects documented capabilities and indexed modules; some frontend-to-endpoint wiring is represented at the documented interface level because its implementation was not excerpted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/App.tsx) (Application UI), [`backend/app/analysis/pipeline.py`](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/pipeline.py) (Analysis pipeline), [`frontend/src/lib/api.ts`](https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/lib/api.ts) (API client), [`backend/app/routers/ai.py`](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/routers/ai.py) (AI routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_web["Application UI<br/>[App.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_run_progress["Run progress<br/>[useRunProgress.ts]"]
  node_project_ui["Projects UI<br/>[ProjectsPage.tsx]"]
  node_analysis_ui["Analysis views<br/>[OverviewPage.tsx]"]
  node_explorer_ui["File explorer<br/>[ExplorerPage.tsx]"]
  node_history_ui["Run history<br/>[HistoryPage.tsx]"]
  node_map_ui["Architecture map"]
  node_architect_ui["AI architect<br/>[ArchitectPage.tsx]"]
  node_settings_ui["AI settings<br/>[SettingsPage.tsx]"]
end

subgraph group_api["API and projects"]
  node_project_routes["Project routes<br/>[projects.py]"]
  node_analysis_routes["Analysis routes<br/>[analysis.py]"]
  node_explorer_routes["Explorer routes<br/>[explorer.py]"]
  node_graph_routes["Graph routes<br/>[graph.py]"]
  node_ai_routes["AI routes<br/>[ai.py]"]
end

subgraph group_analysis["Analysis engine"]
  node_pipeline["Analysis pipeline<br/>[pipeline.py]"]
  node_discovery["File discovery<br/>[discovery.py]"]
  node_python_parser["Python analysis<br/>[python_analyzer.py]"]
  node_resolver["Import resolver<br/>[resolver.py]"]
  node_graph["Dependency graph<br/>[graph.py]"]
  node_metrics["Metrics and cycles<br/>[metrics.py]"]
  node_heuristics["Architecture heuristics<br/>[heuristics.py]"]
end

subgraph group_data["Persistence and safety"]
  node_security["Path safeguards<br/>[security.py]"]
  node_models["Project and run models<br/>[models.py]"]
  node_database[("SQLite database<br/>[db.py]")]
end

node_user(("Developer"))
node_llm["Optional LLM provider"]

node_user -->|"uses"| node_web
node_web -.->|"requests data"| node_api_client
node_api_client -->|"calls project API"| node_project_routes
node_api_client -->|"calls analysis API"| node_analysis_routes
node_api_client -->|"calls explorer API"| node_explorer_routes
node_api_client -->|"calls graph API"| node_graph_routes
node_api_client -->|"calls AI API"| node_ai_routes
node_web -.->|"presents"| node_project_ui
node_web -.->|"presents"| node_analysis_ui
node_web -.->|"presents"| node_explorer_ui
node_web -.->|"presents"| node_history_ui
node_web -.->|"presents"| node_map_ui
node_web -.->|"presents"| node_architect_ui
node_web -.->|"presents"| node_settings_ui
node_project_routes -->|"starts analysis"| node_pipeline
node_analysis_routes -->|"serves run results"| node_pipeline
node_explorer_routes -->|"validates paths"| node_security
node_graph_routes -->|"computes cycles"| node_graph
node_ai_routes -->|"builds findings"| node_heuristics
node_ai_routes -->|"uses graph metrics"| node_metrics
node_ai_routes -->|"uses dependency graph"| node_graph
node_ai_routes -.->|"requests narrative"| node_llm
node_pipeline -->|"configures exclusions"| node_security
node_pipeline -->|"discovers files"| node_discovery
node_pipeline -->|"parses source"| node_python_parser
node_pipeline -->|"resolves imports"| node_resolver
node_pipeline -->|"computes metrics"| node_metrics
node_pipeline -->|"writes run snapshot"| node_database
node_pipeline -->|"creates records"| node_models
node_database -->|"persists"| node_models
node_discovery -->|"checks file access"| node_security
node_metrics -->|"measures"| node_graph
node_heuristics -->|"evaluates"| node_graph

click node_web "https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/lib/api.ts"
click node_run_progress "https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/hooks/useRunProgress.ts"
click node_project_ui "https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/ProjectsPage.tsx"
click node_analysis_ui "https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/OverviewPage.tsx"
click node_explorer_ui "https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/ExplorerPage.tsx"
click node_history_ui "https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/HistoryPage.tsx"
click node_map_ui "https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/ArchitectureMapPage.tsx"
click node_architect_ui "https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/ArchitectPage.tsx"
click node_settings_ui "https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/SettingsPage.tsx"
click node_project_routes "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/routers/projects.py"
click node_analysis_routes "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/routers/analysis.py"
click node_explorer_routes "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/routers/explorer.py"
click node_graph_routes "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/routers/graph.py"
click node_ai_routes "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/routers/ai.py"
click node_pipeline "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/pipeline.py"
click node_discovery "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/discovery.py"
click node_python_parser "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/python_analyzer.py"
click node_resolver "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/resolver.py"
click node_graph "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/graph.py"
click node_metrics "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/metrics.py"
click node_heuristics "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/heuristics.py"
click node_security "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/security.py"
click node_models "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/models.py"
click node_database "https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/db.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_web,node_api_client,node_run_progress,node_project_ui,node_analysis_ui,node_explorer_ui,node_history_ui,node_map_ui,node_architect_ui,node_settings_ui toneBlue
class node_project_routes,node_analysis_routes,node_explorer_routes,node_graph_routes,node_ai_routes toneAmber
class node_pipeline,node_discovery,node_python_parser,node_resolver,node_graph,node_metrics,node_heuristics toneMint
class node_security,node_models,node_database toneRose
class node_user,node_llm toneIndigo
```

## Components

### Web interface

- [Application UI](https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [Run progress](https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/hooks/useRunProgress.ts): `frontend/src/hooks/useRunProgress.ts`
- [Projects UI](https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/ProjectsPage.tsx): `frontend/src/pages/ProjectsPage.tsx`
- [Analysis views](https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/OverviewPage.tsx): `frontend/src/pages/OverviewPage.tsx`
- [File explorer](https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/ExplorerPage.tsx): `frontend/src/pages/ExplorerPage.tsx`
- [Run history](https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/HistoryPage.tsx): `frontend/src/pages/HistoryPage.tsx`
- [Architecture map](https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/ArchitectureMapPage.tsx): `frontend/src/pages/ArchitectureMapPage.tsx`
- [AI architect](https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/ArchitectPage.tsx): `frontend/src/pages/ArchitectPage.tsx`
- [AI settings](https://github.com/0llrayll0/pandora-architect/blob/main/frontend/src/pages/SettingsPage.tsx): `frontend/src/pages/SettingsPage.tsx`

### API and projects

- [Project routes](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/routers/projects.py): `backend/app/routers/projects.py`
- [Analysis routes](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/routers/analysis.py): `backend/app/routers/analysis.py`
- [Explorer routes](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/routers/explorer.py): `backend/app/routers/explorer.py`
- [Graph routes](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/routers/graph.py): `backend/app/routers/graph.py`
- [AI routes](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/routers/ai.py): `backend/app/routers/ai.py`

### Analysis engine

- [Analysis pipeline](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/pipeline.py): `backend/app/analysis/pipeline.py`
- [File discovery](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/discovery.py): `backend/app/analysis/discovery.py`
- [Python analysis](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/python_analyzer.py): `backend/app/analysis/python_analyzer.py`
- [Import resolver](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/resolver.py): `backend/app/analysis/resolver.py`
- [Dependency graph](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/graph.py): `backend/app/analysis/graph.py`
- [Metrics and cycles](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/metrics.py): `backend/app/analysis/metrics.py`
- [Architecture heuristics](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/analysis/heuristics.py): `backend/app/analysis/heuristics.py`

### Persistence and safety

- [Path safeguards](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/security.py): `backend/app/security.py`
- [Project and run models](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/models.py): `backend/app/models.py`
- [SQLite database](https://github.com/0llrayll0/pandora-architect/blob/main/backend/app/db.py): `backend/app/db.py`

### Other components

- **Developer**
- **Optional LLM provider**

## Connections

- Developer → Application UI: uses
- Application UI → API client: requests data
- API client → Project routes: calls project API
- API client → Analysis routes: calls analysis API
- API client → Explorer routes: calls explorer API
- API client → Graph routes: calls graph API
- API client → AI routes: calls AI API
- Application UI → Projects UI: presents
- Application UI → Analysis views: presents
- Application UI → File explorer: presents
- Application UI → Run history: presents
- Application UI → Architecture map: presents
- Application UI → AI architect: presents
- Application UI → AI settings: presents
- Project routes → Analysis pipeline: starts analysis (evidence: `backend/app/analysis/pipeline.py`)
- Analysis routes → Analysis pipeline: serves run results (evidence: `backend/app/routers/analysis.py`)
- Explorer routes → Path safeguards: validates paths (evidence: `backend/app/routers/explorer.py`)
- Graph routes → Dependency graph: computes cycles (evidence: `backend/app/routers/graph.py`)
- AI routes → Architecture heuristics: builds findings (evidence: `backend/app/routers/ai.py`)
- AI routes → Metrics and cycles: uses graph metrics (evidence: `backend/app/routers/ai.py`)
- AI routes → Dependency graph: uses dependency graph (evidence: `backend/app/routers/ai.py`)
- AI routes → Optional LLM provider: requests narrative
- Analysis pipeline → Path safeguards: configures exclusions (evidence: `backend/app/analysis/pipeline.py`)
- Analysis pipeline → File discovery: discovers files (evidence: `backend/app/analysis/pipeline.py`)
- Analysis pipeline → Python analysis: parses source (evidence: `backend/app/analysis/pipeline.py`)
- Analysis pipeline → Import resolver: resolves imports (evidence: `backend/app/analysis/pipeline.py`)
- Analysis pipeline → Metrics and cycles: computes metrics (evidence: `backend/app/analysis/pipeline.py`)
- Analysis pipeline → SQLite database: writes run snapshot (evidence: `backend/app/analysis/pipeline.py`)
- Analysis pipeline → Project and run models: creates records (evidence: `backend/app/analysis/pipeline.py`)
- SQLite database → Project and run models: persists (evidence: `backend/app/db.py`)
- File discovery → Path safeguards: checks file access (evidence: `backend/app/analysis/discovery.py`)
- Metrics and cycles → Dependency graph: measures (evidence: `backend/app/analysis/metrics.py`)
- Architecture heuristics → Dependency graph: evaluates (evidence: `backend/app/analysis/heuristics.py`)
