A decentralized application for tracking pharmaceutical supply chains using Ethereum blockchain technology. This project demonstrates how blockchain can be used to enhance transparency, security, and traceability in pharmaceutical distribution.
This application consists of:
- Smart contracts written in Solidity and deployed on Ethereum
- Backend infrastructure managed with Hardhat
- Frontend interface built with Vue.js
- Web3 connectivity via MetaMask and ethers.js
- Node.js (v14.x or later recommended)
- npm or yarn
- MetaMask browser extension installed
- Hardhat - Ethereum development environment
- Basic understanding of blockchain concepts and Ethereum
- Clone the repository:
git clone https://github.com/d3xt3r9/pharmacy-tracker.git
cd pharmacy-tracker
- Install Hardhat:
# Install Hardhat globally (optional)
npm install -g hardhat
# Or install as a development dependency (recommended)
npm install --save-dev hardhat
- Install dependencies:
# Install Hardhat dependencies
npm install
# Install Vue.js frontend dependencies
cd pharmacy-front
npm install
cd ..
- Start a local Hardhat node:
npx hardhat node
- Deploy the smart contracts to the local network (in a new terminal):
npx hardhat ignition deploy ignition/modules/PharmacyChain.js --network localhost
- Start the Vue.js development server:
cd frontend
npm run serve
-
Open your browser and navigate to
http://localhost:8080
-
Connect MetaMask to the local Hardhat network (usually
http://localhost:8545
)
npx hardhat help
npx hardhat clean
npx hardhat compile
- Connect your MetaMask wallet to the application
- Register as a pharmaceutical entity (manufacturer, distributor, pharmacy, etc.)
- Create and track pharmaceutical products through the supply chain
- Verify authenticity and track history of medications
This project is intended for educational and demonstration purposes to showcase blockchain technology in pharmaceutical supply chains. It should not be used in real-world pharmaceutical tracking without significant additional security measures and professional auditing.
Security aspects to consider if developing further:
- Smart Contract Security: Contracts would need thorough auditing before production use
- Private Keys: Always keep private keys secure and never commit them to repositories
- Test Networks: This application is designed for local or test networks, not mainnet deployment
- Limited Testing: The security features have not been comprehensively tested
- No Warranties: This code is provided "as is" without any guarantees of security or fitness for purpose
- Educational Purpose: Use the codebase as a learning tool for blockchain concepts
If adapting this project for real-world use, consult with blockchain security experts and conduct professional audits.
MIT License
Copyright (c) 2024 d3xt3r9
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
ATTRIBUTION REQUIREMENT: All copies, modifications, or substantial uses of this software must include clear and visible attribution to the original author (d3xt3r9) along with the original repository link (https://github.com/d3xt3r9/pharmacy-tracker). This notice must appear in any documentation, applications, or derivative works.
The above copyright notice, attribution requirement, and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.