Thank you for your interest in contributing to NexaFi! This guide will help you get started.
- Code of Conduct
- Getting Started
- Development Workflow
- Code Standards
- Testing Requirements
- Pull Request Process
- Be respectful and professional
- Follow open source best practices
- Report security issues responsibly
- Help maintain a welcoming community
# Fork the repository on GitHub
# Then clone your fork
git clone https://github.com/quantsingularity/NexaFi.git
cd NexaFi# Install dependencies
pip install -r backend/requirements.txt
npm install
# Install pre-commit hooks
pre-commit installgit checkout -b feature/your-feature-name| Type | Example |
|---|---|
| Feature | feature/add-credit-scoring |
| Bug Fix | fix/payment-processing-error |
| Documentation | docs/update-api-reference |
| Performance | perf/optimize-db-queries |
| Refactor | refactor/simplify-auth-logic |
Follow Conventional Commits:
<type>(<scope>): <subject>
<body>
<footer>
Examples:
feat(payment): add multi-currency support
Implement support for 135+ currencies with real-time FX rates
Closes #123
fix(api): resolve rate limiting bug
Rate limiter was not correctly resetting window
Fixes #456
- Style: Follow PEP 8
- Formatter: Black (line length 100)
- Linter: autoflake, pylint
- Type Hints: Use type hints for all functions
Example:
def calculate_interest(principal: float, rate: float, time: int) -> float:
"""
Calculate simple interest.
Args:
principal: Principal amount
rate: Interest rate (as decimal)
time: Time period in years
Returns:
Calculated interest
"""
return principal * rate * time- Style: Airbnb JavaScript Style Guide
- Formatter: Prettier
- Linter: ESLint
- Type Safety: Use TypeScript
Example:
interface Transaction {
id: string;
amount: number;
currency: string;
}
export const processTransaction = async (
transaction: Transaction,
): Promise<boolean> => {
// Implementation
return true;
};- API: OpenAPI/Swagger for REST APIs
- Code: Docstrings for all public functions
- README: Update relevant READMEs
- Minimum Coverage: 80%
- Target Coverage: 90%+
- Critical Paths: 100%
| Type | Command | When |
|---|---|---|
| Unit Tests | pytest tests/unit |
Always |
| Integration Tests | pytest tests/integration |
API changes |
| E2E Tests | npm run test:e2e |
UI changes |
# Backend tests
cd backend
python test_suite.py
# Frontend tests
cd web-frontend
npm test
# All tests
./scripts/test_all.shExample unit test:
import pytest
from mymodule import calculate_interest
def test_calculate_interest():
"""Test interest calculation"""
result = calculate_interest(1000, 0.05, 2)
assert result == 100.0
def test_calculate_interest_zero_rate():
"""Test with zero interest rate"""
result = calculate_interest(1000, 0, 2)
assert result == 0.0- All tests pass
- Code is formatted
- Documentation is updated
- No linting errors
# Run checks
./scripts/lint_all.sh
./scripts/test_all.sh- Use descriptive title
- Reference related issues
- Provide detailed description
- Add screenshots if UI changes
PR Template:
## Description
Brief description of changes
## Related Issues
Closes #123
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
## Screenshots
(if applicable)- Address reviewer feedback
- Keep discussion professional
- Update PR as needed
- Squash commits if requested
- Ensure CI/CD passes
- Wait for maintainer approval
NexaFi/
├── backend/ # Python microservices
│ ├── api-gateway/ # Entry point
│ ├── *-service/ # Individual services
│ └── shared/ # Shared libraries
├── web-frontend/ # React web app
├── mobile-frontend/ # Flutter mobile app
├── ml/ # ML models
├── infrastructure/ # K8s, Terraform
├── tests/ # Test suites
├── scripts/ # Utility scripts
└── docs/ # Documentation
- New features added
- API changes
- Configuration changes
- Breaking changes
| File | Update When |
|---|---|
docs/API.md |
API endpoints change |
docs/CONFIGURATION.md |
New environment variables |
docs/INSTALLATION.md |
Setup steps change |
docs/EXAMPLES/ |
New features added |
# Update documentation
vim docs/API.md
# Test locally
# Preview in browser or markdown viewer
# Commit changes
git add docs/
git commit -m "docs: update API reference"# Format code
black backend/ --line-length 100
# Remove unused imports
autoflake --remove-all-unused-imports --recursive --in-place backend/
# Check style
pylint backend/# Format code
prettier --write "**/*.{js,ts,jsx,tsx,json,css,md}"
# Lint code
eslint . --ext .js,.jsx,.ts,.tsx- GitHub Discussions: For questions and ideas
- GitHub Issues: For bugs and feature requests
- Security: security@nexafi.com
By contributing, you agree that your contributions will be licensed under the MIT License.