An open API service indexing awesome lists of open source software.

https://github.com/rayeesac/medibillz

MediBillz – Medical Shop Billing API (Django + DRF + PostgreSQL+ Docker)
https://github.com/rayeesac/medibillz

django django-framework django-rest-framework docker dockerfile drf postgresql python resful-api

Last synced: 2 months ago
JSON representation

MediBillz – Medical Shop Billing API (Django + DRF + PostgreSQL+ Docker)

Awesome Lists containing this project

README

        

# πŸ₯ MediBillz-Medical Shop Billing API (Django,DRF,PostgreSQL)

## πŸ“Œ Overview
MediBillz is a **Django REST Framework (DRF) API** for managing a **Medical Shop Billing System**.
It includes **user authentication, medicine management, billing, stock tracking, and reports**.

---

## πŸš€ Features
βœ… **JWT Authentication** (Login, Logout, Role-based Access)
βœ… **Medicine Management** (Add, Update, Delete, Track Stock)
βœ… **Billing System** (Auto Price Calculation, Invoice Generation)
βœ… **Real-time Notifications** (Low Stock & Expiry Alerts)
βœ… **Admin Dashboard** (Sales Reports & Performance Metrics)

---

## πŸ“₯ **Postman Collection**
[![Run in Postman](https://run.pstmn.io/button.svg)](https://www.postman.com/grey-equinox-143107/medibillz/collection/cazzzdu/medibillz-medical-shop-billing-api)

1️⃣ Click the **"Run in Postman"** button.
2️⃣ Import the **Postman Collection** and set the environment variables:
```
base_url = http://127.0.0.1:8000
token =
```
3️⃣ Send requests and test APIs.

---

## πŸ› οΈ Get Started to Setup.

### **πŸ”Ή Step 1: Clone the Repository**
To get started, clone the project from GitHub:
```sh
git clone https://github.com/Rayeesac/MediBillz.git
cd MediBillz
```

### **πŸ”Ή Step 2: Run the Application Using Docker**
MediBillz comes with Docker support, making it easy to set up dependencies like PostgreSQL and Django in isolated containers.

πŸ”ΉStart the Application
Run the following command to build and start the services in detached mode (-d):

```sh
docker-compose -f docker-compose.yml up -d --build
```
To check running containers, use:
```sh
docker ps
```
### **πŸ”Ή Step 3: Restore the Database**
If you have a database backup (medibillz.sql), you can restore it into the running PostgreSQL container.

πŸ”Ή Run the Command
```sh
cat medibillz.sql | docker exec -i medi_postgres psql -U postgres
```

### **πŸ”Ή Step 4: Restart Docker Services**
```sh
docker-compose -f docker-compose.yml down && docker-compose -f docker-compose.yml up -d
```

---
Admin credentials
---------
username : medi-billz-admin
password : MBMBiz@Admin2025

---

## πŸ“Œ API Endpoints

### **1️⃣ Authentication APIs**
| Method | Endpoint | Description |
|--------|-------------|--------------------|
| `POST` | `/api/auth/register/` | Register a new user (Admin, Staff, Inventory Manager) |
| `POST` | `/api/auth/login/` | Get JWT access & refresh tokens |
| `POST` | `/api/auth/logout/` | Invalidate JWT token |

---

### **2️⃣ User Management APIs (Admin Only)**
| Method | Endpoint | Description |
|--------|-------------|--------------------|
| `GET` | `/api/users/` | Get all users |
| `GET` | `/api/users/{id}/` | Get a specific user |
| `PUT` | `/api/users/{id}/` | Update user details |
| `DELETE` | `/api/users/{id}/` | Delete a user |

---

### **3️⃣ Medicine Management APIs (Inventory Manager Only)**
| Method | Endpoint | Description |
|--------|-------------|--------------------|
| `POST` | `/api/medicines/` | Add a new medicine |
| `GET` | `/api/medicines/` | List all medicines |
| `GET` | `/api/medicines/{id}/` | Get medicine details |
| `PUT` | `/api/medicines/{id}/` | Update medicine details |
| `DELETE` | `/api/medicines/{id}/` | Delete a medicine |

---

### **4️⃣ Billing APIs (Staff Only)**
| Method | Endpoint | Description |
|--------|-------------|--------------------|
| `POST` | `/api/billing/` | Create a bill (Auto price calculation) |

πŸ“Œ **Example Request:**
```json
{
"items": [
{ "medicine": 2, "quantity": 2, "packaging_type": "box" },
{ "medicine": 1, "quantity": 1, "packaging_type": "pack" }
]
}
```

---

### **5️⃣ Dashboard APIs (Admin Only)**
| Method | Endpoint | Description |
|--------|-------------|--------------------|
| `GET` | `/api/dashboard/stock/` | Get available stock |
| `GET` | `/api/dashboard/reports/?start_date=YYYY-MM-DD&end_date=YYYY-MM-DD` | Get sales reports |

---

## πŸ“§ **Contact & Support**
For issues, feel free to open a GitHub issue or contact:
πŸ“© Email: **[email protected]**
πŸ”— GitHub: [GitHub Repo](https://github.com/Rayeesac/MediBillz)