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
Markdown
# 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. πΈπ΄