# grotoo/a-maze-ing-project architecture

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

- Interactive diagram: https://gitdiagram.com/grotoo/a-maze-ing-project
- Repository: https://github.com/grotoo/a-maze-ing-project

## Overview

A-Maze-ing is a configured maze generator with an interactive terminal viewer. The workflow reads and validates configuration, generates a perfect or loop-rich playable maze, exports its hexadecimal representation and solution, then renders it with controls to regenerate, reveal the path, or rotate colours. The reusable generation package also provides the maze model, shortest-path solving, and optional isolated “42” pattern. Generator internals are combined because the sampled source places these capabilities in one module; rendering and export call maze methods directly. Unshown details are limited to README-documented capabilities.

Main entry points: [`src/controller.py`](https://github.com/grotoo/a-maze-ing-project/blob/main/src/controller.py) (Interactive controller), [`mazegen/generator.py`](https://github.com/grotoo/a-maze-ing-project/blob/main/mazegen/generator.py) (Maze generation), [`a_maze_ing.py`](https://github.com/grotoo/a-maze-ing-project/blob/main/a_maze_ing.py) (CLI entrypoint), [`src/maze_exporter.py`](https://github.com/grotoo/a-maze-ing-project/blob/main/src/maze_exporter.py) (Hex exporter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_entrypoint["CLI entrypoint<br/>[a_maze_ing.py]"]
  node_config["Config parsing<br/>[config_parser.py]"]
  node_controller["Interactive controller<br/>[controller.py]"]
  node_errors["Application errors<br/>[errors.py]"]
end

subgraph group_core["Maze core"]
  node_model["Maze model<br/>[generator.py]"]
  node_generation["Maze generation<br/>[generator.py]"]
  node_playable["Playable loops<br/>[generator.py]"]
  node_pattern["42 pattern<br/>[generator.py]"]
  node_solver["Shortest path<br/>[generator.py]"]
end

subgraph group_io["Output"]
  node_renderer["ASCII renderer<br/>[ascii_renderer.py]"]
  node_exporter["Hex exporter<br/>[maze_exporter.py]"]
end

node_user(("Terminal user"))
node_configfile["Config file"]
node_output["Maze output file"]

node_user -->|"runs CLI"| node_entrypoint
node_entrypoint -->|"loads config"| node_config
node_configfile -->|"reads settings"| node_config
node_entrypoint -->|"starts session"| node_controller
node_controller -->|"generates maze"| node_generation
node_generation -.->|"creates maze"| node_model
node_generation -.->|"adds loops"| node_playable
node_generation -.->|"places pattern"| node_pattern
node_controller -->|"exports maze"| node_exporter
node_controller -->|"renders maze"| node_renderer
node_renderer -->|"gets path"| node_solver
node_exporter -->|"gets path"| node_solver
node_exporter -->|"writes file"| node_output
node_controller -->|"shows controls"| node_user
node_controller -->|"handles errors"| node_errors

click node_entrypoint "https://github.com/grotoo/a-maze-ing-project/blob/main/a_maze_ing.py"
click node_config "https://github.com/grotoo/a-maze-ing-project/blob/main/src/config_parser.py"
click node_controller "https://github.com/grotoo/a-maze-ing-project/blob/main/src/controller.py"
click node_errors "https://github.com/grotoo/a-maze-ing-project/blob/main/src/errors.py"
click node_model "https://github.com/grotoo/a-maze-ing-project/blob/main/mazegen/generator.py"
click node_generation "https://github.com/grotoo/a-maze-ing-project/blob/main/mazegen/generator.py"
click node_playable "https://github.com/grotoo/a-maze-ing-project/blob/main/mazegen/generator.py"
click node_pattern "https://github.com/grotoo/a-maze-ing-project/blob/main/mazegen/generator.py"
click node_solver "https://github.com/grotoo/a-maze-ing-project/blob/main/mazegen/generator.py"
click node_renderer "https://github.com/grotoo/a-maze-ing-project/blob/main/src/ascii_renderer.py"
click node_exporter "https://github.com/grotoo/a-maze-ing-project/blob/main/src/maze_exporter.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_entrypoint,node_config,node_controller,node_errors,node_user toneBlue
class node_model,node_generation,node_playable,node_pattern,node_solver toneAmber
class node_renderer,node_exporter toneMint
class node_configfile,node_output toneIndigo
```

## Components

### Application

- [CLI entrypoint](https://github.com/grotoo/a-maze-ing-project/blob/main/a_maze_ing.py): `a_maze_ing.py`
- [Config parsing](https://github.com/grotoo/a-maze-ing-project/blob/main/src/config_parser.py): `src/config_parser.py`
- [Interactive controller](https://github.com/grotoo/a-maze-ing-project/blob/main/src/controller.py): `src/controller.py`
- [Application errors](https://github.com/grotoo/a-maze-ing-project/blob/main/src/errors.py): `src/errors.py`

### Maze core

- [Maze model](https://github.com/grotoo/a-maze-ing-project/blob/main/mazegen/generator.py): `mazegen/generator.py`
- [Maze generation](https://github.com/grotoo/a-maze-ing-project/blob/main/mazegen/generator.py): `mazegen/generator.py`
- [Playable loops](https://github.com/grotoo/a-maze-ing-project/blob/main/mazegen/generator.py): `mazegen/generator.py`
- [42 pattern](https://github.com/grotoo/a-maze-ing-project/blob/main/mazegen/generator.py): `mazegen/generator.py`
- [Shortest path](https://github.com/grotoo/a-maze-ing-project/blob/main/mazegen/generator.py): `mazegen/generator.py`

### Output

- [ASCII renderer](https://github.com/grotoo/a-maze-ing-project/blob/main/src/ascii_renderer.py): `src/ascii_renderer.py`
- [Hex exporter](https://github.com/grotoo/a-maze-ing-project/blob/main/src/maze_exporter.py): `src/maze_exporter.py`

### Other components

- **Terminal user**
- **Config file**
- **Maze output file**

## Connections

- Terminal user → CLI entrypoint: runs CLI (evidence: `README.md`)
- CLI entrypoint → Config parsing: loads config (evidence: `a_maze_ing.py`)
- Config file → Config parsing: reads settings (evidence: `README.md`)
- CLI entrypoint → Interactive controller: starts session (evidence: `a_maze_ing.py`)
- Interactive controller → Maze generation: generates maze (evidence: `src/controller.py`)
- Maze generation → Maze model: creates maze (evidence: `mazegen/generator.py`)
- Maze generation → Playable loops: adds loops (evidence: `mazegen/generator.py`)
- Maze generation → 42 pattern: places pattern (evidence: `mazegen/generator.py`)
- Interactive controller → Hex exporter: exports maze (evidence: `src/controller.py`)
- Interactive controller → ASCII renderer: renders maze (evidence: `src/controller.py`)
- ASCII renderer → Shortest path: gets path (evidence: `src/ascii_renderer.py`)
- Hex exporter → Shortest path: gets path (evidence: `src/maze_exporter.py`)
- Hex exporter → Maze output file: writes file (evidence: `src/maze_exporter.py`)
- Interactive controller → Terminal user: shows controls (evidence: `src/controller.py`)
- Interactive controller → Application errors: handles errors (evidence: `src/controller.py`)
