Developer Typing Trainer
A lightweight, widget-first typing practice application for developers to master technical terms and code snippets during build times and idle moments.
- π― Widget-First Design: Works perfectly even in ultra-compact windows (150px height)
- π Custom Word Management: Add your own technical terms, code snippets, or any Japanese text
- π€ Auto-Processing: Automatic hiragana and romaji generation using
wanakana - β±οΈ Time Attack Mode: Survival-style typing with adaptive time limits
- π Weakness Tracking: Focus on words you struggle with using SRS (Spaced Repetition System)
- π Analytics: Real-time WPM, accuracy, and detailed keystroke statistics
- π i18n Support: English and Japanese interface
- πΎ Local-First: All data stored in browser IndexedDB - no server, no login required
- β¨οΈ Keyboard Shortcuts: Full keyboard navigation for power users
- Node.js 18+ (or Bun)
- npm, yarn, pnpm, or bun
# Clone the repository
git clone https://github.com/otomatty/typeflow.git
cd typeflow
# Install dependencies
npm install
# or
bun install
# Start development server
npm run dev
# or
bun devOpen http://localhost:5173 in your browser.
To start both frontend and backend together:
bun run dev:allThis will start:
- Frontend: React app on http://localhost:5173
- Backend: Hono API server on http://localhost:3456
Press Ctrl+C to stop all services.
If you want to enable cloud sync across devices, you'll need to set up the backend server with Turso database.
Use a local SQLite file for development. This is the easiest way to get started:
-
Quick setup (recommended):
bun run db:setup
This will create
.envfile and run migrations automatically. -
Manual setup:
# Create .env file (copy from example) # Note: .env.example has local DB as default cp .env.example .env # Run migrations bun run db:migrate:local
-
Start the server:
bun run server:dev
The server will automatically use the local database (./local.db) if TURSO_DATABASE_URL is not set.
-
Install Turso CLI:
curl -sSfL https://get.tur.so/install.sh | bash -
Create Turso database:
turso db create typeflow-db
-
Set up environment variables:
cp .env.example .env # Edit .env with your Turso credentials -
Run migrations:
bun run db:migrate
-
Start the server:
bun run server:dev
For detailed setup instructions:
- Local development: docs/LOCAL_DEVELOPMENT.md
- Turso cloud: docs/TURSO_SETUP.md
This project is designed to be deployed on Cloudflare:
- Frontend: Cloudflare Pages
- Backend: Cloudflare Workers
- Database: Turso (libSQL/SQLite)
- Cloudflare account: Sign up at Cloudflare
- Wrangler CLI: Install globally
npm install -g wrangler # or bun add -g wrangler - Login to Cloudflare:
wrangler login
-
Set up environment variables in
wrangler.toml:[env.production.vars] TURSO_DATABASE_URL = "libsql://your-database.turso.io" TURSO_AUTH_TOKEN = "your-auth-token" ALLOWED_ORIGINS = "https://your-app.pages.dev"
-
Deploy:
wrangler deploy
-
Copy the Worker URL (e.g.,
https://typeflow-api.your-subdomain.workers.dev)
-
Connect your GitHub repository to Cloudflare Pages:
- Go to Cloudflare Dashboard β Pages
- Click "Create a project" β "Connect to Git"
- Select your repository
-
Configure build settings:
- Build command:
bun run build - Build output directory:
dist - Root directory:
/(project root)
- Build command:
-
Set environment variables:
VITE_API_BASE_URL: Your Cloudflare Workers URL (e.g.,https://typeflow-api.your-subdomain.workers.dev/api)
-
Deploy: Cloudflare Pages will automatically deploy on every push to your main branch
You can also deploy manually using Wrangler:
# Build the frontend
bun run build
# Deploy to Cloudflare Pages
wrangler pages deploy dist --project-name=typeflow- Development: Use local SQLite file (
./local.db) - no setup required - Production: Use Turso cloud database for multi-device sync
For more details, see:
- docs/TURSO_SETUP.md - Turso database setup
- docs/LOCAL_DEVELOPMENT.md - Local development guide
npm run build
# or
bun run buildThe built files will be in the dist directory.
- Add Words: Click "Words" in the header or press
Cmd+K(Mac) /Ctrl+K(Windows/Linux) to add new words - Start Game: Press
SpaceorEnteron the menu screen to begin - Type: Type the romaji for the displayed Japanese text. Correct answers restore time!
- Review: After game over, press
Rto retry weak words, orEnterto restart
Space/Enter: Start game (menu screen)Esc: Exit game / Return to menuR: Retry weak words (game over screen)Cmd+K/Ctrl+K: Open add word dialogEnter: Confirm dialogsEsc: Close dialogs
- Framework: React 19 + Vite
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: Radix UI
- Animations: Framer Motion
- Japanese Processing: wanakana
- Storage: @github/spark (useKV) for IndexedDB
- Backend: Cloudflare Workers + Hono
- Database: Turso (libSQL/SQLite)
- Deployment: Cloudflare Pages (Frontend) + Cloudflare Workers (Backend)
- i18n: i18next
typeflow/
βββ src/
β βββ components/ # React components
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utilities and types
β βββ i18n/ # Internationalization
β βββ styles/ # Global styles
βββ docs/ # Documentation
βββ public/ # Static assets
βββ dist/ # Build output
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests (if available):
npm test - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
See LICENSE for details.
Important: If you modify this software and make it available as a web service, you must provide the source code under the same license.
If you discover a security vulnerability, please send an email to the maintainer. See SECURITY.md for details.
- wanakana for Japanese text processing
- Radix UI for accessible UI components
- Framer Motion for smooth animations
- Repository: otomatty/typeflow
- Issues: GitHub Issues
Made with β€οΈ for developers who want to type faster