For simple contributions like adding languages, quotes, or themes, check out the Basic Contributions guide.
Before You Start
Make sure you’ve completed the Getting Started guide to set up your development environment.Technology Stack
Monkeytype is built with:- Frontend: TypeScript, HTML, CSS
- Backend: Node.js
- Database: MongoDB (user data)
- Cache: Redis (leaderboards, jobs, OAuth state)
- Authentication: Firebase
- Code Quality: Oxc (Oxfmt and Oxlint)
Development Workflow
1. Fork and Clone
Fork the Repository
Click the Fork button on the Monkeytype repository.
2. Make Your Changes
Write Your Code
Make your changes in the
src/ directory. The project structure is organized as:frontend/- Frontend application codebackend/- Backend API and server codepackages/- Shared packages and utilities
Test Your Changes
View your changes at:
- Frontend: http://localhost:3000
- Backend: http://localhost:5005
Rebuilding after changes may take a moment depending on your machine’s performance. Be patient while the development server recompiles.
3. Code Quality
Monkeytype enforces code quality through automated tools.Linting
Formatting
Pre-commit Hooks
Oxc automatically runs on every commit to format and lint your code. If there are issues, the commit will be blocked until they’re resolved.4. Testing
Run tests to ensure your changes don’t break existing functionality.5. Building
Before submitting, verify your code builds successfully.6. Asset Validation
If you’ve modified languages, quotes, or themes, validate the JSON assets.Working with Docker
Docker provides a consistent development environment across different operating systems.Database Only
Full Backend
Full Frontend
Firebase Development
If you’re working on authentication or user account features:Initial Setup
- Create a Firebase project in the Firebase Console
- Enable Email/Password and Google authentication
- Configure
frontend/src/ts/constants/firebase-config.tswith your project credentials
Backend Firebase Setup
For backend development:- Go to Project Settings > Service Accounts in Firebase Console
- Click “Generate New Private Key”
- Save as
backend/src/credentials/serviceAccountKey.json
Database Management
MongoDB
Connect to your local MongoDB instance:Redis
Redis runs on the default port6379 and stores:
- Daily leaderboards
- Background job queues (via BullMQ)
- OAuth state parameters
Common Development Tasks
Adding a New Feature
Plan Your Feature
- Discuss the feature in the
#developmentDiscord channel - Check if an issue exists or create one
- Get feedback from maintainers
Implement
- Create a feature branch
- Write code following existing patterns
- Add tests for new functionality
- Update documentation if needed
Test Thoroughly
- Test manually in your browser
- Run automated tests
- Test edge cases
- Verify different configurations
Fixing a Bug
Reproduce the Bug
- Verify the bug exists in the latest code
- Document steps to reproduce
- Identify the root cause
TypeScript Tips
Monkeytype is written in TypeScript. Keep these tips in mind:- Use strict type checking
- Avoid
anytypes when possible - Define interfaces for complex objects
- Use enums for fixed sets of values
- Leverage type inference
Type Checking
Submitting Your Changes
Once your changes are ready:Commit Your Changes
Pull Request Guidelines
- Follow the PR naming conventions
- Provide a clear description of changes
- Include screenshots for visual changes
- Link to related issues
- Ensure all checks pass
- Respond to review feedback promptly
Code Review Process
- Automated checks run on your PR (linting, tests, build)
- Maintainers review your code
- You may need to make changes based on feedback
- Once approved, a maintainer will merge your PR
Troubleshooting
Build Errors
- Clear node_modules and reinstall:
rm -rf node_modules && pnpm i - Check Node.js version:
node --version(should be 24.11.0) - Verify pnpm version:
pnpm --version(should be 10.28.1)
Development Server Issues
- Kill any processes using port 3000 or 5005
- Clear browser cache and cookies
- Try running with
sudoon UNIX systems if you get spawn errors
Database Connection Issues
- Verify MongoDB and Redis are running
- Check connection strings in
.envfiles - Restart database services
Firebase Errors
- Verify Firebase configuration in
firebase-config.ts - Check authentication methods are enabled in Firebase Console
- Ensure service account key is in the correct location
Getting Help
If you’re stuck:- Join the
#developmentchannel on Discord - Search GitHub Issues
- Ask on GitHub Discussions
- Contact maintainers: Miodec on GitHub
Next Steps
- Review Contribution Guidelines
- Check out good first issues
- Join the contributor community on Discord