Merge reading and typing practice into one productive habit. Upload PDFs, type real passages, and track your progress in real-time.
Clone & Setup:
git clone https://github.com/mnurak/ReType.git
cd TypingDocker Dev:
make dev-build-upDocker Prod:
make prod-build-upManual:
# Backend
cd typing-backend
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload
# Frontend (new terminal)
cd typing-ui
npm install
npm run devAccess:
- App:
http://localhost:5173 - API:
http://localhost:8000 - Docs:
http://localhost:8000/docs
- Upload PDF documents
- Store documents in cloud
- Multi-page support
- Delete documents anytime
- Real-time metrics (WPM, accuracy)
- Multi-page typing sessions
- Error tracking
- Performance consistency measurement
- Live progress feedback
- Signup/login with JWT auth
- Secure password storage (Bcrypt)
- Session persistence
- HTTP-only cookies
- Cloud document storage
- Local PDF caching (IndexedDB)
- Offline access to cached PDFs
- Automatic backend sync
- Framework: FastAPI
- Database: PostgreSQL
- Auth: JWT + Bcrypt
- PDF: PyMuPDF (text extraction)
- Server: Gunicorn (prod), Uvicorn (dev)
- Framework: React 19
- Build: Vite
- Styling: Tailwind CSS
- State: Context API
- Storage: IndexedDB
- Server: Nginx (prod)
Frontend (React) Backend (FastAPI)
├── Pages ├── Routers
├── Components ├── Services
├── Context (State) ├── Database (SQLAlchemy)
└── Utils └── Dependencies (Auth)
↓ ↓
Nginx (prod) PostgreSQL
Vite (dev) Gunicorn/Uvicorn
Typing/
├── typing-backend/ # FastAPI service
│ ├── app/
│ │ ├── routers/ # API endpoints
│ │ ├── services/ # Business logic
│ │ ├── database/ # Models & connections
│ │ └── dependencies/# JWT middleware
│ ├── requirements.txt
│ └── dockerfile
│
├── typing-ui/ # React application
│ ├── src/
│ │ ├── pages/ # Route components
│ │ ├── components/ # Reusable UI
│ │ ├── context/ # State management
│ │ └── utils/ # Helpers
│ ├── package.json
│ └── dockerfile
│
├── docker-compose.dev.yml
├── docker-compose.prod.yml
├── Makefile # Build shortcuts
└── README.md
POST /signup- RegisterPOST /signin- LoginDELETE /signout- Logout
POST /add- Upload PDFGET /getList- List documentsGET /get/{filename}- DownloadDELETE /delete/{filename}- Delete
POST /extract- Extract text
GET /health- Status
Users: id, email, hashed_password
Documents: user_id, filename, create_time
One-to-many relationship with user isolation.
Development:
make dev-build-up # Build & start with volumes
make dev-up # Start existing containers
make dev-down # Stop containers
make dev-logs # View logsProduction:
make prod-build-up # Build & start optimized
make prod-up # Start containers
make prod-down # Stop containers
make prod-logs # View logsOr use docker-compose directly:
docker-compose -f docker-compose.dev.yml up
docker-compose -f docker-compose.prod.yml up -dBackend .env:
SQLALCHEMY_DATABASE_URL=postgresql://postgres:postgres@db:5432/typing
SECRET_KEY=your-secret-key
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=120Frontend .env:
VITE_API_URL=http://localhost:8000Backend: Single dockerfile supports dev & prod
dev: Uvicorn with hot-reloadprod: Gunicorn with worker processes
Frontend: Single dockerfile supports dev & prod
dev: Vite with HMRprod: Static build served by Nginx
- JWT token authentication
- Bcrypt password hashing
- HTTPOnly cookies
- CORS middleware
- User data isolation
- Non-root production users
- Backend changes: Auto-reload via volumes
- Frontend changes: Hot reload via Vite
- Database: Persistent PostgreSQL volume
- API testing: Swagger at
/docs
- Database connection pooling (SQLAlchemy)
- Static asset optimization (Vite)
- Code splitting and lazy loading
- Multi-worker support in production
- IndexedDB for offline caching
- Follow existing code structure
- Use type hints (Python/TypeScript)
- Test changes locally before pushing
- Update relevant documentation
Port in use: Kill process or change port mapping
DB connection fails: Check PostgreSQL is running
API not responding: Check backend logs with make dev-logs
Frontend blank: Clear browser cache, rebuild
See individual READMEs in typing-backend and typing-ui for detailed setup.
Version: 1.0.0
Node: 22.15+
Python: 3.12+
PostgreSQL: 16+
cd typing-ui
npm install
npm run dev # Start dev server
npm run lint # Check code quality
npm run build # Production build
npm run preview # Preview prod buildcd typing-backend
source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload# Access database in development
docker-compose -f docker-compose.dev.yml exec db psql -U postgres -d typing
# View logs
make dev-logs- ✅ HTTPS configuration (use reverse proxy like Traefik)
- ✅ Environment variables for secrets
- ✅ CORS properly configured for your domain
- ✅ Database backups configured
- ✅ Non-root users in containers
- ✅ Regular dependency updates
- ✅ Database connection pooling
- ✅ Caching strategies
- ✅ CDN for static assets
- ✅ Worker process scaling
- ✅ Database indexing
- ✅ Container health checks enabled
- ✅ Log aggregation setup
- ✅ Error tracking (Sentry, etc.)
- ✅ Performance monitoring
Frontend cannot connect to backend
- Ensure backend is running:
docker-compose logs backend - Check proxy configuration in
vite.config.ts - Verify Docker network connectivity
Database connection errors
- Check PostgreSQL is healthy:
docker-compose ps - Verify environment variables in
.env - Check database credentials
File upload fails
- Verify file size < 10MB
- Check
files_datavolume has permissions - Ensure backend is running and healthy
PDF extraction issues
- Check PDF file is valid
- Verify PyMuPDF is installed in backend
- Check backend logs for details
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code style
- Write meaningful commit messages
- Update documentation for new features
- Test changes before submitting PR
- Advanced typing metrics and analytics
- User leaderboard and achievements
- Social features (challenges, sharing)
- Multi-language support
- Mobile app (React Native)
- Browser extension
- API for third-party integrations
- AI-powered personalized practice suggestions
- Documentation: See individual Backend README and Frontend README
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: karun.m.2005-Retype@gmail.com
- Built with FastAPI and React
- PDF processing powered by PyMuPDF and PDF.js
- Styling with Tailwind CSS
- Deployment with Docker
Version: 1.0.0
Last Updated: January 2026
Maintainers: [Karun M]