How neknaj/typingmp works
Project type and purpose
• This is a multi‐platform typing tutor application (“Neknaj Typing MP”) written in Rust.
• It has a single shared core (business logic and state), and four thin platform‐specific “backends”: a desktop GUI, a terminal TUI, a WebAssembly browser build, and a bare‐metal UEFI app.
• The README confirms its goal: demonstrate Rust’s portability by reusing core logic across vastly different environments.
File structure
• Top‐level Rust files and config:
• Cargo.toml, Cargo.lock, build.rs → Rust build configuration.
• src/ → all Rust source files.
• .github/workflows/release.yml → CI for release builds.
• Platform backends in src/:
• gui.rs, tui.rs, wasm.rs, uefi.rs → entry points for each target.
• wasm_debug_logger.rs → support for WebSocket debug logging in WASM.
• logger_server.js, package.json, package-lock.json → NodeJS WebSocket server for WASM debug logs.
• Core and shared layers:
• app.rs, typing.rs, model.rs, parser.rs → core logic (“The Brain”).
• ui.rs → UI abstraction producing Renderable lists.
• renderer.rs → rendering engine (gui_renderer vs tui_renderer).
• layout_data.rs → data tables for Japanese Romaji→Kana; timestamp.rs, timestamp.rs, etc.
• Examples, fonts, scripts:
• examples/*.ntq → problem file examples.
• fonts/*.txt → font metric data.
• run_uefi*.ps1, rust_multibackend_app.efi → build/run helpers for UEFI.
• index.html, script.py → static assets for the WASM build and optional Python server.
README for architecture insights
• It explicitly defines four layers:
1. Backends (gui.rs, tui.rs, wasm.rs, uefi.rs)
2. Rendering Engine (renderer.rs)
3. UI Abstraction Layer (ui.rs)
4. Core Logic (app.rs, typing.rs, model.rs, parser.rs, etc.)
• It highlights a “body” (backends) vs “brain” (core logic) separation and how feature flags select the active backend at compile time.