A transparent supply chain management platform with end users in mind.
Trace is a decentralized application based on the Ethereum blockchain aiming to let consumers see the data behind the products they buy every day. It currently allows industry experts to add products to the app, as well as create certifications that can be added to products. A mobile companion app (not developed yet) would allow scanning Trace QR codes placed on the actual products to see the data on-premise (e.g. at the grocery store).
Keep in mind that this is a proof of concept. It is not production ready by any means. However, we do invite you to play around with the project and use it as you see fit. There are some rough edges, so we definitely appreciate your help in improving the platform.
This project was developed under the supervision of Bessam Abdulrazak, director of the Ambient Intelligence Lab at Université de Sherbrooke.
Made using the Truffle toolkit, React.js, Redux, and Webpack.
Logo design by Laurence Mailhiot.
Installing / Getting started
Clone the repo:
git clone https://github.com/maximevaillancourt/trace.git cd trace
Install the Truffle toolkit globally and install project dependencies:
npm install -g email@example.com && npm install
In a new shell, start the Truffle development console:
In the Truffle console, compile and deploy the smart contracts:
This will effectively reset your local blockchain, meaning that all existing transactions will be deleted.
Back in a regular shell, start the Webpack server:
npm run start
A browser window should then open automatically at
http://localhost:3000(or whatever port you set manually). If you see the Trace home page, you're ready to go. Otherwise, if the page is stuck on "Waiting for Web3...", proceed to steps 5 and 6.
Install the MetaMask browser extension. Once installed, click on the MetaMask icon, then use the "Import Account" feature to create an account from a private key. Copy the first private key from the first few lines of output of
truffle developand paste it into the "Private Key" field in Metamask.
Connect to your private network. Click the network chooser (it will likely say "Main Ethereum Network" at the top), and choose "Custom RPC". In there, enter the URL that matches the configuration in the
truffle.jsfile (which should be
http://localhost:9545by default), then click "Save".
Refresh the page in your browser, and you should be good to go!
To change something in the "smart contracts" side of things, you need to compile your contracts every time you change them using the following command in the Truffle console:
As for the React front-end, the Webpack server should refresh the page in your browser automatically when a change is detected.
Once you're ready to bundle the front-end app, use the
build script to bundle everything together.
npm run build
You're free to deploy the generated front-end bundle wherever you see fit. As for the smart contract, you can deploy it through Ganache/Truffle by adding a new network configuration. See this guide for more information.
- Add a product to the platform
- Search for a particular product
- Add certifications to products (e.g. "biological", "non-GMO", etc.)
- Browse a product's version history
- See the product's previous positions on a map
- Combine products into one
- Split a product into many (WIP)
For bug fixes, documentation changes, and small features:
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature') using GPG signing
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request
For larger new features: do everything as above, but first also make contact with the project maintainers to be sure your change fits with the project direction and you won't be wasting effort going in the wrong direction
- Repository: https://github.com/maximevaillancourt/trace
- Issue tracker: https://github.com/maximevaillancourt/trace/issues
- Related projects:
The code in this project is licensed under MIT license. See the LICENSE.