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

https://github.com/thisis-developer/medichain

MediChain: Blockchain-Based Pharmaceutical Supply Chain Management
https://github.com/thisis-developer/medichain

blockchain cloudflare dapps-development ethereum html-css-javascript jar javaspringboot railway smart-contracts solidity

Last synced: 3 months ago
JSON representation

MediChain: Blockchain-Based Pharmaceutical Supply Chain Management

Awesome Lists containing this project

README

          

# MediChain: Blockchain-Based Pharmaceutical Supply Chain Management

[![License](https://img.shields.io/badge/License-Apache%202.0-red.svg)](https://opensource.org/licenses/Apache-2.0)
[![Build Status](https://img.shields.io/badge/build-passing-brightgreen)](https://github.com/yourusername/medchain)
[![Version](https://img.shields.io/badge/version-1.0.0-blue)](https://github.com/yourusername/medchain/releases)
[![Ethereum](https://img.shields.io/badge/Ethereum-Powered-3C3C3D?logo=ethereum)](https://ethereum.org/)
[![Solidity](https://img.shields.io/badge/Solidity-%5E0.8.0-363636)](https://soliditylang.org/)

---

## โš™๏ธ Overview

**MediChain** is a secure, transparent, and efficient blockchain-based system that transforms pharmaceutical supply chain management. Built on Ethereum, this solution provides end-to-end traceability of medical products from manufacturers to patients, eliminating counterfeit drugs and ensuring patient safety.

---

## โœจ Features

- ๐Ÿ”’ **Secure Drug Registration**: Immutable blockchain ledger for manufacturers
- ๐Ÿ” **Automated Ownership Transfer**: Smart contract-based secure handovers
- ๐Ÿงญ **State Management**: Track medicine journey from production to sale
- ๐Ÿ“ฑ **QR Code Verification**: Instant authentication with a simple scan
- ๐Ÿ›๏ธ **Decentralized Architecture**: No single point of failure
- โฑ๏ธ **Real-Time Tracking**: Monitor the movement of medicines live

---

## ๐Ÿ› ๏ธ Tech Stack

- **Blockchain**: Ethereum (Private Network), Solidity
- **Frontend**: HTML, CSS, JavaScript
- **Web3 Integration**: MetaMask, Web3.js
- **Smart Contracts IDE**: Remix IDE

---

## ๐Ÿ—๏ธ System Architecture

MediChain consists of three integrated layers:

### 1๏ธโƒฃ Blockchain Network
- Private Ethereum blockchain as the foundational database
- Solidity smart contracts for business logic automation
- Immutable record-keeping with timestamped transactions

### 2๏ธโƒฃ Client Communication Layer
- Web3.js for blockchain connectivity
- User interfaces for stakeholder interactions
- MetaMask integration for secure authentication and transaction signing

### 3๏ธโƒฃ Application Layer
- HTML-CSS-JavaScript frontend interface
- QR code integration for product verification
- Real-time tracking dashboard

![Architecture Diagram](./assets/architecture_diagram.png)

---

## ๐Ÿงฉ Key Modules

### ๐Ÿ”— Smart Contract Operations

Smart contracts written in Solidity handle:

- `addMedicine()` โ€“ Register medicines with full traceability
- `purchaseMedicine()` โ€“ Buy securely with automatic ownership transfer
- `updateMedicineState()` โ€“ Update lifecycle state (e.g., Manufactured, In Stock, Sold, Expired)
- `getMedicine()`, `getMedicineState()` โ€“ Retrieve real-time product and status info

### ๐Ÿ–ฅ๏ธ Dashboard

- Clean, professional interface modeled after modern commerce platforms
- Track:
- ๐Ÿงพ Order history
- ๐Ÿ’Š Total drugs registered
- ๐Ÿ“ฆ Total stock across batches
- ๐Ÿท๏ธ Total units sold
- Manufacturer insights, quantity analytics, and QR-based lookup tools

### ๐Ÿ” Track Medicine

- Search by medicine ID to view:
- ๐Ÿงฌ Batch metadata
- ๐Ÿญ Manufacturer identity
- โณ Lifecycle state and timestamps
- ๐Ÿ‘ค Current owner in the supply chain
- One-click **Verification Report** generation for regulators or consumers

### ๐Ÿ›’ Buy Medicine

- ๐Ÿ”Ž Live search and filter system
- ๐Ÿ’ณ Detailed product cards with dynamic pricing
- โœ… Integrated blockchain validation before purchase
- โšก Smooth transaction flow with MetaMask authentication

### ๐Ÿ‘ฅ User Management

- Register as:
- ๐Ÿญ Manufacturer
- ๐Ÿšš Distributor
- ๐Ÿช Pharmacy
- Role-based login with Ethereum identity
- All interactions are cryptographically signed

---

## ๐Ÿ–ผ๏ธ Screenshots

> ๐Ÿงพ Dashboard Overview
> ![Dashboard](https://github.com/user-attachments/assets/f17bda53-9a86-46d3-bac4-358c5ffb6653)
> ![Dashboard](https://github.com/user-attachments/assets/dd6f7ae8-4223-427e-941e-b524eec850e8)

> ๐Ÿ” Track Medicine
> ![Track Medicine](https://github.com/user-attachments/assets/084df5ed-6356-40f8-beaa-e985def44016)

> ๐Ÿ›’ Buy Medicines
> ![Buy Medicine](https://github.com/user-attachments/assets/03738613-ee51-46de-bd5e-664038ffd14c)
> ![Buy Medicine](https://github.com/user-attachments/assets/8dc7550c-219b-4ecd-a9a7-32f0426af0c2)

---

## โšก Performance

Optimized for speed and cost-efficiency:

- ๐Ÿš€ **Transaction Speed**: Avg. 100ms response under 500 concurrent users
- โ›ฝ **Gas Optimization**: Lower costs via optimized smart contracts
- ๐Ÿ“ˆ **Scalability**: Supports thousands of participants and millions of transactions
- ๐Ÿ” **Security**: Multi-layer protection against unauthorized access

---

## ๐Ÿš€ Future Enhancements

- [ ] ๐Ÿ“Š **Advanced Analytics**: ML-powered risk prediction
- [ ] ๐Ÿ”— **Cross-Chain Integration**: Interoperability with other networks
- [ ] ๐Ÿ“ก **Expanded Verification Methods**: NFC and RFID support

---

## ๐Ÿ‘จโ€๐Ÿ’ป Contributors

- **Baivab Sarkar** โ€” [@ThisIs-Developer](https://github.com/ThisIs-Developer)
- **Ayan Chatterjee** โ€” [@Ayan123C](https://github.com/Ayan123C)
- **Bhishmadev Ghosh** โ€” [@bhishma620](https://github.com/bhishma620)
- **Arpan Bhattacharya** โ€” [@Arpan550](https://github.com/Arpan550)

---

## ๐Ÿ“„ License

This project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.