Thank you for your interest in contributing! This document provides guidelines and instructions for contributing to the project.
- Report bugs via GitHub Issues
- Suggest features or enhancements
- Improve documentation
- Submit pull requests with bug fixes or new features
- Review pull requests from other contributors
- Help answer questions in Discussions
# Fork the repository on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/mobile-money.git
cd mobile-money
# Add upstream remote
git remote add upstream https://github.com/sublime247/mobile-money.git# Install dependencies
npm install
# Copy environment file
cp .env.example .env
# Set up database
npm run migrate:up
# Run tests to verify setup
npm test# Update your fork
git checkout main
git pull upstream main
# Create a feature branch
git checkout -b feature/your-feature-nameWe use ESLint and Prettier for code formatting:
# Check linting
npm run lint
# Format code
npm run format
# Type check
npm run type-checkFollow conventional commits format:
type(scope): subject
body (optional)
footer (optional)
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(transactions): add support for Orange Money
fix(auth): resolve JWT expiration issue
docs(readme): update installation instructions
test(kyc): add unit tests for document validation
All contributions must include tests:
# Run all tests
npm test
# Run specific test file
npm test -- path/to/test.ts
# Run with coverage
npm run test:coverageTest Coverage Requirements:
- Minimum 70% coverage for all metrics
- New features must have >80% coverage
- Bug fixes must include regression tests
Before submitting a PR, ensure:
- Code follows project style guidelines
- All tests pass
- New tests added for new features
- Documentation updated
- No console.log statements (use proper logging)
- No commented-out code
- TypeScript types are properly defined
- Error handling is implemented
- Security considerations addressed
- Check existing issues to avoid duplicates
- Verify the bug exists in the latest version
- Collect relevant information
**Describe the bug**
A clear description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '...'
3. See error
**Expected behavior**
What you expected to happen.
**Actual behavior**
What actually happened.
**Environment:**
- OS: [e.g., Ubuntu 22.04]
- Node.js version: [e.g., 20.10.0]
- PostgreSQL version: [e.g., 16.1]
- Redis version: [e.g., 7.2]
**Additional context**
- Error messages
- Logs
- Screenshots**Is your feature request related to a problem?**
A clear description of the problem.
**Describe the solution you'd like**
A clear description of what you want to happen.
**Describe alternatives you've considered**
Alternative solutions or features you've considered.
**Additional context**
Any other context, mockups, or examples.
**Implementation ideas**
If you have ideas on how to implement this.# Make your changes
# Add tests
# Update documentation
# Run quality checks
npm run lint
npm run type-check
npm testgit add .
git commit -m "feat(scope): description"git push origin feature/your-feature-name- Go to the original repository on GitHub
- Click "New Pull Request"
- Select your fork and branch
- Fill out the PR template
- Submit the PR
## Description
Brief description of changes.
## Type of Change
- [ ] Bug fix (non-breaking change fixing an issue)
- [ ] New feature (non-breaking change adding functionality)
- [ ] Breaking change (fix or feature causing existing functionality to change)
- [ ] Documentation update
## Related Issue
Fixes #(issue number)
## How Has This Been Tested?
Describe the tests you ran.
## Checklist
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review
- [ ] I have commented my code where necessary
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] New and existing tests pass locally
- [ ] Any dependent changes have been merged
## Screenshots (if applicable)
Add screenshots to help explain your changes.- Respond to feedback promptly
- Make requested changes
- Push updates to the same branch
- Request re-review when ready
Once approved:
- Maintainers will merge your PR
- Your branch will be deleted
- Changes will be included in the next release
good first issue: Good for newcomershelp wanted: Extra attention neededbug: Something isn't workingenhancement: New feature or requestdocumentation: Documentation improvementsquestion: Further information requestedwontfix: This will not be worked onduplicate: This issue already existsinvalid: This doesn't seem right
New to the project? Look for issues labeled good first issue:
Examples:
- Add input validation
- Improve error messages
- Add unit tests
- Update documentation
- Fix typos
- Add logging
DO NOT open public issues for security vulnerabilities.
Instead, email [email protected] with:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
We'll respond within 48 hours.
- Code Comments: Explain complex logic
- API Documentation: Document all endpoints
- README: Keep up-to-date
- Architecture Docs: Explain system design
- Migration Guides: For breaking changes
- Use clear, concise language
- Include code examples
- Add diagrams where helpful
- Keep it up-to-date
describe('Feature Name', () => {
describe('Method/Function Name', () => {
it('should do something specific', () => {
// Arrange
const input = 'test';
// Act
const result = functionUnderTest(input);
// Assert
expect(result).toBe('expected');
});
});
});- Unit Tests: Test individual functions/methods
- Integration Tests: Test component interactions
- E2E Tests: Test complete user flows
- Load Tests: Test performance under load
- Mock external services (APIs, databases)
- Use Jest mocks for dependencies
- Keep mocks simple and focused
When adding user-facing text:
// Use i18n
import { t } from '../utils/i18n';
const message = t('errors.transaction.insufficient_funds');Add translations to src/locales/.
- Avoid N+1 queries
- Use database indexes
- Implement caching where appropriate
- Profile before optimizing
- Document performance-critical code
- Never commit secrets or API keys
- Validate all user input
- Use parameterized queries
- Implement rate limiting
- Follow OWASP guidelines
- Use security headers (Helmet)
# Production dependency
npm install package-name
# Development dependency
npm install --save-dev package-nameGuidelines:
- Justify new dependencies
- Check for security vulnerabilities
- Prefer well-maintained packages
- Consider bundle size impact
# Check for updates
npm outdated
# Update specific package
npm update package-name
# Update all packages
npm updateWhen adding user-facing features:
- Follow existing patterns
- Ensure accessibility (WCAG 2.1 AA)
- Test on multiple devices
- Provide clear error messages
- Include loading states
- Handle edge cases
Maintainers handle releases:
- Update version in
package.json - Update CHANGELOG.md
- Create release tag
- Publish to npm (if applicable)
- Deploy to production
- GitHub Issues: Bug reports, feature requests
- GitHub Discussions: Questions, ideas, general discussion
- Pull Requests: Code review, implementation discussion
- Email: Security issues, private matters
Contributors are recognized in:
- README.md contributors section
- Release notes
- GitHub contributors page
We pledge to make participation in our project a harassment-free experience for everyone.
Positive behavior:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards others
Unacceptable behavior:
- Trolling, insulting/derogatory comments
- Public or private harassment
- Publishing others' private information
- Other conduct which could reasonably be considered inappropriate
Violations may result in:
- Warning
- Temporary ban
- Permanent ban
Report violations to [email protected].
- Check existing documentation
- Search closed issues
- Ask in GitHub Discussions
- Email: [email protected]
Thank you for contributing to financial inclusion in Africa! 🌍