This project is a blockchain-based supply chain management system designed to revolutionize the logistics industry by enhancing transparency, traceability, and operational efficiency. By leveraging blockchain's immutable ledger, this system guarantees product authenticity and ensures seamless interaction between supply chain participants. The system includes:
- A React-based front-end application for user interaction.
- Solidity smart contracts deployed on a local blockchain (Ganache) to automate and secure transactions.
- Integration with MetaMask for secure user authentication and peer-to-peer operations.
- MongoDB database for storing product details, ensuring transparency and traceability.
Real-time tracking features empower users with complete visibility, enabling end-to-end monitoring of goods throughout their journey.
This system defines four key roles in the supply chain:
- Manufacturer: Creates and uploads product details.
- Distributor: Handles the distribution and updates product status.
- Retailer: Receives products from distributors and manages stock.
- Consumer: Views product history and validates authenticity.
- Track the complete history and origin of products.
- Verify the authenticity of goods with blockchain-based records.
- Automate operational tasks such as transaction validation, ownership transfers, and product status updates.
- Ensure data integrity and prevent unauthorized changes.
- Use MetaMask for secure user authentication.
- Enable decentralized peer-to-peer transactions.
- Monitor the status and location of goods in real-time using an intuitive interface.
- Store product data in a MongoDB database to maintain transparency between supply chain levels.
- A responsive and user-friendly interface for interacting with the blockchain network.
To run this project, ensure the following tools are installed:
- Node.js (v16 or later recommended)
- Ganache (for local blockchain development)
- MetaMask (browser extension for Ethereum wallet)
- MongoDB (for product data storage)
-
Clone the Repository
git clone https://github.com/AB/DApp.git cd DApp -
Install React App Dependencies Navigate to the
appfolder, which contains the React code, and install the required dependencies:cd app npm install -
Deploy Smart Contracts
- Start Ganache and create a new workspace.
- Use Truffle to deploy the smart contracts from the root directory:
truffle migrate --network development
-
Set Up Environment Variables Create a
.envfile in theappdirectory and configure the following variables -
Run the React Application Start the front end to interact with the blockchain network:
npm start
Access the app at
http://localhost:3000.
-
Connect MetaMask to Ganache
- Configure MetaMask to connect to the local blockchain network provided by Ganache.
-
Interact with the System
- Use the app to validate product history, execute peer-to-peer transactions, and monitor product locations.
-
Real-Time Updates
- View product status and location updates as they occur in real time.
-
Role-Based Functionality
- Manufacturers, distributors, retailers, and consumers have distinct functionalities tailored to their roles.
The Solidity smart contracts provide the backbone of the system by handling:
- Product ownership validation.
- Transaction logging.
- Role-based operations for manufacturers, distributors, retailers, and consumers.
- Real-time status updates.
Contracts are designed to ensure transparency, immutability, and trust among supply chain participants.
- Blockchain: Ethereum
- Frontend: React
- Smart Contracts: Solidity
- Local Blockchain: Ganache
- Wallet Integration: MetaMask
- Database: MongoDB
- Development Framework: Truffle
- Decentralized Storage: Integrate IPFS to store and retrieve product certificates.
- Predictive Analytics: Use AI to analyze supply chain data for optimization.
- Multi-Network Support: Expand compatibility with multiple blockchain networks (e.g., Polygon, Binance Smart Chain).
- Mobile Application: Develop a mobile version of the application for on-the-go usage.
Contributions are welcome! Follow these steps to contribute:
- Fork the repository.
- Create a feature branch:
git checkout -b feature-branch-name
- Commit your changes:
git commit -m 'Add feature description' - Push the branch:
git push origin feature-branch-name
- Open a pull request.
Join us in revolutionizing supply chain management with cutting-edge blockchain technology!