- Rust 32.7%
- TypeScript 25.3%
- Svelte 17.3%
- CSS 8.3%
- HTML 8%
- Other 8.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
ci / image (rust:1-slim-bookworm=docker-image://git.yhkze.net/actions/rust:1-slim-bookworm
debian:bookworm-slim=docker-image://git.yhkze.net/actions/debian:bookworm-slim
, ., api.Dockerfile, rgxr-api) (push) Successful in 5m16s
ci / rust (push) Successful in 4m12s
ci / web (push) Successful in 1m24s
ci / image (oven/bun:1.4.2-debian=docker-image://git.yhkze.net/actions/bun:1.4.2-debian
node:22-bookworm-slim=docker-image://git.yhkze.net/actions/node:22-bookworm-slim
, web, web.Dockerfile, rgxr-web) (push) Successful in 2m30s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q7bU4JSq7aBvoTSXG3q6fG |
||
| .forgejo/workflows | ||
| .tern | ||
| crates | ||
| docs | ||
| docs-html | ||
| migrations | ||
| resources/images | ||
| web | ||
| .dockerignore | ||
| .gitignore | ||
| api.Dockerfile | ||
| Cargo.lock | ||
| Cargo.toml | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| openapi.yaml | ||
| README.md | ||
| web.Dockerfile | ||
rgxr
A workbench for the theory of computation: draw automata on an infinite canvas or write them as text, run words through them with step-by-step traces, work the algebra, and drill everything in the dojo. A lightbulb in any section's top bar has the sensei walk you through it, live. Anonymous by default (no login required), self-hostable by anyone, with optional sign-in through any OpenID Connect provider if you want accounts.
What it does
- Automata editor: an infinite canvas with drag-and-drop states and transitions, plus a text DSL to type the machine instead of drawing it. Both views edit the same automaton.
- Word running: run a word against a DFA or NFA and get a step-by-step trace of the epsilon-closed active states; Turing machines play the tape back, head and all, after every step.
- The algebra (OPS): determinize, minimize, complement, and products (union, intersection, difference). Table-filling shows you why two states are (in)equivalent.
- Regex ⇄ automaton: regex to NFA (Thompson) and automaton back to regex (state elimination), both directions checked by the engine.
- Context-free grammars: CNF conversion, chart parsing, parse trees, and PDA ⇄ CFG conversion.
- PDAs and Turing machines: multi-tape (up to four) and nondeterministic, with configuration search and step playback.
- Render and export: graphviz SVG for anything you build, LaTeX (TikZ) export for your documents.
- Saved documents: automata, grammars and machines persist in Postgres, scoped per user.
- The dojo: problems graded by the engine itself, never by a model. The LLM sensei ("Supa Choi") composes fresh problems and comments on your answers; offline scrolls work with no setup at all.
- Per-section tutorials: a lightbulb in the top bar docks the
sensei next to the live UI and he walks you through the section:
theory first, then the controls, including
[ SHOW ME ]steps where the app fills inputs and presses buttons in front of you. You learn the theory while using the tool, with no prior course required. - English and Spanish throughout, with Japanese flavor.
- Retro CRT terminal aesthetic: pure black, monospace, one accent color.
Screens
| Editor + run trace | Render (graphviz SVG) |
|---|---|
![]() |
![]() |
| OPS algebra (minimized DFA) | TM tape with playback |
![]() |
![]() |
| Grammars (parse tree) | Dojo (training menu) |
![]() |
![]() |
Documentation
The documentation index links every page:
- Reference: the normative contract (
Fawire format, derived-state naming, auth model, saved documents, trace semantics, regex syntax, limits, env vars, error envelope) - Operations: images, promotion lanes, environments, secrets and auth headers
- Design notes: the retro-terminal UI direction
- The dojo and the sensei: problem sources, LLM brains, minimum model
- Development: toolchain, quick start, the no-unwrap policy, docs rendering, CI and commit conventions
Quick start
nix develop # tern, pandoc, bun, graphviz, latex, jq/yq, openbao
docker run -d --name rgxr-pg -p 5432:5432 \
-e POSTGRES_USER=rgxr -e POSTGRES_PASSWORD=rgxr -e POSTGRES_DB=rgxr \
postgres:17-alpine
DATABASE_URL=postgres://rgxr:rgxr@localhost:5432/rgxr \
RGXR_DEV_MODE=true cargo run -p rgxr-api
# api: http://localhost:8080/healthz · Swagger: http://localhost:8080/api-docs
cd web && bun install && bun run dev
# web: http://localhost:5173 (proxies /api → :8080)
RGXR_DEV_MODE=true serves requests without a token as anonymous; migrations apply
automatically at API startup.
Architecture
The application is three pieces:
flowchart TB
B["Browser — SvelteKit SPA"] --> W["rgxr-web — SvelteKit (adapter-node)"]
W -->|"/api"| A["rgxr-api — axum, stateless"]
A --> P[("Postgres — jsonb documents, per-user scoping")]
IDP["OIDC provider — optional sign-in"] -.->|"access token (PKCE)"| B
B -.->|"Authorization: Bearer, else anonymous"| A
Signing in is optional: the browser gets an access token from any OpenID Connect provider and the API verifies it; without one, every request is the anonymous user. The sensei talks to any OpenAI-compatible endpoint and needs an API key (yours, entered in the browser); rendering shells out to graphviz, optionally with a LaTeX toolchain for TikZ export.
Repository layout
crates/rgxr-core Pure automata engine (no IO): run, ops, regex, grammars, PDA/TM, grading
crates/rgxr-render DOT generation + render pipeline (graphviz / LaTeX)
crates/rgxr-api axum + sqlx HTTP API
web/ SvelteKit frontend
openapi.yaml THE API contract — every consumer/producer derives from it
migrations/ sqlx migrations, applied at API startup
docs/ + docs-html/ Documentation source and the tern-compiled HTML
resources/images/ Captures used by this README and the docs
Docs build
The documentation (this README and docs/) compiles to docs-html/
with:
nix develop -c tern --update # once, or after changing .tern/config.toml
nix develop -c tern





