LogiTrack is a blockchain-based supply chain management system designed to enhance transparency and security in the transfer of products from manufacturers to customers. Utilizing Solidity smart contracts, Truffle.js, and Ganache-cli for deployment, this system provides a decentralized and transparent tracking of products at each checkpoint. The frontend is built with React.js, and Web3.js is used for blockchain communication, with Express.js handling dynamic routing to ensure secure data integrity.
The project is structured as follows:
- Smart Contracts: Written in Solidity, compiled, migrated, and deployed using Truffle.js on a local blockchain network (Ganache-cli).
- Frontend: Built with React.js for efficient component and state management.
- Blockchain Communication: Integrated using Web3.js to interact with smart contracts and the local blockchain network.
- Routing: Handled by Express.js for dynamic API routing, and Nginx is used as a load balancer.
- Product Manufacturing: The
manufactureProduct()function records the product and manufacturer details on the blockchain. - Product Transfer: The product is transferred to a third party seller, updating the
productHistory[]and callingpurchasedByThirdParty(). - Online Purchase: The product is shipped to the customer, with various functions (
shipByThirdParty(),receivedByDeliveryHub(),shipByDeliveryHub(),receivedByCustomer()) managing the process and updating the product state. - Data Retrieval: Functions such as
fetchProductPart1(),fetchProductPart2(), andfetchProductHistoryLength()retrieve product data and history. - Security: Hashes for certificates are generated using Solidity's
keccak256()function, ensuring data integrity and security.
npmgit- Docker (optional)
-
Clone the Repository
git clone https://github.com/ishangawande55/LogiTrack.git && cd LogiTrack
-
Install Dependencies
npm install
-
Install Ganache-cli
npm install -g ganache-cli
-
Run Ganache-cli
ganache-cli --accounts 10 --gasLimit 6721975000
Or with Docker:
sudo docker run -d -p 8545:8545 trufflesuite/ganache-cli:latest -h 0.0.0.0 --accounts 10 --gasLimit 6721975000
-
Migrate Contracts
truffle migrate --network=develop --reset
-
Setup Client
Navigate to the client directory and install dependencies:
cd client npm installCreate an
.envfile with the following content:REACT_APP_GOOGLE_MAP_API_KEY=************************* REACT_APP_RPC=http://127.0.0.1:8545/ -
Run the Application
npm start
The app will be hosted at port 3000 by default.
This project is licensed under the MIT License.
A big thank you to all contributors who helped in making this project a success. Your support and collaboration are greatly appreciated!
Feel free to adjust the content as needed based on your project specifics and preferences.