# vedantkulkarni12007-cyber/ketrix architecture

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

- Interactive diagram: https://gitdiagram.com/vedantkulkarni12007-cyber/ketrix
- Repository: https://github.com/vedantkulkarni12007-cyber/ketrix

## Overview

Ketrix is an interactive quantum-computing education platform. Learners study a staged curriculum, explore standalone quantum concepts, build circuits in a lab or challenge workbench, submit circuits for local simulation, and inspect measurements or state visualizations. The backend validates circuit payloads, constructs Qiskit circuits, and returns simulation results. The graph preserves curriculum, simulator, lab, and challenge capabilities documented in the README; unsampled routing and lesson wiring is not asserted beyond documented behavior.

Main entry points: [`frontend/src/features/challenges/components/ChallengeWorkbench.jsx`](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/challenges/components/ChallengeWorkbench.jsx) (Challenge workbench), [`frontend/src/features/lessons`](https://github.com/vedantkulkarni12007-cyber/ketrix/tree/master/frontend/src/features/lessons) (Interactive curriculum), [`backend/app/api/quantum_routes.py`](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/backend/app/api/quantum_routes.py) (FastAPI simulation endpoint), [`backend/app/quantum/service.py`](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/backend/app/quantum/service.py) (Quantum circuit service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning &amp; exploration"]
  node_curriculum["Interactive curriculum"]
  node_lesson_framework["Lesson framework"]
  node_simulator_explorers["Quantum explorers"]
  node_visualizations["State visualizations"]
end

subgraph group_circuit["Circuit building"]
  node_lab_page["Circuit lab<br/>[Lab.jsx]"]
  node_circuit_grid["Circuit grid<br/>[CircuitGrid.jsx]"]
  node_circuit_parser["Circuit parser<br/>[circuitParser.js]"]
  node_gate_palette["Gate palette<br/>[GatePalette.jsx]"]
  node_simulation_results["Result display"]
  node_challenge_workbench["Challenge workbench"]
  node_challenge_data["Challenge catalog<br/>[challengesData.js]"]
  node_challenge_evaluator["Challenge evaluator"]
end

subgraph group_frontend_support["Frontend support"]
  node_progress_storage[("Progress storage<br/>[progressStorage.js]")]
  node_frontend_api["Quantum API client<br/>[quantumApi.js]"]
end

subgraph group_simulation["Simulation service"]
  node_api_service["FastAPI simulation endpoint<br/>[quantum_routes.py]"]
  node_circuit_schema["Circuit validation schema<br/>[quantum.py]"]
  node_quantum_service["Quantum circuit service<br/>[service.py]"]
  node_aer["Qiskit Aer"]
  node_local_cpu["Local CPU execution"]
end

node_learner(("Learner"))

node_learner -.->|"studies lessons"| node_curriculum
node_learner -.->|"explores concepts"| node_simulator_explorers
node_learner -.->|"builds circuits"| node_lab_page
node_learner -.->|"attempts challenges"| node_challenge_workbench
node_curriculum -->|"uses framework"| node_lesson_framework
node_curriculum -->|"uses framework"| node_lesson_framework
node_lesson_framework -.->|"dispatches simulations"| node_frontend_api
node_lab_page -.->|"presents builder"| node_circuit_grid
node_circuit_grid -.->|"converts grid"| node_circuit_parser
node_challenge_workbench -->|"renders palette"| node_gate_palette
node_challenge_workbench -->|"renders grid"| node_circuit_grid
node_challenge_workbench -->|"converts grid"| node_circuit_parser
node_challenge_workbench -->|"submits circuit"| node_frontend_api
node_challenge_workbench -->|"evaluates result"| node_challenge_evaluator
node_challenge_workbench -->|"renders results"| node_simulation_results
node_challenge_workbench -->|"renders state views"| node_visualizations
node_challenge_workbench -->|"loads challenges"| node_challenge_data
node_challenge_workbench -->|"records progress"| node_progress_storage
node_frontend_api -->|"posts circuit"| node_api_service
node_api_service -->|"validates payload"| node_circuit_schema
node_api_service -->|"calls simulation"| node_quantum_service
node_quantum_service -->|"consumes definitions"| node_circuit_schema
node_quantum_service -->|"executes circuit"| node_aer
node_aer -->|"runs locally"| node_local_cpu

click node_curriculum "https://github.com/vedantkulkarni12007-cyber/ketrix/tree/master/frontend/src/features/lessons"
click node_lesson_framework "https://github.com/vedantkulkarni12007-cyber/ketrix/tree/master/frontend/src/features/lessons/components"
click node_simulator_explorers "https://github.com/vedantkulkarni12007-cyber/ketrix/tree/master/frontend/src/features/simulator"
click node_visualizations "https://github.com/vedantkulkarni12007-cyber/ketrix/tree/master/frontend/src/features/visualization"
click node_lab_page "https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/pages/Lab.jsx"
click node_circuit_grid "https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/lab/components/CircuitGrid.jsx"
click node_circuit_parser "https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/lab/utils/circuitParser.js"
click node_gate_palette "https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/lab/components/GatePalette.jsx"
click node_simulation_results "https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/lab/components/SimulationResults.jsx"
click node_challenge_workbench "https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/challenges/components/ChallengeWorkbench.jsx"
click node_challenge_data "https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/challenges/data/challengesData.js"
click node_challenge_evaluator "https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/challenges/utils/quantumEvaluator.js"
click node_progress_storage "https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/challenges/utils/progressStorage.js"
click node_frontend_api "https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/services/quantumApi.js"
click node_api_service "https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/backend/app/api/quantum_routes.py"
click node_circuit_schema "https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/backend/app/schemas/quantum.py"
click node_quantum_service "https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/backend/app/quantum/service.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_curriculum,node_lesson_framework,node_simulator_explorers,node_visualizations toneBlue
class node_lab_page,node_circuit_grid,node_circuit_parser,node_gate_palette,node_simulation_results,node_challenge_workbench,node_challenge_data,node_challenge_evaluator toneAmber
class node_progress_storage,node_frontend_api toneMint
class node_api_service,node_circuit_schema,node_quantum_service,node_aer,node_local_cpu toneRose
class node_learner toneIndigo
```

## Components

### Learning & exploration

- [Interactive curriculum](https://github.com/vedantkulkarni12007-cyber/ketrix/tree/master/frontend/src/features/lessons): `frontend/src/features/lessons`
- [Lesson framework](https://github.com/vedantkulkarni12007-cyber/ketrix/tree/master/frontend/src/features/lessons/components): `frontend/src/features/lessons/components`
- [Quantum explorers](https://github.com/vedantkulkarni12007-cyber/ketrix/tree/master/frontend/src/features/simulator): `frontend/src/features/simulator`
- [State visualizations](https://github.com/vedantkulkarni12007-cyber/ketrix/tree/master/frontend/src/features/visualization): `frontend/src/features/visualization`

### Circuit building

- [Circuit lab](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/pages/Lab.jsx): `frontend/src/pages/Lab.jsx`
- [Circuit grid](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/lab/components/CircuitGrid.jsx): `frontend/src/features/lab/components/CircuitGrid.jsx`
- [Circuit parser](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/lab/utils/circuitParser.js): `frontend/src/features/lab/utils/circuitParser.js`
- [Gate palette](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/lab/components/GatePalette.jsx): `frontend/src/features/lab/components/GatePalette.jsx`
- [Result display](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/lab/components/SimulationResults.jsx): `frontend/src/features/lab/components/SimulationResults.jsx`
- [Challenge workbench](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/challenges/components/ChallengeWorkbench.jsx): `frontend/src/features/challenges/components/ChallengeWorkbench.jsx`
- [Challenge catalog](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/challenges/data/challengesData.js): `frontend/src/features/challenges/data/challengesData.js`
- [Challenge evaluator](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/challenges/utils/quantumEvaluator.js): `frontend/src/features/challenges/utils/quantumEvaluator.js`

### Frontend support

- [Progress storage](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/features/challenges/utils/progressStorage.js): `frontend/src/features/challenges/utils/progressStorage.js`
- [Quantum API client](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/frontend/src/services/quantumApi.js): `frontend/src/services/quantumApi.js`

### Simulation service

- [FastAPI simulation endpoint](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/backend/app/api/quantum_routes.py): `backend/app/api/quantum_routes.py`
- [Circuit validation schema](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/backend/app/schemas/quantum.py): `backend/app/schemas/quantum.py`
- [Quantum circuit service](https://github.com/vedantkulkarni12007-cyber/ketrix/blob/master/backend/app/quantum/service.py): `backend/app/quantum/service.py`
- **Qiskit Aer**
- **Local CPU execution**

### Other components

- **Learner**

## Connections

- Learner → Interactive curriculum: studies lessons
- Learner → Quantum explorers: explores concepts
- Learner → Circuit lab: builds circuits
- Learner → Challenge workbench: attempts challenges
- Interactive curriculum → Lesson framework: uses framework (evidence: `frontend/src/features/lessons/classical-vs-quantum/ClassicalVsQuantumLesson.jsx`)
- Interactive curriculum → Lesson framework: uses framework (evidence: `frontend/src/features/lessons/deutsch-jozsa/DeutschJozsaLesson.jsx`)
- Lesson framework → Quantum API client: dispatches simulations
- Circuit lab → Circuit grid: presents builder
- Circuit grid → Circuit parser: converts grid
- Challenge workbench → Gate palette: renders palette (evidence: `frontend/src/features/challenges/components/ChallengeWorkbench.jsx`)
- Challenge workbench → Circuit grid: renders grid (evidence: `frontend/src/features/challenges/components/ChallengeWorkbench.jsx`)
- Challenge workbench → Circuit parser: converts grid (evidence: `frontend/src/features/challenges/components/ChallengeWorkbench.jsx`)
- Challenge workbench → Quantum API client: submits circuit (evidence: `frontend/src/features/challenges/components/ChallengeWorkbench.jsx`)
- Challenge workbench → Challenge evaluator: evaluates result (evidence: `frontend/src/features/challenges/components/ChallengeWorkbench.jsx`)
- Challenge workbench → Result display: renders results (evidence: `frontend/src/features/challenges/components/ChallengeWorkbench.jsx`)
- Challenge workbench → State visualizations: renders state views (evidence: `frontend/src/features/challenges/components/ChallengeWorkbench.jsx`)
- Challenge workbench → Challenge catalog: loads challenges (evidence: `frontend/src/features/challenges/components/ChallengeWorkbench.jsx`)
- Challenge workbench → Progress storage: records progress (evidence: `frontend/src/features/challenges/components/ChallengeWorkbench.jsx`)
- Quantum API client → FastAPI simulation endpoint: posts circuit
- FastAPI simulation endpoint → Circuit validation schema: validates payload (evidence: `backend/app/api/quantum_routes.py`)
- FastAPI simulation endpoint → Quantum circuit service: calls simulation (evidence: `backend/app/api/quantum_routes.py`)
- Quantum circuit service → Circuit validation schema: consumes definitions (evidence: `backend/app/quantum/service.py`)
- Quantum circuit service → Qiskit Aer: executes circuit
- Qiskit Aer → Local CPU execution: runs locally
