# jynxnanana/nfa architecture

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

- Interactive diagram: https://gitdiagram.com/jynxnanana/nfa
- Repository: https://github.com/jynxnanana/nfa

## Overview

CHCCI NFA Lab is a browser-based Vue app for building and studying nondeterministic finite automata. Users edit an automaton, inspect its representations, simulate individual or batch inputs, and save or export their work. The runtime is centered on a single large component, `src/App.vue`, with NFA validation and simulation logic in `src/nfa.js`; the app entry point mounts the component and loads its styles. Several feature-specific responsibilities share the App path because the repository tree shows no separate feature modules. Simulation and some export relationships are documented but not visible in the sampled implementation, so those links are marked unverified.

Main entry points: [`src/App.vue`](https://github.com/jynxnanana/nfa/blob/main/src/App.vue) (NFA Lab UI), [`src/main.js`](https://github.com/jynxnanana/nfa/blob/main/src/main.js) (Vue entry), [`src/style.css`](https://github.com/jynxnanana/nfa/blob/main/src/style.css) (App styling), [`src/mobile.css`](https://github.com/jynxnanana/nfa/blob/main/src/mobile.css) (Mobile styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["App startup"]
  node_entry["Vue entry<br/>[main.js]"]
  node_app["NFA Lab UI<br/>[App.vue]"]
  node_styles["App styling<br/>[style.css]"]
  node_mobile["Mobile styling<br/>[mobile.css]"]
end

subgraph group_authoring["NFA authoring"]
  node_editor["Automaton editor<br/>[App.vue]"]
  node_diagram["State diagram<br/>[App.vue]"]
  node_representations["Table and definition<br/>[App.vue]"]
  node_history["Undo and redo<br/>[App.vue]"]
  node_validator["NFA validation<br/>[nfa.js]"]
end

subgraph group_study["Testing and study"]
  node_simulator["String simulator<br/>[nfa.js]"]
  node_batch["Batch tests<br/>[App.vue]"]
  node_examples["Example NFAs<br/>[App.vue]"]
  node_guide["Quick guide<br/>[App.vue]"]
end

subgraph group_persistence["Files and persistence"]
  node_localstore[("Browser storage")]
  node_jsonfiles["JSON import/export<br/>[App.vue]"]
  node_imageexport["Diagram export<br/>[App.vue]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_entry -->|"mounts"| node_app
node_entry -->|"imports"| node_styles
node_entry -->|"imports"| node_mobile
node_app -->|"provides"| node_editor
node_editor -->|"visualizes"| node_diagram
node_editor -->|"keeps in sync"| node_representations
node_editor -->|"supports"| node_history
node_app -->|"validates with"| node_validator
node_app -.->|"simulates with"| node_simulator
node_app -->|"offers"| node_batch
node_app -->|"loads"| node_examples
node_app -->|"opens"| node_guide
node_app -->|"reads and writes"| node_localstore
node_app -->|"imports and exports"| node_jsonfiles
node_app -->|"exports diagram"| node_imageexport

click node_entry "https://github.com/jynxnanana/nfa/blob/main/src/main.js"
click node_app "https://github.com/jynxnanana/nfa/blob/main/src/App.vue"
click node_styles "https://github.com/jynxnanana/nfa/blob/main/src/style.css"
click node_mobile "https://github.com/jynxnanana/nfa/blob/main/src/mobile.css"
click node_editor "https://github.com/jynxnanana/nfa/blob/main/src/App.vue"
click node_diagram "https://github.com/jynxnanana/nfa/blob/main/src/App.vue"
click node_representations "https://github.com/jynxnanana/nfa/blob/main/src/App.vue"
click node_history "https://github.com/jynxnanana/nfa/blob/main/src/App.vue"
click node_validator "https://github.com/jynxnanana/nfa/blob/main/src/nfa.js"
click node_simulator "https://github.com/jynxnanana/nfa/blob/main/src/nfa.js"
click node_batch "https://github.com/jynxnanana/nfa/blob/main/src/App.vue"
click node_examples "https://github.com/jynxnanana/nfa/blob/main/src/App.vue"
click node_guide "https://github.com/jynxnanana/nfa/blob/main/src/App.vue"
click node_jsonfiles "https://github.com/jynxnanana/nfa/blob/main/src/App.vue"
click node_imageexport "https://github.com/jynxnanana/nfa/blob/main/src/App.vue"

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_entry,node_app,node_styles,node_mobile,node_user toneBlue
class node_editor,node_diagram,node_representations,node_history,node_validator toneAmber
class node_simulator,node_batch,node_examples,node_guide toneMint
class node_localstore,node_jsonfiles,node_imageexport toneRose
```

## Components

### App startup

- [Vue entry](https://github.com/jynxnanana/nfa/blob/main/src/main.js): `src/main.js`
- [NFA Lab UI](https://github.com/jynxnanana/nfa/blob/main/src/App.vue): `src/App.vue`
- [App styling](https://github.com/jynxnanana/nfa/blob/main/src/style.css): `src/style.css`
- [Mobile styling](https://github.com/jynxnanana/nfa/blob/main/src/mobile.css): `src/mobile.css`

### NFA authoring

- [Automaton editor](https://github.com/jynxnanana/nfa/blob/main/src/App.vue): `src/App.vue`
- [State diagram](https://github.com/jynxnanana/nfa/blob/main/src/App.vue): `src/App.vue`
- [Table and definition](https://github.com/jynxnanana/nfa/blob/main/src/App.vue): `src/App.vue`
- [Undo and redo](https://github.com/jynxnanana/nfa/blob/main/src/App.vue): `src/App.vue`
- [NFA validation](https://github.com/jynxnanana/nfa/blob/main/src/nfa.js): `src/nfa.js`

### Testing and study

- [String simulator](https://github.com/jynxnanana/nfa/blob/main/src/nfa.js): `src/nfa.js`
- [Batch tests](https://github.com/jynxnanana/nfa/blob/main/src/App.vue): `src/App.vue`
- [Example NFAs](https://github.com/jynxnanana/nfa/blob/main/src/App.vue): `src/App.vue`
- [Quick guide](https://github.com/jynxnanana/nfa/blob/main/src/App.vue): `src/App.vue`

### Files and persistence

- **Browser storage**
- [JSON import/export](https://github.com/jynxnanana/nfa/blob/main/src/App.vue): `src/App.vue`
- [Diagram export](https://github.com/jynxnanana/nfa/blob/main/src/App.vue): `src/App.vue`

### Other components

- **User**

## Connections

- User → NFA Lab UI: uses (evidence: `README.md`)
- Vue entry → NFA Lab UI: mounts (evidence: `src/main.js`)
- Vue entry → App styling: imports (evidence: `src/main.js`)
- Vue entry → Mobile styling: imports (evidence: `src/main.js`)
- NFA Lab UI → Automaton editor: provides (evidence: `README.md`)
- Automaton editor → State diagram: visualizes (evidence: `README.md`)
- Automaton editor → Table and definition: keeps in sync (evidence: `README.md`)
- Automaton editor → Undo and redo: supports (evidence: `README.md`)
- NFA Lab UI → NFA validation: validates with (evidence: `src/App.vue`)
- NFA Lab UI → String simulator: simulates with (evidence: `src/App.vue`)
- NFA Lab UI → Batch tests: offers (evidence: `README.md`)
- NFA Lab UI → Example NFAs: loads (evidence: `src/App.vue`)
- NFA Lab UI → Quick guide: opens (evidence: `src/App.vue`)
- NFA Lab UI → Browser storage: reads and writes (evidence: `README.md`)
- NFA Lab UI → JSON import/export: imports and exports (evidence: `src/App.vue`)
- NFA Lab UI → Diagram export: exports diagram (evidence: `README.md`)
