Skip to content

divquan/ttyper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TTyper - Terminal TypeRacer

Version License: GPL v3 Build Status

A terminal-based TypeRacer game built with React, OpenTUI, and Convex.

TTyper Screenshot

Features

Features

  • ๐ŸŽฎ Solo Practice Mode - Race against the clock with different text categories
  • ๐Ÿ“ Multiple Text Categories - Quotes, Code snippets, and Random words
  • ๐ŸŽจ Configurable Themes - Tokyo Night (default), Dark, and Light themes
  • โšก Real-time WPM Calculation - Live stats as you type
  • ๐Ÿ† Detailed Results - WPM, accuracy, consistency, and error tracking
  • ๐Ÿ”” Sound Effects - Terminal bell for errors and completion
  • ๐Ÿ–ฅ๏ธ Responsive Design - Works in terminals as small as 80x24

Installation

Via NPM (Recommended)

# Install globally
npm install -g ttyper

# Or run without installing
npx ttyper

Via Source

# Clone the repository
git clone https://github.com/divquan/ttyper.git
cd ttyper

# Install dependencies
bun install

# Run the game
bun run dev

Gameplay

  1. Splash Screen - Watch the animated logo and progress bar
  2. Main Menu - Navigate with arrow keys, Enter to select
  3. Solo Practice - Configure your race:
    • Text category (Quotes, Code, Random Words)
    • Duration (15s, 30s, 60s, Unlimited)
    • Difficulty (Easy, Medium, Hard)
  4. Race - Type the displayed text as fast and accurately as possible
    • Green = Correct
    • Red = Error
    • Yellow = Current position
  5. Results - View your performance stats
    • Press R to race again
    • Press M for main menu

Controls

  • Navigation: Arrow keys (โ†‘โ†“), Enter to select
  • Typing: Any printable characters, Backspace to delete
  • Quit Race: ESC
  • Exit App: ESC from menu, or Ctrl+C

Convex Setup (Multiplayer Phase 2)

To enable multiplayer features:

  1. Run Convex initialization:

    npx convex dev
  2. Follow the prompts to create a new project

  3. The schema will be automatically deployed

  4. Multiplayer features will be available in Phase 2

Project Structure

src/
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ screens/        # Screen components (Splash, Menu, Race, etc.)
โ”‚   โ”œโ”€โ”€ ui/            # Reusable UI components
โ”‚   โ””โ”€โ”€ shared/        # Shared components (ThemeProvider, etc.)
โ”œโ”€โ”€ hooks/             # Custom React hooks
โ”œโ”€โ”€ types/             # TypeScript type definitions
โ”œโ”€โ”€ utils/             # Utility functions
convex/
โ”œโ”€โ”€ schema.ts          # Convex database schema
โ””โ”€โ”€ README.md          # Convex setup instructions

Customization

Adding New Text Categories

Edit src/utils/textGenerators.ts:

export const textCategories: TextCategory[] = [
  // ... existing categories
  {
    id: 'poetry',
    name: 'Poetry',
    icon: '๐Ÿ“œ',
    description: 'Classic poetry excerpts',
    difficulty: 'medium',
    generator: generatePoetry
  }
]

Adding New Themes

Edit src/utils/themes.ts:

export const myTheme: GameTheme = {
  background: '#000000',
  foreground: '#ffffff',
  // ... other colors
}

export const themes = {
  // ... existing themes
  myTheme: myTheme
}

Roadmap

Phase 1 (Current) โœ…

  • Solo practice mode
  • Multiple text categories
  • Configurable themes
  • WPM/accuracy tracking
  • Sound effects

Phase 2 โœ… (Implemented)

  • โœ… Multiplayer races via Convex
  • โœ… Real-time lobby system
  • โœ… Quick play matchmaking
  • User statistics persistence (Coming Soon)
  • Chat system (Coming Soon)
  • Spectator mode (Coming Soon)

Phase 3 (Future)

  • Achievement system
  • Custom text upload
  • API integration for quotes
  • Advanced animations
  • Sound pack options

Built With

  • OpenTUI - Terminal UI framework
  • React - UI library
  • Convex - Backend and real-time sync
  • Bun - JavaScript runtime

Contributing

We welcome contributions! Please see our Contributing Guide for details on how to get started.

Code of Conduct

This project adheres to a Code of Conduct. By participating, you are expected to uphold this code.

Changelog

See CHANGELOG.md for a history of changes.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors