Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rType

A minimalist, typing test application built entirely using Rust and Ratatui.

rType features low-latency rendering, an immediate-mode GUI, dynamic theming, and an embedded typing database. It was designed using the Model-View-Update (MVU) Elm architecture to ensure strict separation of concerns between game logic, event handling, and UI rendering.

Features

  • Low-Latency Input: Built on crossterm for raw terminal input and instant keystroke registration.
  • Dynamic Theming: Change UI colors on the fly (Ctrl+T) without restarting the application. Includes popular themes like Tokyo Night, Gruvbox, and the Catppuccin suite.
  • Scores: Calculates true Words Per Minute (WPM) and Character Accuracy upon completion.
  • Embedded Dataset: Uses Rust's include_str! macro to bake the quotes database directly into the compiled binary. No external dependencies required to run!

Installation

Ensure you have Rust and Cargo installed on your system.

  1. Clone the repository:
git clone [https://github.com/hemanthhari2000/rtype.git](https://github.com/hemanthhari2000/rtype.git)
cd rtype
  1. Build and run the project:
cargo run --release

(Note: Running with --release is highly recommended for terminal UI applications to ensure the smoothest rendering possible).

Architecture

This project adheres to the Model-View-Update (MVU) pattern to maintain clean, scalable code:

  • src/main.rs: The Application Bootstrapper. Safely initializes crossterm raw mode, runs the game loop, and restores terminal even if the app panics.
  • src/app.rs (Model): Contains the single source of truth for the application state (Target text, typed characters, active theme, game screen).
  • src/event.rs (Update): The isolated input handler. Translates crossterm keystrokes into state mutations.
  • src/ui/ (View): The rendering engine. Takes an immutable reference to the App state and paints the interface using ratatui. Split into modular layout components (typing.rs, popup.rs, etc.).

Themes Included

  • Default (Catppuccin Mocha)
  • Tokyo Night
  • Gruvbox
  • Catppuccin (Latte, Frappe, Macchiato, Mocha)

Built as a journey into Rust Systems Programming and Terminal UIs.

About

A minimalist, typing test application built entirely using Rust and Ratatui.

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages