Thank you for your interest in contributing to OpenCare-Africa! We welcome contributions from developers, healthcare professionals, and anyone passionate about improving healthcare systems in Africa.
- Code of Conduct
- How Can I Contribute?
- Getting Started
- Development Workflow
- Code Standards
- Testing
- Documentation
- Security
- Questions or Need Help?
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to conduct@opencare-africa.org.
- Use the GitHub issue tracker
- Include detailed steps to reproduce the bug
- Provide environment information (OS, Python version, Django version)
- Include error logs and screenshots if applicable
- Use the GitHub issue tracker with the "enhancement" label
- Describe the problem and proposed solution
- Consider the impact on existing functionality
- Think about backward compatibility
- Bug fixes
- New features
- Performance improvements
- Documentation updates
- Test coverage improvements
- Python 3.8+
- Git
- PostgreSQL (for production-like development)
- Redis (for caching and Celery)
-
Fork and Clone the Repository
git clone https://github.com/your-username/OpenCare-Africa.git cd OpenCare-Africa -
Create Virtual Environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install Dependencies
pip install -r requirements-dev.txt
-
Environment Configuration
cp .env.example .env # Edit .env with your local settings -
Database Setup
python manage.py migrate python manage.py createsuperuser
-
Run Development Server
python manage.py runserver
git checkout -b feature/amazing-feature
# or
git checkout -b fix/bug-description- Write clean, readable code
- Follow the coding standards below
- Add tests for new functionality
- Update documentation as needed
Use conventional commit format:
git commit -m "feat: add patient search functionality"
git commit -m "fix: resolve authentication issue in API"
git commit -m "docs: update API documentation"
git commit -m "test: add unit tests for patient model"Commit Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
git push origin feature/amazing-featureThen create a Pull Request on GitHub with:
- Clear description of changes
- Link to related issues
- Screenshots for UI changes
- Test results
- Follow PEP 8 style guide
- Use meaningful variable and function names
- Write docstrings for all functions and classes
- Keep functions small and focused
- Use type hints where appropriate
- Use Django ORM efficiently
- Implement proper model relationships
- Use Django forms and serializers
- Follow Django security best practices
- Implement proper error handling
We use several tools to maintain code quality:
# Format code with Black
black .
# Sort imports with isort
isort .
# Check code style with flake8
flake8 .
# Run security checks with bandit
bandit -r .
# Run tests with coverage
coverage run --source='.' manage.py test
coverage report# Run all tests
python manage.py test
# Run specific app tests
python manage.py test apps.patients
# Run with coverage
coverage run --source='.' manage.py test
coverage report
coverage html # Generate HTML report- Write tests for all new functionality
- Aim for at least 80% code coverage
- Use descriptive test names
- Test both success and failure cases
- Use factories for test data (factory-boy)
class PatientModelTest(TestCase):
def setUp(self):
"""Set up test data."""
self.patient = PatientFactory()
def test_patient_creation(self):
"""Test that patient can be created."""
self.assertIsNotNone(self.patient)
self.assertEqual(self.patient.first_name, "John")
def test_patient_full_name(self):
"""Test patient full name method."""
expected = f"{self.patient.first_name} {self.patient.last_name}"
self.assertEqual(self.patient.get_full_name(), expected)- Write clear docstrings for all functions and classes
- Use Google or NumPy docstring format
- Include examples for complex functions
- Document parameters, return values, and exceptions
- Update API documentation when endpoints change
- Include request/response examples
- Document authentication requirements
- Provide clear error messages
- Update README.md for major changes
- Maintain setup and deployment guides
- Document configuration options
- Provide troubleshooting guides
- Never commit sensitive information (API keys, passwords)
- Use environment variables for configuration
- Implement proper authentication and authorization
- Validate all user inputs
- Use HTTPS in production
- Follow OWASP security guidelines
If you discover a security vulnerability, please:
- DO NOT create a public GitHub issue
- Email security@opencare-africa.org
- Include detailed information about the vulnerability
- Allow time for the security team to respond
- Check existing documentation
- Search existing issues and discussions
- Join our community discussions
- Contact the development team
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and general discussion
- Email: support@opencare-africa.org
- Community Forum: forum.opencare-africa.org
New contributors are welcome! We offer:
- Code review and feedback
- Pair programming sessions
- Mentorship from experienced contributors
- Regular office hours for questions
Contributors will be recognized in:
- Project README
- Release notes
- Contributor hall of fame
- Annual contributor acknowledgments
Your contributions help make healthcare better for millions of people across Africa. Every line of code, bug report, or documentation improvement makes a difference.
Together, we can build a healthier future for Africa! 🩺🌍