Skip to content

erdcpatel/type-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

18 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

TypeFlow - Typing Speed Improver

TypeFlow is a modern, privacy-focused typing speed trainer built with React. It tracks your progress locally using IndexedDB, helps you identify weak keys, and offers structured lessons to improve your touch typing.

โœจ Features

๐ŸŽฏ Multiple Training Modes

  • Practice Mode: Type against difficulty-based text sets (Basic, Intermediate, Advanced)
  • Structured Lessons: Progressive lessons starting from home row basics to full keyboard mastery
  • Custom Text Support: Paste your own text (articles, code, etc.) to practice specific content
  • Sudden Death Mode: One mistake ends the game - perfect for accuracy training

๐Ÿ“Š Advanced Analytics

  • Real-time Metrics: Live WPM and accuracy tracking
  • Persistent History: All data stored permanently in IndexedDB
  • Daily Streaks: Track your consistency with streak counters
  • Per-Lesson Progress: Attempts, best WPM, and average accuracy for each lesson
  • Key-Level Analytics: Visual breakdown showing accuracy for every key
  • Smart Key Drills: Automatically identifies your weakest keys and generates custom practice

๐ŸŽฎ Interactive Features

  • Ghost Replay: Race against your personal best performance
  • Progress Tracking: Day-to-day progress with local timezone support
  • Reset Functionality: Clear all stats to start fresh anytime

๐Ÿ”’ Privacy First

All data is stored locally in your browser using IndexedDB. No signup required, no data sent to servers, complete privacy.

๐Ÿ› ๏ธ Technology Stack

  • Framework: React 18
  • Build Tool: Vite
  • Styling: CSS Modules with glassmorphism aesthetic
  • State Management: React Hooks (useState, useEffect, useCallback)
  • Storage: IndexedDB for permanent local storage
  • Date Handling: Local timezone support with proper date grouping

๐Ÿ Getting Started

Prerequisites

  • Node.js (v20.19.0 or higher)
  • npm (v10.0.0 or higher)

Installation

  1. Clone the repository:

    git clone https://github.com/erdcpatel/type-flow.git
    cd type-flow
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev
  4. Open your browser: Navigate to http://localhost:5173

Building for Production

npm run build

The production-ready files will be in the dist/ directory.

๐Ÿงช Testing

TypeFlow uses Vitest for testing with jsdom environment and fake-indexeddb for IndexedDB polyfills.

Running Tests

# Run tests in watch mode
npm run test

# Run tests once (CI mode)
npm run test:ci

# Run linter
npm run lint

Test Setup

Tests use fake-indexeddb for IndexedDB polyfills. Setup file: src/test/setupTests.cjs

๐ŸŒ Browser Compatibility

TypeFlow works on all modern browsers:

  • โœ… Chrome 90+ (recommended)
  • โœ… Firefox 88+
  • โœ… Safari 14+
  • โœ… Edge 90+

Requirements:

  • ES6+ JavaScript support
  • IndexedDB support
  • CSS Grid and Flexbox

๐Ÿš€ Deployment

GitHub Pages (Current)

npm run deploy

This builds and deploys to GitHub Pages using gh-pages.

Other Platforms

Vercel:

  • Connect your GitHub repository
  • Vercel will auto-detect Vite and deploy

Netlify:

  • Drag and drop the dist/ folder, or
  • Connect repository with build command: npm run build

Cloudflare Pages:

  • Connect repository
  • Build command: npm run build
  • Output directory: dist

Build Configuration:

  • Build command: npm run build
  • Output directory: dist
  • Node version: 20.19.0+

โš™๏ธ Environment Variables

TypeFlow requires no environment variables. The application is 100% client-side with no server dependencies or API keys needed.

๐Ÿ“ Project Structure

type-flow/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/          # React components
โ”‚   โ”‚   โ”œโ”€โ”€ TypingArea.jsx   # Main typing interface
โ”‚   โ”‚   โ”œโ”€โ”€ StatsModal.jsx   # Statistics and analytics
โ”‚   โ”‚   โ”œโ”€โ”€ ResultCard.jsx   # Test completion results
โ”‚   โ”‚   โ””โ”€โ”€ LessonSelector.jsx
โ”‚   โ”œโ”€โ”€ hooks/               # Custom React hooks
โ”‚   โ”‚   โ””โ”€โ”€ useTypingGame.js # Core typing game logic
โ”‚   โ”œโ”€โ”€ utils/               # Utility functions
โ”‚   โ”‚   โ”œโ”€โ”€ db.js           # IndexedDB wrapper
โ”‚   โ”‚   โ”œโ”€โ”€ storage.js      # Storage operations
โ”‚   โ”‚   โ”œโ”€โ”€ generator.js    # Text generation
โ”‚   โ”‚   โ”œโ”€โ”€ lessons.js      # Lesson definitions
โ”‚   โ”‚   โ””โ”€โ”€ texts.js        # Practice texts
โ”‚   โ”œโ”€โ”€ App.jsx             # Main application
โ”‚   โ””โ”€โ”€ main.jsx            # Entry point
โ”œโ”€โ”€ public/                  # Static assets
โ”œโ”€โ”€ docs/                    # Additional documentation
โ””โ”€โ”€ package.json

๐Ÿ’พ Data Storage

TypeFlow uses IndexedDB for permanent local storage:

  • Database: TypeFlowDB
  • Object Stores:
    • history - All typing test results with timestamps
    • replays - Best performance replays for ghost mode

Data Persistence

  • Data survives browser restarts and cache cleanup
  • Automatic migration from old localStorage data
  • Local timezone support for accurate date tracking
  • Reset functionality available in stats modal

๐ŸŽ“ How to Use

  1. Choose a Mode: Practice, Lesson, or Custom
  2. Start Typing: Click the input area and begin
  3. View Stats: Click "view detailed stats" to see your progress
  4. Track Progress: Check your daily streak and improvement over time
  5. Practice Weak Keys: Use the smart drill feature to target problem areas

๐Ÿค Contributing

We welcome contributions! Please see our CONTRIBUTING.md for details on:

  • Code style guidelines
  • Development workflow
  • How to submit pull requests
  • Project architecture

๐Ÿ“š Additional Documentation

๐Ÿ› Troubleshooting

Data Not Persisting

  • Ensure your browser supports IndexedDB
  • Check browser console for errors
  • Try resetting stats and starting fresh

Performance Issues

  • Clear browser cache
  • Disable browser extensions
  • Check for console errors

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

Built with modern web technologies and best practices for an optimal typing training experience.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published