A real-time multiplayer web application for learning Japanese kanji through interactive gameplay. Built with Rust using Axum for the backend API and Leptos for the WebAssembly frontend.
文字 (Moji) is a web-based game designed to help users learn Japanese kanji characters through active recognition. Players are presented with a kanji character and must submit valid Japanese words containing that character. The game supports multiplayer lobbies where players can compete and learn together.
- Real-time gameplay: Test your knowledge of Japanese kanji characters
- Multiplayer support: Create and join game lobbies with friends
- Word validation: Automatic validation against a dictionary of Japanese words
- Score tracking: Keep track of correct answers and compete with other players
- Responsive design: Play on desktop or mobile devices
- Backend: Rust + Axum web framework
- Frontend: Rust + Leptos (WebAssembly)
- Database: PostgreSQL with SQLx
- Containerization: Docker support for easy deployment
- Rust toolchain (1.70 or newer)
- PostgreSQL database
- Wasm target:
rustup target add wasm32-unknown-unknown - Trunk:
cargo install trunk
-
Clone the repository:
git clone https://github.com/yourusername/kanji-guesser.git cd kanji-guesser -
Set up the database:
export DATABASE_URL=postgres://user:password@localhost/kanji_guesser -
Run database migrations:
cd backend cargo run --bin migrate -
Start the backend server:
cd backend cargo run -
In a separate terminal, start the frontend development server:
cd frontend trunk serve -
Visit
http://localhost:8080in your browser to use the application
docker-compose up -d
- Join or create a game lobby
- When it's your turn, you'll be presented with a kanji character
- Type a Japanese word containing that kanji character
- Submit your answer to earn points if correct
- Challenge other players and learn new vocabulary together
-
/backend- Axum API server/src/models- Database models and business logic/src/api- API endpoint handlers/src/db- Database connection and utilities/src/error- Error handling/src/data- Data loading and processing
-
/frontend- Leptos WebAssembly application/src/components- UI components/src/api- API client code/src/error- Error handling
-
Pre-game Lobby Enhancements:
- Lobby leader controls for game settings
- Configurable kanji difficulty levels (N5-N1)
- Customizable time limits for guesses
- Player queue system with turn-based gameplay
- Option to attempt previous player's missed kanji
-
Real-time Features:
- WebSocket integration for live player updates
- Real-time typing indicators
- Instant score updates
-
Authentication & Accounts:
- User registration and login
- Persistent player statistics
- Achievement system
-
Enhanced Gameplay:
- Global leaderboards
- Different game modes
- Kanji information and learning resources
-
UI Improvements:
- Dark mode toggle
- Language switching between Japanese and English
- Mobile optimizations
- Accessibility enhancements
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.