-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Reeshav Sinha edited this page Jun 20, 2026
·
4 revisions
This page is for contributors. It explains the tech stack, how the code is organised, and the core design idea that keeps AutomataLab fast and testable.
| Layer | Technology |
|---|---|
| Desktop shell | Tauri v2 (Rust) — native windows, file dialogs, auto‑updater |
| UI | React 19 + TypeScript |
| Build / dev | Vite 6 |
| State | Zustand stores |
| Graph canvas |
React Flow (@xyflow/react) |
| Auto‑layout |
ELK (elkjs) |
| Animation | Framer Motion |
| Styling | Tailwind CSS v4 |
| Tests | Vitest |
The single most important principle is that the simulation engine is pure TypeScript with no dependency on React, the DOM, or Tauri. This buys three things:
- Testability — engines are unit‑tested directly (the suite has 200+ tests).
- A web build — because nothing in the engine needs Tauri, the same code ships as a Vercel web app. Tauri plugins are dynamically imported so the web bundle never pulls in native‑only code.
- Reuse — the interactive simulator, the batch runner, and the exporters all run the same engine via a headless run‑to‑completion path, so results never diverge.
src/
engines/
core/ # shared types, computation‑tree builder, helpers, engineFactory
dfa/ nfa/ enfa/ # finite‑automaton engines (+ *.test.ts)
dpda/ npda/ # pushdown engines
tm/ lba/ # Turing‑machine & linear‑bounded engines
store/ # Zustand: machineStore, simulationStore, uiStore
hooks/ # useSimulation — bridges stores ↔ engine
components/
canvas/ # AutomataCanvas, StateNode, TransitionEdge, ContextMenu, TransitionEditor
panels/ # SidePanel, ValidationPanel, HistoryLog, ComputationTreePanel, TapePanel, DeltaTablePanel
controls/ # SimulationControls, InputBar, BatchRunnerModal
toolbar/ # Toolbar, FileControls
layout/ # HelpModal, ExportModal
utils/ # validator, fileManager, exporters, batch
index.css # global styles / theme tokens
src-tauri/ # Rust shell + tauri.conf.json
.github/workflows/ # release.yml (tagged builds + release), deploy.yml (Pages)
-
engines/core/types.tsdefines the shared machine/automaton types and the configuration shape each engine steps through. -
engines/core/engineFactory.tscreates the right engine for a machine type and provides arunToCompletionhelper used by the batch runner and exporters. - Each engine (e.g.
engines/tm/TMEngine.ts) implements stepping/branching for its model. -
engines/core/computationTree.tsturns a run into the tree/trellis the UI renders (merging configurations for FA, branching for NPDA). -
Stores (Zustand):
machineStoreholds the machine definition and edit history (undo/redo);simulationStoreholds run state;uiStoreholds panel/tab/focus UI state. -
hooks/useSimulation.tsis the bridge: it watches a structural signature of the machine and auto‑resets the simulation to Idle whenever the structure changes, which is what keeps a finished run from "locking" the editor. -
utils/:validatorproduces the Validation‑tab items;fileManagerserialises/parses.autolab.json(Tauri dialogs on desktop, download/upload on web);exportersproduce CSV/LaTeX/JSON;batchparses test cases and runs them headlessly.
- Add the type to
engines/core/types.ts. - Implement an engine under
engines/<type>/with its own*.test.ts. - Register it in
engineFactory. - Teach the validator, transition editor, δ‑table, and fileManager about its transition shape.
- Wire any model‑specific panel (e.g. tape/stack) and toolbar settings.
- Add tests and run
npm test.
- Vercel deployment — web deployments are handled via Vercel for the live simulator.
-
release.yml— on a pushedv*tag, builds signed installers for Windows/macOS/Linux viatauri-action, then publishes a GitHub Release whose notes are extracted from the top section ofCHANGELOG.md. A follow‑up job mirrors the updater manifest toupdater.jsonfor the auto‑updater.
See CONTRIBUTING.md for contribution guidelines.
AutomataLab v4.1.0 · Repository · Download · Web app · MIT License
Using the app
Machine models
Tools & data
Project