# sophavisnuka/quantum-maze-solver architecture

> Architecture diagram of the GitHub repository sophavisnuka/quantum-maze-solver, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sophavisnuka/quantum-maze-solver
- Repository: https://github.com/sophavisnuka/quantum-maze-solver

## Overview

Quantum Maze Solver is an interactive maze game and Grover-search demonstration. Players configure and explore generated mazes, request a quantum solution, compare their route with the shortest route, and inspect the search rounds visually. The backend generates maze layouts, reduces them to decision graphs, and solves them using a configured simulation engine. The frontend renders the maze and solution, with separate visualizations for circuit statistics and Grover’s amplitude evolution. Evidence is limited to the supplied excerpts and SOURCE INDEX; the README is empty, so the frontend-to-backend HTTP link is shown as unverified.

Main entry points: [`frontend/src/App.tsx`](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/App.tsx) (Game application), [`backend/app/api/routes.py`](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/api/routes.py) (HTTP routes), [`frontend/src/hooks/useMazeGame.ts`](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/hooks/useMazeGame.ts) (Game state and controls), [`backend/app/services/maze_service.py`](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/services/maze_service.py) (Maze use cases)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_play["Maze gameplay"]
  node_app["Game application<br/>[App.tsx]"]
  node_game_state["Game state and controls<br/>[useMazeGame.ts]"]
  node_maze_view["Maze view<br/>[MazeGrid.tsx]"]
  node_settings["Maze settings<br/>[SettingsPanel.tsx]"]
  node_actions["Path actions<br/>[ActionsPanel.tsx]"]
  node_api_client["Maze API client<br/>[maze.ts]"]
end

subgraph group_api_domain["API and maze domain"]
  node_routes["HTTP routes<br/>[routes.py]"]
  node_schemas["Request and response schemas<br/>[schemas.py]"]
  node_maze_service["Maze use cases<br/>[maze_service.py]"]
  node_generator["Maze generation<br/>[generator.py]"]
  node_maze_model["Maze and decision graph<br/>[maze.py]"]
  node_shapes["Maze shape templates<br/>[shapes.py]"]
end

subgraph group_quantum["Quantum solving"]
  node_solver["Grover solver<br/>[grover_solver.py]"]
  node_engine_select["Simulation engine selection<br/>[__init__.py]"]
  node_numpy_engine["NumPy simulator<br/>[numpy_engine.py]"]
  node_qiskit_engine["Qiskit simulator<br/>[qiskit_engine.py]"]
end

subgraph group_explain["Solution exploration"]
  node_solution_panel["Solution and animation<br/>[SolutionPanel.tsx]"]
  node_grover_animation["Grover animation"]
  node_frames["Grover frames<br/>[groverFrames.ts]"]
  node_circuit_panel["Circuit statistics<br/>[CircuitPanel.tsx]"]
  node_charts["Search charts<br/>[Charts.tsx]"]
  node_histogram["Measurement histogram<br/>[histogram.ts]"]
end

node_player(("Player"))

node_player -->|"uses"| node_app
node_app -->|"uses"| node_game_state
node_app -->|"renders"| node_maze_view
node_app -->|"renders"| node_settings
node_app -->|"renders"| node_actions
node_app -->|"renders"| node_solution_panel
node_app -->|"renders"| node_circuit_panel
node_game_state -->|"fetches maze and solution"| node_api_client
node_game_state -.->|"supplies game state"| node_maze_view
node_player -.->|"requests maze or solve"| node_routes
node_api_client -.->|"calls HTTP API"| node_routes
node_routes -->|"uses response models"| node_schemas
node_routes -->|"calls use case"| node_maze_service
node_maze_service -->|"generates maze"| node_generator
node_generator -->|"builds maze graph"| node_maze_model
node_generator -->|"loads template"| node_shapes
node_maze_service -->|"solves maze"| node_solver
node_solver -->|"searches maze routes"| node_maze_model
node_solver -->|"selects engine"| node_engine_select
node_engine_select -->|"dispatches"| node_numpy_engine
node_engine_select -->|"dispatches"| node_qiskit_engine
node_solution_panel -->|"renders"| node_grover_animation
node_grover_animation -->|"builds animation frames"| node_frames
node_circuit_panel -->|"renders charts"| node_charts
node_circuit_panel -->|"formats outcomes"| node_histogram

click node_app "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/App.tsx"
click node_game_state "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/hooks/useMazeGame.ts"
click node_maze_view "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/MazeGrid.tsx"
click node_settings "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/SettingsPanel.tsx"
click node_actions "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/ActionsPanel.tsx"
click node_api_client "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/api/maze.ts"
click node_routes "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/api/routes.py"
click node_schemas "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/api/schemas.py"
click node_maze_service "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/services/maze_service.py"
click node_generator "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/domain/generator.py"
click node_maze_model "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/domain/maze.py"
click node_shapes "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/domain/shapes.py"
click node_solver "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/services/grover_solver.py"
click node_engine_select "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/services/engines/__init__.py"
click node_numpy_engine "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/services/engines/numpy_engine.py"
click node_qiskit_engine "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/services/engines/qiskit_engine.py"
click node_solution_panel "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/SolutionPanel.tsx"
click node_grover_animation "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/GroverAnimation.tsx"
click node_frames "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/utils/groverFrames.ts"
click node_circuit_panel "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/CircuitPanel.tsx"
click node_charts "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/Charts.tsx"
click node_histogram "https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/utils/histogram.ts"

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_app,node_game_state,node_maze_view,node_settings,node_actions,node_api_client toneBlue
class node_routes,node_schemas,node_maze_service,node_generator,node_maze_model,node_shapes toneAmber
class node_solver,node_engine_select,node_numpy_engine,node_qiskit_engine toneMint
class node_solution_panel,node_grover_animation,node_frames,node_circuit_panel,node_charts,node_histogram toneRose
class node_player toneIndigo
```

## Components

### Maze gameplay

- [Game application](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Game state and controls](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/hooks/useMazeGame.ts): `frontend/src/hooks/useMazeGame.ts`
- [Maze view](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/MazeGrid.tsx): `frontend/src/components/MazeGrid.tsx`
- [Maze settings](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/SettingsPanel.tsx): `frontend/src/components/SettingsPanel.tsx`
- [Path actions](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/ActionsPanel.tsx): `frontend/src/components/ActionsPanel.tsx`
- [Maze API client](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/api/maze.ts): `frontend/src/api/maze.ts`

### API and maze domain

- [HTTP routes](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/api/routes.py): `backend/app/api/routes.py`
- [Request and response schemas](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/api/schemas.py): `backend/app/api/schemas.py`
- [Maze use cases](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/services/maze_service.py): `backend/app/services/maze_service.py`
- [Maze generation](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/domain/generator.py): `backend/app/domain/generator.py`
- [Maze and decision graph](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/domain/maze.py): `backend/app/domain/maze.py`
- [Maze shape templates](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/domain/shapes.py): `backend/app/domain/shapes.py`

### Quantum solving

- [Grover solver](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/services/grover_solver.py): `backend/app/services/grover_solver.py`
- [Simulation engine selection](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/services/engines/__init__.py): `backend/app/services/engines/__init__.py`
- [NumPy simulator](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/services/engines/numpy_engine.py): `backend/app/services/engines/numpy_engine.py`
- [Qiskit simulator](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/backend/app/services/engines/qiskit_engine.py): `backend/app/services/engines/qiskit_engine.py`

### Solution exploration

- [Solution and animation](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/SolutionPanel.tsx): `frontend/src/components/SolutionPanel.tsx`
- [Grover animation](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/GroverAnimation.tsx): `frontend/src/components/GroverAnimation.tsx`
- [Grover frames](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/utils/groverFrames.ts): `frontend/src/utils/groverFrames.ts`
- [Circuit statistics](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/CircuitPanel.tsx): `frontend/src/components/CircuitPanel.tsx`
- [Search charts](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/components/Charts.tsx): `frontend/src/components/Charts.tsx`
- [Measurement histogram](https://github.com/sophavisnuka/quantum-maze-solver/blob/dev/frontend/src/utils/histogram.ts): `frontend/src/utils/histogram.ts`

### Other components

- **Player**

## Connections

- Player → Game application: uses (evidence: `frontend/src/App.tsx`)
- Game application → Game state and controls: uses (evidence: `frontend/src/App.tsx`)
- Game application → Maze view: renders (evidence: `frontend/src/App.tsx`)
- Game application → Maze settings: renders (evidence: `frontend/src/App.tsx`)
- Game application → Path actions: renders (evidence: `frontend/src/App.tsx`)
- Game application → Solution and animation: renders (evidence: `frontend/src/App.tsx`)
- Game application → Circuit statistics: renders (evidence: `frontend/src/App.tsx`)
- Game state and controls → Maze API client: fetches maze and solution (evidence: `frontend/src/hooks/useMazeGame.ts`)
- Game state and controls → Maze view: supplies game state
- Player → HTTP routes: requests maze or solve
- Maze API client → HTTP routes: calls HTTP API
- HTTP routes → Request and response schemas: uses response models (evidence: `backend/app/api/routes.py`)
- HTTP routes → Maze use cases: calls use case (evidence: `backend/app/api/routes.py`)
- Maze use cases → Maze generation: generates maze (evidence: `backend/app/services/maze_service.py`)
- Maze generation → Maze and decision graph: builds maze graph (evidence: `backend/app/domain/generator.py`)
- Maze generation → Maze shape templates: loads template (evidence: `backend/app/domain/generator.py`)
- Maze use cases → Grover solver: solves maze (evidence: `backend/app/services/maze_service.py`)
- Grover solver → Maze and decision graph: searches maze routes (evidence: `backend/app/services/grover_solver.py`)
- Grover solver → Simulation engine selection: selects engine (evidence: `backend/app/services/grover_solver.py`)
- Simulation engine selection → NumPy simulator: dispatches (evidence: `backend/app/services/engines/__init__.py`)
- Simulation engine selection → Qiskit simulator: dispatches (evidence: `backend/app/services/engines/__init__.py`)
- Solution and animation → Grover animation: renders (evidence: `frontend/src/components/SolutionPanel.tsx`)
- Grover animation → Grover frames: builds animation frames (evidence: `frontend/src/components/GroverAnimation.tsx`)
- Circuit statistics → Search charts: renders charts (evidence: `frontend/src/components/CircuitPanel.tsx`)
- Circuit statistics → Measurement histogram: formats outcomes (evidence: `frontend/src/components/CircuitPanel.tsx`)
