Skip to content

Python (Flask), React.js, Typescript, Node.js, HTML, CSS, MySQL, Solidity (Truffle), Junit, Selenium WebDriver, Ganache, MetaMask, IPFS, Docker, Visual Studio Code

Notifications You must be signed in to change notification settings

sharriewang2022/IT902---RSCF-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Retail Supply Chain System Handbook

1. Install the Blockchain Environment

Install the private blockchain Ganache and start it, then import the truffle configuration file truffle-config.js into the Ganache and restart Ganache:

image

In Visual Studio Code, open the Truffle project “TRUFFLRSCF”. To deploy all the smart contracts to Ganache, in the terminal, run the command: truffle migrate --reset: image

Install MetaMask, create a new account to log in, and open it in the browser: image

Add the Ganache network to MetaMask:

image

2. Install the Back-end Environment

Install MySQL Server 8.1.0: image

In another Visual Studio Code, open the Flask project “FlaskEndRSCF”. In the MySQL database, execute all the scripts in the folder: FlaskEndRSCF\db. In the Flask project “FlaskEndRSCF”, configure the MySQL database in setting.py: image

Install IPFS, open the folder of IPFS, start IPFS by executing the command: ipfs daemon. Then the IPFS daemon is up and running on the machine, and the default server site is at http://localhost:5001/. image

Configure the IPFS information in setting.py of the Flask project “FlaskEndRSCF”: image

Get the address of the smart contract IPFSHashRSCF in Ganache: image

Configure the address of the smart contract IPFSHashRSCF in setting.py of the Flask project “FlaskEndRSCF”: image

To start the back-end server, in the terminal, run the command: flask run: image

3. Install the Front-end Environment

Get the address of the smart contract “SupplyChainRSCF” in Ganache: image

In another Visual Studio Code, open the front-end project “frontendrscf”. In the file “.env.development”, set the address of the smart contract “SupplyChainRSCF” to REACT_APP_SMART_CONTRACT_ADDRESS: image

Set the back-end server URL to REACT_APP_SERVER_BASE_URL: image

Set IPFS server details to REACT_APP_IPFS_HOST and REACT_APP_IPFS_PORT: image

To start the front-end project, in the terminal, run the command: npm start: image

In the browser, the web application is opened automatically: image

Get the private key to the first account of Ganache: image

Import this private key to MetaMask to create a new account in MetaMask and connect to this new account: image

4. System Operation Instruction

Log in to the system by default with the user name “sa” and password “12345678”, select the role “Administrator”. After entering the system, users could operate the relative modules according to their roles. The administrator can operate all the functions:

image

4.1 Administration Management Module

The category management module can add users: image

Customers can search for user information by the Web page: image

4.2 Category Management Module

The category management module can add categories according to similar features of products: image

Users can search for category information by clicking the button “Category List” : image

4.3 Product Management Module

System users can have permission to add product details according to their roles. The product base information is stored in the blockchain network through the smart contract to track the product information in the system. image

Users can search for product information by clicking the button “Product List” : image

4.4 Order Management Module

All the users could create an order in this module: image

Users can search for the order information after adding it: image

4.5 Document Management Module

In the document management module, financial files could be uploaded to the system: image

To determine whether the file has been altered, customers can compare the hash codes stored in the MySQL database and on the blockchain on the following page: image

4.6 Trace Management Module

Once the consumer has entered the product's unique serial number, they can obtain detailed information about it on the blockchain:

image

Customers can access relevant information about their product orders on the blockchain by clicking the button “related orders”: image

The Trace Management Module also includes the Chatbot feature, which allows customers to track products and report any issues about the product:

image

About

Python (Flask), React.js, Typescript, Node.js, HTML, CSS, MySQL, Solidity (Truffle), Junit, Selenium WebDriver, Ganache, MetaMask, IPFS, Docker, Visual Studio Code

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published