MyHaki is an AI-driven legal aid management system designed to streamline coordination between lawyers, families of pretrial detainees, and the Law Society of Kenya (LSK). The backend, built with Django REST Framework, provides secure API endpoints for user management, case applications, verification, assignment, tracking, and CPD points tracking. The platform leverages AI to classify and prioritize cases, enabling automated matching and assignment of lawyers to cases for efficient and transparent access to justice.
- User registration, login, and authentication
- CRUD operations for users, case applications, verification, assignment, tracking, and reporting
- Modular architecture for easy extension and maintainability
- Role-based access control for lawyers, LSK administrators, and detainee families
- Secure endpoints protected with token-based authentication
- AI-powered case classification, prioritization, and automated lawyer assignment
- CPD points tracking for lawyers participating in pro bono services
- Monthly analytics and reports for LSK oversight
- API documentation with Swagger UI
- Python 3.10+
- Django 4.2+
- Django REST Framework
- drf-yasg (Swagger API docs)
- PostgreSQL
- Token authentication (via DRF)
- Android (mobile clients for detainees/families and lawyers)
- Progressive Web App (for LSK admins)
- Python 3.10 or higher
- pip package manager
- Virtual environment tool
- PostgreSQL database
-
Clone this repository:
git clone https://github.com/akirachix/myhaki-backend.git cd myhaki-backend
-
Create and activate a virtual environment: Linux/macOS:
python -m venv venv source venv/bin/activate
Windows:
python -m venv venv venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set environment variables and update
settings.py
:- Configure your database connection, secret key, and any external API keys (if applicable).
- Copy
.env.example
to.env
and fill in your settings.
-
Run database migrations:
python manage.py migrate
-
Create a superuser for admin access:
python manage.py createsuperuser
-
Collect static files:
python manage.py collectstatic
-
Start the development server:
python manage.py runserver
- Swagger UI: https://myhaki-3e53581dd62e.herokuapp.com/swagger/
- Redoc: https://myhaki-3e53581dd62e.herokuapp.com/redoc/
- Endpoints for user registration, authentication, case applications, assignment, tracking, and reporting are accessible via the API.
- Mobile apps for detainees/families and lawyers communicate with the backend using secure REST endpoints.
- Role-based access ensures only authorized users can access sensitive data and operations.
- For questions, issues, or contributions, please open an issue or discussion in this repository.
- Core team: Yordanos Hagos, Fiona Wesonga, Mahder Belete, Saloi Akeza, Lwam Bisrat