A comprehensive health informatics platform backend built with Django, designed specifically for healthcare management in Africa.
OpenCare-Africa is a robust, scalable backend system for managing healthcare operations, patient records, health worker management, and facility operations. The system follows modern Django best practices and provides comprehensive API endpoints for seamless frontend integration.
- User Management: Role-based access and permissions for healthcare workers
- Patient Management: End-to-end patient lifecycle management with medical history
- Health Facility Management: Facility operations, services, and resources
- Health Records: Detailed medical records with FHIR compliance
- Analytics & Reporting: Disease tracking, performance metrics, and insights
- API-First Design: RESTful APIs with OpenAPI/Swagger documentation
- Django 4.2+: Modern Django implementation
- PostgreSQL: Reliable and scalable database
- Redis: Caching and session management
- Celery: Background task processing
- Docker: Containerized deployment
- JWT Authentication: Secure API access
- Health Checks: System monitoring and diagnostics
OpenCare-Africa/
βββ apps/
β βββ core/
β βββ patients/
β βββ health_workers/
β βββ facilities/
β βββ records/
β βββ analytics/
β βββ api/
βββ config/
β βββ settings/
β βββ urls.py
β βββ celery.py
βββ templates/
βββ static/
βββ media/
βββ docs/
βββ scripts/
- Docker & Docker Compose (recommended)
- Python 3.11+ (for local development)
- PostgreSQL 15+ (included in Docker)
- Redis 7+ (included in Docker)
This is the recommended way to run OpenCare-Africa, as it ensures consistency across all environments.
git clone https://github.com/bos-com/OpenCare-Africa.git
cd OpenCare-Africacp env.example .envThe .env file is already configured for Docker. No changes are needed unless you want to customize settings.
docker-compose build
docker-compose up -ddocker-compose exec web python manage.py migratedocker-compose exec web python manage.py createsuperuserdocker-compose ps
curl http://localhost:8000/health/- Web: http://localhost:8000
- Admin: http://localhost:8000/admin
- API Docs: http://localhost:8000/api/docs/
- Swagger UI:
/api/docs/ - ReDoc:
/api/redoc/ - Schema:
/api/schema/
/api/v1/auth//api/v1/patients//api/v1/health-workers//api/v1/facilities//api/v1/records//api/v1/analytics/
If you prefer to run the application locally without Docker, follow these steps:
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activatepip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt # optionalcp env.example .envUpdate DB and Redis settings for local use.
python manage.py migratepython manage.py runserverSQLite is used by default for development (no additional setup required).
- User
- Location
- HealthFacility
- AuditTrail
- Patient
- PatientVisit
- PatientMedicalHistory
- HealthWorkerProfile
- ProfessionalQualification
- WorkSchedule
- HealthRecord
- VitalSigns
- Medication
- LaboratoryTest
SECRET_KEY=your-secret-key
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
DB_ENGINE=django.db.backends.postgresql
DB_NAME=opencare_africa
DB_USER=opencare_user
DB_PASSWORD=opencare_password
DB_HOST=localhost
DB_PORT=5432
REDIS_HOST=localhost
REDIS_PORT=6379
JWT_ACCESS_TOKEN_LIFETIME=5
JWT_REFRESH_TOKEN_LIFETIME=1python manage.py test
coverage run --source='.' manage.py test
coverage report- Set
DEBUG=False - Configure production database
- Enable SSL/TLS
- Configure static files
- Set up monitoring
- Configure backups
- JWT authentication
- Role-based access control
- Audit logging
- Input validation
- CORS configuration
- Rate limiting
- Fork the repository
- Create a feature branch
- Make changes
- Add tests
- Submit a pull request
MIT License
- Django community
- Healthcare professionals
- Open-source contributors
OpenCare-Africa β Empowering healthcare in Africa through technology.