An interactive quiz application to test your Rust programming knowledge!
🌐 Try it live:
https://rustquiz.porrapat.com
This project is inspired by:
- Rustfully – https://www.youtube.com/@Rustfully/posts
- Tutorialspoints – https://www.tutorialspoint.com/rust
rust_quiz/
├── src/ # Core library
│ ├── lib.rs # Module exports
│ ├── quiz.rs # Quiz data structures and question bank
│ └── engine.rs # Quiz state management and logic
├── cli/ # Command-line interface
│ └── src/
│ └── main.rs # CLI implementation
├── web/ # Web interface
│ ├── src/
│ │ └── main.rs # Leptos web app
│ ├── public/
│ │ └── style.css # Custom Rust-themed styling
│ └── index.html # Entry HTML file
└── Cargo.toml # Workspace configuration
- Rust 1.80+ (2024 edition)
- Cargo (comes with Rust)
- For web version: Trunk for building WebAssembly apps
Install Trunk:
cargo install --locked trunk- Clone the repository:
git clone https://github.com/Porrapat/rust_quiz.git
cd rust_quiz- Build the project:
cargo build --releaseRun the command-line quiz:
cargo install cargo-watch
cd cli
cargo watch -w ../src -w src -x runRun the web interface:
cd web
trunk serve --openor
cd web
trunk serve --open --watch ../src --watch . This will:
- Build the WebAssembly application
- Start a local development server (default: http://127.0.0.1:8080)
- Automatically open your browser
For production build:
cd web
trunk build --releaseThe built files will be in web/dist/.
cargo test- Rust 2024 Edition - Modern Rust language features
- rand - Random question selection
- Leptos - Reactive web framework for Rust/WebAssembly
- Trunk - WebAssembly build tool
- Bootstrap 5 - CSS framework
- Bootstrap Icons - Icon library
This project is open source and available under the MIT License.
I use multiple AI tools:
-
ChatGPT
Used for ideas, inspiration, conceptual discussions, and parsing information (including extracting text or structure from images or videos when needed). -
Gemini
Used for double-checking content and generating visual assets such as logos and illustrative images. -
Claude (via OpenRouter, VSCode + Cline)
Used as the primary coding assistant for drafting and refining Rust code.
All outputs from AI tools were reviewed, tested, and manually integrated by me.
Contributions are welcome! Feel free to:
- Add new quiz questions
- Improve explanations
- Enhance the UI/UX
- Fix bugs
- Add new features
Roadmap
- Add Tauri for Desktop using.
- Make dynamic questions store (JSON and Databases)
- Add more quiz structure. (Fill in the blank, drag and drop, etc.)
Created by Porrapat
Happy Learning! 🦀✨