UNPKG

somali-exchange-rates

Version:

πŸ‡ΈπŸ‡΄ Comprehensive Somali Exchange Rates platform with real-time rates, transfer fees, alerts, multi-language support, and advanced financial tools

310 lines (232 loc) β€’ 7.21 kB
# Contributing to Somali Exchange Rates Thank you for your interest in contributing to the Somali Exchange Rates project! This document provides guidelines and information for contributors. ## 🌟 Ways to Contribute - πŸ› **Bug Reports**: Report issues you encounter - πŸ’‘ **Feature Requests**: Suggest new features or improvements - πŸ”§ **Code Contributions**: Submit bug fixes or new features - πŸ“š **Documentation**: Improve documentation and examples - 🌍 **Localization**: Help with translations (Somali, Arabic, other languages) - πŸ§ͺ **Testing**: Help test new features and report issues ## πŸš€ Getting Started ### Prerequisites - Node.js 18.x or higher - npm or yarn package manager - Git ### Development Setup 1. **Fork and Clone** ```bash git clone https://github.com/your-username/somali-exchange-rates.git cd somali-exchange-rates ``` 2. **Install Dependencies** ```bash npm install ``` 3. **Set up Environment** ```bash cp .env.example .env # Edit .env with your configuration ``` 4. **Build the Project** ```bash npm run build ``` 5. **Run Tests** ```bash npm test ``` 6. **Test CLI Commands** ```bash node dist/cli.js rates node dist/cli.js quote USD SOS 100 ``` ## πŸ—οΈ Project Structure ``` src/ β”œβ”€β”€ __tests__/ # Test files β”œβ”€β”€ providers/ # Exchange rate providers β”œβ”€β”€ data/ # Seed data and configurations β”œβ”€β”€ alerts.ts # Alert management β”œβ”€β”€ analysis.ts # Market analysis β”œβ”€β”€ cache.ts # Caching system β”œβ”€β”€ cli.ts # CLI interface β”œβ”€β”€ config.ts # Configuration management β”œβ”€β”€ export.ts # Export functionality β”œβ”€β”€ historical.ts # Historical data β”œβ”€β”€ index.ts # Main API β”œβ”€β”€ localization.ts # Multi-language support β”œβ”€β”€ realtime.ts # WebSocket streaming β”œβ”€β”€ transfer-fees.ts # Transfer fee calculator β”œβ”€β”€ tui.ts # Terminal UI β”œβ”€β”€ types.ts # TypeScript definitions └── utils.ts # Utility functions ``` ## πŸ“ Development Guidelines ### Code Style - Use TypeScript for all new code - Follow existing code formatting and style - Use meaningful variable and function names - Add JSDoc comments for public APIs - Keep functions focused and small ### Commit Messages Use conventional commit format: ``` type(scope): description feat(cli): add new export command fix(alerts): resolve email notification issue docs(readme): update installation instructions test(providers): add tests for fixer provider ``` Types: `feat`, `fix`, `docs`, `test`, `refactor`, `style`, `chore` ### Testing - Write tests for all new features - Maintain or improve test coverage - Test both success and error scenarios - Include integration tests for CLI commands ```bash # Run all tests npm test # Run tests with coverage npm run test:coverage # Run specific test file npm test src/__tests__/alerts.test.ts ``` ### Documentation - Update README.md for new features - Add JSDoc comments for new functions - Update CLI help text - Include examples in documentation ## 🌍 Localization Contributions We welcome translations and localization improvements: ### Adding New Languages 1. Add language code to `src/types.ts`: ```typescript export type Language = "en" | "so" | "ar" | "sw"; // Add Swahili ``` 2. Add translations to `src/localization.ts`: ```typescript 'currency.USD': { en: 'US Dollar', so: 'Doolar Maraykan', ar: 'Ψ―ΩˆΩ„Ψ§Ψ± Ψ£Ω…Ψ±ΩŠΩƒΩŠ', sw: 'Dola ya Marekani' // Add Swahili } ``` 3. Test the new language: ```bash node dist/cli.js config language sw node dist/cli.js quote USD SOS 100 ``` ### Improving Existing Translations - Review translations in `src/localization.ts` - Ensure cultural appropriateness - Test formatting with the new translations ## πŸ”§ Adding New Features ### Exchange Rate Providers 1. Create provider class in `src/providers/`: ```typescript export class NewProvider implements Provider { name = "new-provider"; priority = 4; async fetchRatesSOS(): Promise<RateTable> { // Implementation } } ``` 2. Add to provider manager 3. Add tests 4. Update documentation ### CLI Commands 1. Add command handler in `src/cli.ts` 2. Update help text 3. Add tests 4. Update README ### Transfer Providers 1. Add fee structure to `src/transfer-fees.ts` 2. Test calculations 3. Update provider list in CLI help ## πŸ§ͺ Testing Guidelines ### Unit Tests - Test individual functions and classes - Mock external dependencies - Test error conditions - Use descriptive test names ### Integration Tests - Test CLI commands end-to-end - Test provider integrations - Test configuration scenarios ### Manual Testing Before submitting: ```bash # Test basic functionality npm run build node dist/cli.js rates node dist/cli.js quote USD SOS 100 # Test new features node dist/cli.js your-new-command # Test error handling node dist/cli.js invalid-command ``` ## πŸ“‹ Pull Request Process 1. **Create Feature Branch** ```bash git checkout -b feature/your-feature-name ``` 2. **Make Changes** - Write code following guidelines - Add tests - Update documentation 3. **Test Thoroughly** ```bash npm test npm run build # Manual testing ``` 4. **Commit Changes** ```bash git add . git commit -m "feat(scope): description" ``` 5. **Push and Create PR** ```bash git push origin feature/your-feature-name ``` 6. **Fill PR Template** - Describe changes - Link related issues - Add testing notes ## πŸ› Bug Reports When reporting bugs, include: - **Environment**: OS, Node.js version, package version - **Command**: Exact command that failed - **Expected vs Actual**: What should happen vs what happened - **Logs**: Error messages and stack traces - **Configuration**: Relevant settings ## πŸ’‘ Feature Requests For feature requests, provide: - **Use Case**: Who needs this and why - **Description**: Clear explanation of the feature - **Examples**: How it would work - **Priority**: How important it is ## 🏷️ Issue Labels - `bug`: Something isn't working - `enhancement`: New feature or request - `documentation`: Improvements to docs - `good first issue`: Good for newcomers - `help wanted`: Extra attention needed - `localization`: Translation related - `provider`: Exchange rate provider related - `cli`: Command line interface related ## πŸ“ž Getting Help - **GitHub Issues**: For bugs and feature requests - **Discussions**: For questions and general discussion - **Email**: For security issues or private matters ## πŸŽ‰ Recognition Contributors will be: - Listed in CONTRIBUTORS.md - Mentioned in release notes - Credited in documentation ## πŸ“„ License By contributing, you agree that your contributions will be licensed under the same license as the project (MIT License). --- Thank you for contributing to the Somali Exchange Rates project! Your contributions help make financial tools more accessible to the Somali community worldwide. πŸ‡ΈπŸ‡΄