A full-stack decentralized supply chain management system using Solidity, Node.js, MongoDB, and React. It enables seamless tracking of medicines through various stages from manufacturing to retail with participant roles like Supplier, Manufacturer, Distributor, and Retailer.
Written in Solidity, the smart contract allows:
- Adding Medicines
- Registering Participants
- Assigning participants to medicines
- Tracking stages: Ordered → Raw Material Supplied → Manufactured → Distributed → Retail → Sold
- Getting current medicine stage
- Shipment creation and medicine transfer logging
- Frontend: React + Vite + Tailwind CSS
- Backend: Node.js + Express + Web3.js
- Database: MongoDB with Mongoose
- Blockchain: Solidity Smart Contract (Truffle / Ganache)
- Clone the repository
git clone https://github.com/greenhub/Medicine-Supply-Chain-Management.git
cd Medicine-Supply-Chain-Management- Setup MongoDB Atlas
- Create an account at MongoDB Atlas
- Create a free cluster and get your connection string
- Replace your .env variables as shown below
- Create a .env file in server/ with (without quotes):
MONGO_URI='mongodb+srv://<username>:<password>@cluster0.mongodb.net/supplychain?retryWrites=true&w=majority'
PORT=5000
CONTRACT_ADDRESS=0xYourDeployedContractAddress
BLOCKCHAIN_NODE_URL='http://127.0.0.1:7545'
OWNER_PRIVATE_KEY=0xYourGanachePrivateKey- Compile & Deploy Smart Contract
truffle compile
truffle migrate --reset- Start Backend
cd backend/
node server.js- Start Frontend
cd frontend/
npm run dev- Role-based Participant Registration
- Medicine Lifecycle Management
- Real-time Blockchain Tracking
- Shipment Management & Status
- Transaction History Tracking
- Responsive, Modern UI with Tailwind CSS
- User Authentication
- QR Code Tracking
- IPFS Integration for reports
- Email Notifications
This project is licensed under the MIT License.


