/SupplyChain

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Eccommerce Inventory - Supply Chain

An Inventory Manager demo using Solidity, React, Truffle, Web3 and OpenZeppelin.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Tests
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Acknowledgements

About The Project

Product Name Screen Shot

An Inventory Manager implemented in Rinkeby Test Network that allows you to:

  • Register a new item
  • Pay for the item
  • "Send" the item for customer
  • Track the status of all items

Whenever a item changes it's status, an event is emitted by the smart contract and the React interface is listening to update the UI accordingly.

There are 3 events:

- When a new item is created;
- When an item is paid;
- When an item is sent;

And 3 possible status:

- 0: Item created;
- 1: Item was paid;
- 2: Item was sent;

A list of commonly used resources that I find helpful are listed in the acknowledgements.

Built With

Getting Started

In the following sections you will learn how to clone this repo and get it up and running in no time.

Prerequisites

You need to have npm installed.

  • Download and install node, which already comes with npm:

Installation

  1. Clone the repo (--recurse-submodules to include the client's submodule folder)

    git clone --recurse-submodules https://github.com/vinivst/SupplyChain.git
  2. Install NPM packages in project ("backend")

    npm install
  3. Install NPM packages in client

    cd client
    npm install
  4. Register a new account in Infura and create a new project to get your rinkeby key at https://infura.io/dashboard/ethereum

  5. Create a .env file at root path

  6. Create the MNEMONIC (12 words seed phrase from your wallet) and INFURA_KEY (that you got from step 3) inside .env and save

    MNEMONIC = globe nephew genre emotion morning best penalty trade bid glare unaware dragon
    INFURA_KEY = https://rinkeby.infura.io/v3/you_key_here
  7. Deploy your smart contracts

    truffle migrate --network rinkeby
  8. Change to client directory and run react

    cd client
    npm start
  9. Enjoy your own Inventory Manager on chain! 😄

Usage (Metamask didn't shows in the gifs)

Manager can create a new item:

Create New Item

Then a customer can pay for an item:

Pay for an item

When an item is paid, manager can send the item to the customer:

Send Item

Tests

You can see all the tests inside the test folder. The tests were all made using Truffle and Web3. To run the tests simply use:

truffle test

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GNU GPLv3 License. See LICENSE for more information.

Contact

Vinicius Santiago - Linkedin

Project Link: https://github.com/vinivst/SupplyChain

Acknowledgements