# tahoorshah/enterprise-quantum-computing-platform architecture

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

- Interactive diagram: https://gitdiagram.com/tahoorshah/enterprise-quantum-computing-platform
- Repository: https://github.com/tahoorshah/enterprise-quantum-computing-platform

## Overview

#### Purpose and Entry Points
QFT Bank is a proof-of-concept enterprise quantum-computing platform using classical simulators. It provides circuit design, quantum algorithms, portfolio optimization, executive reporting, PQC readiness, and multi-framework comparisons over a React/FastAPI stack.

Backend entry point: `backend/app/main.py`. Frontend entry points: `frontend/src/main.jsx`, `frontend/src/App.jsx`. Local deployment starts through `docker-compose.yml`; production containers are defined in `backend/Dockerfile` and `frontend/Dockerfile`.

#### Presentation and API Boundary
The React/Vite SPA renders module-specific views and calls the backend through a shared API client. Production Nginx serves static SPA assets and reverse-proxies `/api` to FastAPI, preserving a single external application entry point.

Paths: `frontend/src/api.js`, `frontend/src/components/CircuitDesigner.jsx`, `frontend/nginx.conf`.

#### FastAPI Module Composition
`backend/app/main.py` composes routers for independently bounded domain modules. Each module exposes request/response schemas, orchestrates its own computation, and returns API-ready results. Shared dashboard metrics consume persisted results rather than initiating quantum work.

Paths: `backend/app/quantum/router.py`, `backend/app/optimization/router.py`, `backend/app/dashboard/router.py`.

#### Quantum Execution and Algorithm Workloads
The quantum domain builds and validates circuits, then runs genuine simulations primarily through Qiskit Aer. Algorithm demonstrations implement Grover, QFT, QAOA, and VQE gate-level workflows. The frameworks module reproduces a Bell-state result across Qiskit, PennyLane, and Cirq, isolating framework-comparison concerns from primary Qiskit execution.

Paths: `backend/app/quantum/circuit_builder.py`, `backend/app/algorithms/grover.py`, `backend/app/frameworks/multi_framework.py`.

#### Portfolio Optimization Pipeline
Portfolio optimization operates on reproducible simulated market data. Its principal flow is market inputs → QUBO construction → Ising conversion → COBYLA-driven QAOA simulation, with an exact brute-force baseline and risk/return metrics. Asset counts are intentionally small enough for exact verification.

Paths: `backend/app/optimization/portfolio.py`, `backend/app/optimization/qaoa_portfolio.py`, `backend/app/optimization/router.py`.

#### Persistence, Dashboard, and Resilience
Circuit, optimization, and algorithm execution histories converge on a unified persistence layer and `executions` model, using a module discriminator plus JSON result payload. Startup selects PostgreSQL when reachable, otherwise an in-memory fallback, reported through health status. Dashboard metrics aggregate this shared history across modules.

Paths: `backend/app/database/connection.py`, `backend/app/database/persistence.py`, `backend/app/database/models.py`.

#### PQC and Analytics Boundaries
PQC readiness is a separate advisory domain: it models crypto inventory/risk, quantum threat references, NIST-aligned migration planning, and reuses QFT only for its conceptual threat demonstration. Analytics and ML packages provide supplementary market/charting and selection capabilities without replacing the core optimization pipeline.

Paths: `backend/app/pqc/router.py`, `backend/app/pqc/inventory.py`, `backend/app/analytics/market_analytics.py`.

#### Runtime, Infrastructure, and Operations
Runtime services are FastAPI/Python, React/Nginx, PostgreSQL, Redis, and quantum simulators. Kubernetes exposes only the frontend externally; backend, database, and Redis remain internal services. Prometheus scrapes backend metrics; Grafana and Loki/Promtail support observability. Jenkins runs test, SAST, dependency, policy, image-build, and container-scan stages; Terraform provides a parallel declarative Kubernetes deployment path.

Paths: `infra/k8s/03-backend.yaml`, `infra/k8s/04-frontend.yaml`, `infra/k8s/05-prometheus.yaml`, `Jenkinsfile`, `infra/terraform/main.tf`.

Main entry points: [`backend/app/main.py`](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/main.py) (FastAPI Application), [`backend/app/quantum/router.py`](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/quantum/router.py) (Quantum API), [`backend/app/database/persistence.py`](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/database/persistence.py) (Execution Persistence), [`backend/app/optimization/router.py`](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/optimization/router.py) (Optimization API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client Delivery"]
  node_spa["React/Vite SPA<br/>frontend<br/>[App.jsx]"]
  node_api_client["Shared API Client<br/>frontend-api<br/>[api.js]"]
  node_circuit_view["Circuit Designer<br/>frontend-view"]
  node_nginx{{"Nginx Gateway<br/>reverse-proxy<br/>[nginx.conf]"}}
end

subgraph group_backend["FastAPI Domains"]
  node_fastapi["FastAPI Application<br/>api-runtime<br/>[main.py]"]
  node_quantum_api["Quantum API<br/>domain-router<br/>[router.py]"]
  node_optimization_api["Optimization API<br/>domain-router<br/>[router.py]"]
  node_dashboard_api["Dashboard API<br/>domain-router<br/>[router.py]"]
  node_pqc_api["PQC Readiness API<br/>advisory-router<br/>[router.py]"]
end

subgraph group_data["Data &amp; Execution"]
  node_circuit_builder["Circuit Builder<br/>quantum-workflow<br/>[circuit_builder.py]"]
  node_algorithm_workloads["Algorithm Workloads<br/>quantum-algorithms<br/>[grover.py]"]
  node_framework_comparison["Framework Comparison<br/>quantum-comparison<br/>[multi_framework.py]"]
  node_portfolio_pipeline["Portfolio Pipeline<br/>optimization-workflow<br/>[portfolio.py]"]
  node_qaoa_solver["COBYLA QAOA Solver<br/>quantum-optimizer<br/>[qaoa_portfolio.py]"]
  node_analytics["Analytics &amp; ML<br/>supplementary-analytics"]
  node_execution_store[("Execution Persistence<br/>persistence-layer<br/>[persistence.py]")]
  node_execution_model["Executions Model<br/>data-model<br/>[models.py]"]
  node_database_connection["Database Connection<br/>resilience-layer<br/>[connection.py]"]
end

subgraph group_platform["Platform &amp; Operations"]
  node_kubernetes{{"Kubernetes Deployment<br/>orchestration<br/>[04-frontend.yaml]"}}
  node_observability["Prometheus Monitoring<br/>observability<br/>[05-prometheus.yaml]"]
  node_ci_cd["Jenkins Pipeline<br/>ci-cd"]
  node_terraform["Terraform Deployment<br/>infrastructure-as-code<br/>[main.tf]"]
end

node_spa -->|"uses"| node_api_client
node_circuit_view -->|"calls through"| node_api_client
node_api_client -->|"API requests"| node_nginx
node_nginx -->|"/api proxy"| node_fastapi
node_fastapi -->|"mounts"| node_quantum_api
node_fastapi -->|"mounts"| node_optimization_api
node_fastapi -->|"mounts"| node_dashboard_api
node_fastapi -->|"mounts"| node_pqc_api
node_quantum_api -->|"builds circuits"| node_circuit_builder
node_quantum_api -->|"runs"| node_algorithm_workloads
node_quantum_api -->|"compares"| node_framework_comparison
node_optimization_api -->|"orchestrates"| node_portfolio_pipeline
node_portfolio_pipeline -->|"optimizes via"| node_qaoa_solver
node_portfolio_pipeline -->|"uses support data"| node_analytics
node_quantum_api -->|"records executions"| node_execution_store
node_optimization_api -->|"records executions"| node_execution_store
node_execution_store -->|"stores"| node_execution_model
node_execution_store -->|"persists through"| node_database_connection
node_dashboard_api -->|"aggregates history"| node_execution_store
node_kubernetes -->|"exposes frontend"| node_nginx
node_observability -.->|"scrapes metrics"| node_fastapi
node_ci_cd -.->|"deploys images"| node_kubernetes
node_terraform -.->|"provisions"| node_kubernetes

click node_spa "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/frontend/src/App.jsx"
click node_api_client "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/frontend/src/api.js"
click node_circuit_view "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/frontend/src/components/CircuitDesigner.jsx"
click node_nginx "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/frontend/nginx.conf"
click node_fastapi "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/main.py"
click node_quantum_api "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/quantum/router.py"
click node_optimization_api "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/optimization/router.py"
click node_dashboard_api "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/dashboard/router.py"
click node_pqc_api "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/pqc/router.py"
click node_circuit_builder "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/quantum/circuit_builder.py"
click node_algorithm_workloads "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/algorithms/grover.py"
click node_framework_comparison "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/frameworks/multi_framework.py"
click node_portfolio_pipeline "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/optimization/portfolio.py"
click node_qaoa_solver "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/optimization/qaoa_portfolio.py"
click node_analytics "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/analytics/market_analytics.py"
click node_execution_store "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/database/persistence.py"
click node_execution_model "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/database/models.py"
click node_database_connection "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/database/connection.py"
click node_kubernetes "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/infra/k8s/04-frontend.yaml"
click node_observability "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/infra/k8s/05-prometheus.yaml"
click node_ci_cd "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/Jenkinsfile"
click node_terraform "https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/infra/terraform/main.tf"

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_spa,node_api_client,node_circuit_view,node_nginx toneBlue
class node_fastapi,node_quantum_api,node_optimization_api,node_dashboard_api,node_pqc_api toneAmber
class node_circuit_builder,node_algorithm_workloads,node_framework_comparison,node_portfolio_pipeline,node_qaoa_solver,node_analytics,node_execution_store,node_execution_model,node_database_connection toneMint
class node_kubernetes,node_observability,node_ci_cd,node_terraform toneRose
```

## Components

### Client Delivery

- [React/Vite SPA](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/frontend/src/App.jsx): frontend · Module views use a shared API client. · `frontend/src/App.jsx`
- [Shared API Client](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/frontend/src/api.js): frontend-api · `frontend/src/api.js`
- [Circuit Designer](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/frontend/src/components/CircuitDesigner.jsx): frontend-view · `frontend/src/components/CircuitDesigner.jsx`
- [Nginx Gateway](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/frontend/nginx.conf): reverse-proxy · Serves the SPA and proxies /api. · `frontend/nginx.conf`

### FastAPI Domains

- [FastAPI Application](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/main.py): api-runtime · Composes independently bounded domain routers. · `backend/app/main.py`
- [Quantum API](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/quantum/router.py): domain-router · `backend/app/quantum/router.py`
- [Optimization API](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/optimization/router.py): domain-router · `backend/app/optimization/router.py`
- [Dashboard API](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/dashboard/router.py): domain-router · Reads persisted execution history for metrics. · `backend/app/dashboard/router.py`
- [PQC Readiness API](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/pqc/router.py): advisory-router · `backend/app/pqc/router.py`

### Data & Execution

- [Circuit Builder](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/quantum/circuit_builder.py): quantum-workflow · Builds and validates circuits before simulation. · `backend/app/quantum/circuit_builder.py`
- [Algorithm Workloads](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/algorithms/grover.py): quantum-algorithms · Gate-level Grover, QFT, QAOA, and VQE demonstrations. · `backend/app/algorithms/grover.py`
- [Framework Comparison](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/frameworks/multi_framework.py): quantum-comparison · Reproduces Bell-state results in Qiskit, PennyLane, and Cirq. · `backend/app/frameworks/multi_framework.py`
- [Portfolio Pipeline](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/optimization/portfolio.py): optimization-workflow · Market inputs to QUBO, Ising, QAOA, exact baseline, and metrics. · `backend/app/optimization/portfolio.py`
- [COBYLA QAOA Solver](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/optimization/qaoa_portfolio.py): quantum-optimizer · `backend/app/optimization/qaoa_portfolio.py`
- [Analytics & ML](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/analytics/market_analytics.py): supplementary-analytics · Provides market, charting, and selection support. · `backend/app/analytics/market_analytics.py`
- [Execution Persistence](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/database/persistence.py): persistence-layer · Unified module-tagged JSON execution results. · `backend/app/database/persistence.py`
- [Executions Model](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/database/models.py): data-model · `backend/app/database/models.py`
- [Database Connection](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/backend/app/database/connection.py): resilience-layer · Uses PostgreSQL when reachable, otherwise in-memory fallback. · `backend/app/database/connection.py`

### Platform & Operations

- [Kubernetes Deployment](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/infra/k8s/04-frontend.yaml): orchestration · Only the frontend is externally exposed. · `infra/k8s/04-frontend.yaml`
- [Prometheus Monitoring](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/infra/k8s/05-prometheus.yaml): observability · Scrapes backend metrics. · `infra/k8s/05-prometheus.yaml`
- [Jenkins Pipeline](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/Jenkinsfile): ci-cd · Tests, scans, policies, and builds container images. · `Jenkinsfile`
- [Terraform Deployment](https://github.com/tahoorshah/enterprise-quantum-computing-platform/blob/main/infra/terraform/main.tf): infrastructure-as-code · Parallel declarative Kubernetes deployment path. · `infra/terraform/main.tf`

## Connections

- React/Vite SPA → Shared API Client: uses
- Circuit Designer → Shared API Client: calls through
- Shared API Client → Nginx Gateway: API requests
- Nginx Gateway → FastAPI Application: /api proxy
- FastAPI Application → Quantum API: mounts
- FastAPI Application → Optimization API: mounts
- FastAPI Application → Dashboard API: mounts
- FastAPI Application → PQC Readiness API: mounts
- Quantum API → Circuit Builder: builds circuits
- Quantum API → Algorithm Workloads: runs
- Quantum API → Framework Comparison: compares
- Optimization API → Portfolio Pipeline: orchestrates
- Portfolio Pipeline → COBYLA QAOA Solver: optimizes via
- Portfolio Pipeline → Analytics & ML: uses support data
- Quantum API → Execution Persistence: records executions
- Optimization API → Execution Persistence: records executions
- Execution Persistence → Executions Model: stores
- Execution Persistence → Database Connection: persists through
- Dashboard API → Execution Persistence: aggregates history
- Kubernetes Deployment → Nginx Gateway: exposes frontend
- Prometheus Monitoring → FastAPI Application: scrapes metrics
- Jenkins Pipeline → Kubernetes Deployment: deploys images
- Terraform Deployment → Kubernetes Deployment: provisions
