# ajodo-godson/automata_diags architecture

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

- Interactive diagram: https://gitdiagram.com/ajodo-godson/automata_diags
- Repository: https://github.com/ajodo-godson/automata_diags

## Overview

Automata Diags combines an educational web app with a Python automata-theory toolkit. The user workflow is to select a simulator, edit a machine or grammar, run examples or test cases, and inspect results; tutorials and challenges provide a separate learning path. The backend also supports regular-language conversions and minimization, CFG algorithms, Turing-machine variants, transducers, and diagram drawing. The sampled frontend establishes app routing and several component relationships; other capabilities are documented or present in the tree, but their internal wiring was not sampled.

Main entry points: [`automata/frontend/src/App.js`](https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/App.js) (App routing), [`automata/backend/grammar/dist.py`](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/dist.py) (States and symbols), [`automata/backend/grammar/regular_languages/dfa/dfa_mod.py`](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/dfa/dfa_mod.py) (DFA runtime), [`automata/backend/grammar/regular_languages/nfa/nfa_mod.py`](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/nfa/nfa_mod.py) (NFA runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web experience"]
  node_app["App routing<br/>[App.js]"]
  node_dfa_ui["DFA simulator<br/>[DFASimulator.jsx]"]
  node_nfa_ui["NFA simulator<br/>[NFASimulator.jsx]"]
  node_pda_ui["PDA simulator<br/>[PDASimulator.jsx]"]
  node_cfg_ui["CFG simulator<br/>[CFGSimulator.jsx]"]
  node_tm_ui["TM simulator<br/>[TMSimulator.jsx]"]
  node_tutorial["Tutorial hub<br/>[TutorialHub.jsx]"]
  node_challenge["Challenge validation"]
  node_state_diagram["State diagrams<br/>[StateDiagram.jsx]"]
  node_layout["Diagram layout<br/>[automatonLayout.js]"]
  node_transport["Playback controls<br/>[Transport.jsx]"]
end

subgraph group_regular["Regular languages"]
  node_dfa["DFA runtime<br/>[dfa_mod.py]"]
  node_dfa_ops["DFA operations<br/>[dfa_ops.py]"]
  node_minimize["DFA minimization<br/>[hopcroft.py]"]
  node_nfa["NFA runtime<br/>[nfa_mod.py]"]
  node_nfa_search["NFA traversal<br/>[nfa_bfs.py]"]
  node_regex["Regex conversion<br/>[regex_to_nfa.py]"]
end

subgraph group_grammar["Grammars and stacks"]
  node_cfg["CFG model<br/>[cfg_mod.py]"]
  node_cfg_algorithms["CFG algorithms<br/>[cfg_algo.py]"]
  node_pda["PDA model<br/>[pda_mod.py]"]
end

subgraph group_machines["Machine models"]
  node_tm_standard["Standard TM<br/>[standard.py]"]
  node_tm_variants["TM variants"]
  node_transducers["Transducers"]
  node_drawings["Machine drawings"]
end

subgraph group_shared["Shared foundations"]
  node_base["Automaton base<br/>[automaton_base.py]"]
  node_types["States and symbols<br/>[dist.py]"]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_app
node_app -->|"renders"| node_dfa_ui
node_app -->|"renders"| node_nfa_ui
node_app -->|"renders"| node_pda_ui
node_app -->|"renders"| node_cfg_ui
node_app -->|"renders"| node_tm_ui
node_app -->|"renders"| node_tutorial
node_dfa_ui -->|"uses"| node_challenge
node_cfg_ui -->|"uses"| node_challenge
node_dfa_ui -->|"renders"| node_state_diagram
node_pda_ui -->|"renders"| node_state_diagram
node_state_diagram -->|"uses"| node_layout
node_dfa_ui -->|"uses"| node_transport
node_cfg_ui -->|"uses"| node_transport
node_pda_ui -->|"uses"| node_transport
node_dfa -->|"extends"| node_base
node_nfa -->|"extends"| node_base
node_dfa -->|"uses"| node_types
node_nfa -->|"uses"| node_types
node_base -->|"normalizes"| node_types
node_nfa -->|"delegates to"| node_nfa_search
node_nfa -->|"converts to"| node_dfa
node_nfa -->|"uses"| node_regex
node_dfa -->|"uses"| node_dfa_ops
node_dfa -->|"minimization"| node_minimize
node_cfg_algorithms -->|"operates on"| node_cfg
node_pda -->|"extends"| node_base
node_cfg -->|"uses"| node_types
node_pda -->|"uses"| node_types
node_tm_standard -->|"uses"| node_types
node_tm_standard -.->|"variant family"| node_tm_variants
node_transducers -.->|"uses"| node_types
node_drawings -.->|"visualizes"| node_dfa
node_drawings -.->|"visualizes"| node_tm_variants

click node_app "https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/App.js"
click node_dfa_ui "https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/DFA_components/DFASimulator.jsx"
click node_nfa_ui "https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/NFA_components/NFASimulator.jsx"
click node_pda_ui "https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/PDA_components/PDASimulator.jsx"
click node_cfg_ui "https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/CFG_components/CFGSimulator.jsx"
click node_tm_ui "https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/TM_components/TMSimulator.jsx"
click node_tutorial "https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/Tutorial_components/TutorialHub.jsx"
click node_challenge "https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/Tutorial_components/ChallengeValidator.js"
click node_state_diagram "https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/shared/StateDiagram.jsx"
click node_layout "https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/lib/automatonLayout.js"
click node_transport "https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/shared/Transport.jsx"
click node_dfa "https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/dfa/dfa_mod.py"
click node_dfa_ops "https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/dfa/dfa_ops.py"
click node_minimize "https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/dfa/minimization/hopcroft.py"
click node_nfa "https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/nfa/nfa_mod.py"
click node_nfa_search "https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/nfa/algo/nfa_bfs.py"
click node_regex "https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/regex_to_nfa.py"
click node_cfg "https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/context_free/cfg_mod.py"
click node_cfg_algorithms "https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/context_free/cfg_algo.py"
click node_pda "https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/context_free/pda/pda_mod.py"
click node_tm_standard "https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/turing_machines/standard.py"
click node_tm_variants "https://github.com/ajodo-godson/automata_diags/tree/main/automata/backend/grammar/turing_machines"
click node_transducers "https://github.com/ajodo-godson/automata_diags/tree/main/automata/backend/grammar/transducers"
click node_drawings "https://github.com/ajodo-godson/automata_diags/tree/main/automata/backend/drawings"
click node_base "https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/automaton_base.py"
click node_types "https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/dist.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_app,node_dfa_ui,node_nfa_ui,node_pda_ui,node_cfg_ui,node_tm_ui,node_tutorial,node_challenge,node_state_diagram,node_layout,node_transport toneBlue
class node_dfa,node_dfa_ops,node_minimize,node_nfa,node_nfa_search,node_regex toneAmber
class node_cfg,node_cfg_algorithms,node_pda toneMint
class node_tm_standard,node_tm_variants,node_transducers,node_drawings toneRose
class node_base,node_types,node_learner toneIndigo
```

## Components

### Web experience

- [App routing](https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/App.js): `automata/frontend/src/App.js`
- [DFA simulator](https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/DFA_components/DFASimulator.jsx): `automata/frontend/src/components/DFA_components/DFASimulator.jsx`
- [NFA simulator](https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/NFA_components/NFASimulator.jsx): `automata/frontend/src/components/NFA_components/NFASimulator.jsx`
- [PDA simulator](https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/PDA_components/PDASimulator.jsx): `automata/frontend/src/components/PDA_components/PDASimulator.jsx`
- [CFG simulator](https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/CFG_components/CFGSimulator.jsx): `automata/frontend/src/components/CFG_components/CFGSimulator.jsx`
- [TM simulator](https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/TM_components/TMSimulator.jsx): `automata/frontend/src/components/TM_components/TMSimulator.jsx`
- [Tutorial hub](https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/Tutorial_components/TutorialHub.jsx): `automata/frontend/src/components/Tutorial_components/TutorialHub.jsx`
- [Challenge validation](https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/Tutorial_components/ChallengeValidator.js): `automata/frontend/src/components/Tutorial_components/ChallengeValidator.js`
- [State diagrams](https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/shared/StateDiagram.jsx): `automata/frontend/src/components/shared/StateDiagram.jsx`
- [Diagram layout](https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/lib/automatonLayout.js): `automata/frontend/src/lib/automatonLayout.js`
- [Playback controls](https://github.com/ajodo-godson/automata_diags/blob/main/automata/frontend/src/components/shared/Transport.jsx): `automata/frontend/src/components/shared/Transport.jsx`

### Regular languages

- [DFA runtime](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/dfa/dfa_mod.py): `automata/backend/grammar/regular_languages/dfa/dfa_mod.py`
- [DFA operations](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/dfa/dfa_ops.py): `automata/backend/grammar/regular_languages/dfa/dfa_ops.py`
- [DFA minimization](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/dfa/minimization/hopcroft.py): `automata/backend/grammar/regular_languages/dfa/minimization/hopcroft.py`
- [NFA runtime](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/nfa/nfa_mod.py): `automata/backend/grammar/regular_languages/nfa/nfa_mod.py`
- [NFA traversal](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/nfa/algo/nfa_bfs.py): `automata/backend/grammar/regular_languages/nfa/algo/nfa_bfs.py`
- [Regex conversion](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/regular_languages/regex_to_nfa.py): `automata/backend/grammar/regular_languages/regex_to_nfa.py`

### Grammars and stacks

- [CFG model](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/context_free/cfg_mod.py): `automata/backend/grammar/context_free/cfg_mod.py`
- [CFG algorithms](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/context_free/cfg_algo.py): `automata/backend/grammar/context_free/cfg_algo.py`
- [PDA model](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/context_free/pda/pda_mod.py): `automata/backend/grammar/context_free/pda/pda_mod.py`

### Machine models

- [Standard TM](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/turing_machines/standard.py): `automata/backend/grammar/turing_machines/standard.py`
- [TM variants](https://github.com/ajodo-godson/automata_diags/tree/main/automata/backend/grammar/turing_machines): `automata/backend/grammar/turing_machines`
- [Transducers](https://github.com/ajodo-godson/automata_diags/tree/main/automata/backend/grammar/transducers): `automata/backend/grammar/transducers`
- [Machine drawings](https://github.com/ajodo-godson/automata_diags/tree/main/automata/backend/drawings): `automata/backend/drawings`

### Shared foundations

- [Automaton base](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/automaton_base.py): `automata/backend/grammar/automaton_base.py`
- [States and symbols](https://github.com/ajodo-godson/automata_diags/blob/main/automata/backend/grammar/dist.py): `automata/backend/grammar/dist.py`

### Other components

- **Learner**

## Connections

- Learner → App routing: uses (evidence: `automata/frontend/src/App.js`)
- App routing → DFA simulator: renders (evidence: `automata/frontend/src/App.js`)
- App routing → NFA simulator: renders (evidence: `automata/frontend/src/App.js`)
- App routing → PDA simulator: renders (evidence: `automata/frontend/src/App.js`)
- App routing → CFG simulator: renders (evidence: `automata/frontend/src/App.js`)
- App routing → TM simulator: renders (evidence: `automata/frontend/src/App.js`)
- App routing → Tutorial hub: renders (evidence: `automata/frontend/src/App.js`)
- DFA simulator → Challenge validation: uses (evidence: `automata/frontend/src/components/DFA_components/DFASimulator.jsx`)
- CFG simulator → Challenge validation: uses (evidence: `automata/frontend/src/components/CFG_components/CFGSimulator.jsx`)
- DFA simulator → State diagrams: renders (evidence: `automata/frontend/src/components/DFA_components/DFASimulator.jsx`)
- PDA simulator → State diagrams: renders (evidence: `automata/frontend/src/components/PDA_components/PDASimulator.jsx`)
- State diagrams → Diagram layout: uses (evidence: `automata/frontend/src/components/shared/StateDiagram.jsx`)
- DFA simulator → Playback controls: uses (evidence: `automata/frontend/src/components/DFA_components/DFASimulator.jsx`)
- CFG simulator → Playback controls: uses (evidence: `automata/frontend/src/components/CFG_components/CFGSimulator.jsx`)
- PDA simulator → Playback controls: uses (evidence: `automata/frontend/src/components/PDA_components/PDASimulator.jsx`)
- DFA runtime → Automaton base: extends (evidence: `automata/backend/grammar/regular_languages/dfa/dfa_mod.py`)
- NFA runtime → Automaton base: extends (evidence: `automata/backend/grammar/regular_languages/nfa/nfa_mod.py`)
- DFA runtime → States and symbols: uses (evidence: `automata/backend/grammar/regular_languages/dfa/dfa_mod.py`)
- NFA runtime → States and symbols: uses (evidence: `automata/backend/grammar/regular_languages/nfa/nfa_mod.py`)
- Automaton base → States and symbols: normalizes (evidence: `automata/backend/grammar/automaton_base.py`)
- NFA runtime → NFA traversal: delegates to (evidence: `automata/backend/grammar/regular_languages/nfa/nfa_mod.py`)
- NFA runtime → DFA runtime: converts to (evidence: `automata/backend/grammar/regular_languages/nfa/nfa_mod.py`)
- NFA runtime → Regex conversion: uses (evidence: `automata/backend/grammar/regular_languages/nfa/nfa_mod.py`)
- DFA runtime → DFA operations: uses (evidence: `automata/backend/grammar/regular_languages/dfa/dfa_mod.py`)
- DFA runtime → DFA minimization: minimization (evidence: `automata/backend/grammar/regular_languages/dfa/minimization/hopcroft.py`)
- CFG algorithms → CFG model: operates on (evidence: `automata/backend/grammar/context_free/cfg_algo.py`)
- PDA model → Automaton base: extends (evidence: `automata/backend/grammar/context_free/pda/pda_mod.py`)
- CFG model → States and symbols: uses (evidence: `automata/backend/grammar/context_free/cfg_mod.py`)
- PDA model → States and symbols: uses (evidence: `automata/backend/grammar/context_free/pda/pda_mod.py`)
- Standard TM → States and symbols: uses (evidence: `automata/backend/grammar/turing_machines/standard.py`)
- Standard TM → TM variants: variant family (evidence: `automata/backend/grammar/turing_machines/standard.py`)
- Transducers → States and symbols: uses (evidence: `automata/backend/grammar/transducers/scfg_parser.py`)
- Machine drawings → DFA runtime: visualizes
- Machine drawings → TM variants: visualizes (evidence: `automata/backend/drawings/tm_drawer.py`)
