This project is a backend service for managing medication SKUs, including functionalities for CRUD operations and bulk creation of SKUs. It is built using Django and Django REST Framework.
https://h-axmed-medication.onrender.com/docs/
🚀 Live Demo: Click Me
- CRUD Operations:
- Create, read, update, and delete individual medication SKUs.
- Bulk Upload:
- Upload multiple SKUs through a single API.
- Validation:
- Ensures unique combinations of
medication_name
,formulation
,dosage
, andunit
. - Validates dosage (positive number) and prohibits numerical values in
formulation
andunit
.
- Ensures unique combinations of
- Backend Framework: Django
- API Development: Django REST Framework
- Database: SQLite (default, configurable for other databases)
- Python 3.9+
- Django 5.1+
- pip
- Clone the Repository
git clone https://github.com/mysticblackmask/h-axmed_medication.git cd axmed
This project provides backend services for managing medication SKUs, enabling CRUD operations and bulk creation of SKUs via REST APIs. Built with Django and Django REST Framework.
- CRUD Operations: Manage individual SKUs (create, read, update, delete).
- Bulk Upload: Upload multiple SKUs in one request.
- Validation: Ensure valid and unique SKU records.
- Python 3.9+
- pip
- (Optional) Docker
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
http://127.0.0.1:8000/skus/
- URL:
/read/
- Method:
GET
- Description: Retrieve all SKUs.
- Example Response:
[ { "id": 1, "medication_name": "Amoxicillin", "formulation": "Tablet", "dosage": 50, "unit": "mg" } ]
- URL:
/create/
- Method:
POST
- Parameters:
medication_name
(string)formulation
(string)dosage
(positive number)unit
(string)
- Example Request:
{ "medication_name": "Paracetamol", "formulation": "Tablet", "dosage": 500, "unit": "mg" }
- URL:
/update/<id>/
- Method:
PUT
- Parameters: Same as for creation.
- Example Request: Update the dosage of SKU with ID 1:
{ "dosage": 250 }
- URL:
/delete/<id>/
- Method:
DELETE
- URL:
/bulk-create/
- Method:
POST
- Parameters: List of SKUs.
- Example Request:
[ { "medication_name": "Ibuprofen", "formulation": "Capsule", "dosage": 200, "unit": "mg" }, { "medication_name": "Aspirin", "formulation": "Tablet", "dosage": 100, "unit": "mg" } ]