Thrift Illustrated is a static learning site. It shows Apache Thrift bytes from real local traffic.
The goal is simple: make Thrift wire data easy to see and easy to learn. This project takes design ideas from illustrated-tls12.
Thrift tutorials often show only method calls and return values. That is useful, but it hides the wire format.
This project helps you:
- See real bytes from real Ruby tutorial calls.
- Compare protocol and transport choices.
- Learn what each byte means.
- Review changes with stable, committed data files.
Important
Capture data must come from real localhost Ruby traffic. No fake wire fixtures.
The project has two parts.
- A Ruby pipeline captures and parses traffic.
- A static web app renders that data.
Pipeline flow:
- Run tutorial client and server on localhost.
- Record write chunks from client and server.
- Parse bytes into messages, fields, and spans.
- Validate schema and call-flow rules.
- Write JSON artifacts into
site/data/captures/.
UI flow:
- Load
manifest.json. - Load one combo dataset.
- Check byte size and SHA-256.
- Render timeline, summary, hexdump, and field tree.
Byte learning behavior:
- Hover a field to highlight its bytes.
- Hover a byte to highlight its field.
- Click a byte to show its byte group.
- Hover subfields to highlight exact sub-ranges.
- Hex and ASCII views stay linked.
Note
The site is plain HTML, CSS, and JavaScript. There is no bundling step.
binary + buffered
binary + framed
compact + buffered
compact + framed
json + buffered
json + framed
header + header
Prerequisites:
mise- Ruby
4.0.1 - Bun
1.3.5
Setup:
mise install
mise run depsCapture data:
mise run gen
mise exec -- bundle exec rake captureRun Ruby checks:
mise exec -- bundle exec rake checkRun cross-language checks (Ruby + JavaScript + benchmark schema):
mise run ciRun local web server:
mise run webOpen http://127.0.0.1:8000/.
Capture command:
bundle exec ruby scripts/capture_all.rb [--combo <id>] [--output <dir>] [--strict]Flags:
--combo: run only one combo.--output: write artifacts to another repo-local path.--strict: stop on first non-warning parse error.
Env var:
THRIFT_TIMEOUT_MS(default5000)
UI hash state:
#combo=<combo-id>&msg=<index>
Example:
#combo=compact-framed&msg=4
CI runs on push to main and on pull requests.
CI commands:
mise run ciDependabot updates:
- Bundler gems
- GitHub Actions
- npm/Bun packages
- Read
CONSTITUTION.mdfirst. - Keep the site static.
- Keep captures real and local.
- If parser or capture code changes, regenerate artifacts.
- Run tests before opening a PR.
Useful commands:
mise exec -- bundle exec rake check
mise run ci
mise exec -- bun run scripts/ui_smoke_test.mjsIf browser checks fail, set CHROME_BIN to your Chrome or Chromium path.
site/ static UI, capture data, and schemas
scripts/ capture, parser, validation, benchmark, and health scripts
thrift/ tutorial IDL and generated Ruby stubs (`gen-rb`)
test/ Ruby unit and integration tests
mise.toml pinned tools and local tasks (`web`, `gen`, `ci`)
