"Transaction Dapp" is a very useful dapp for online shopping and also a basis for advanced trading scenarios, comprising web frontend with Metamask and blockchain backend deployed on (Ropsten) testnet.
Any user can easily create a sales order by using Metamask and become a seller. Other users can check the real-time product status on the blockchain and then decide to buy it or not. After that, the seller and the buyer take turns to finish the shipment and reception of the product(we consider that the delivery of goods or finish of services are necessary to complete a real-world transaction, also from the perspectives of conventional accounting and auditing).
Furthermore, as the transaction process (and accounting process) moves on, the Transaction Dapp also provides balance sheets.
0x6466aa98d9A2055570dC3ba71D232dc30A08BfA6
https://ropsten.etherscan.io/address/0x6466aa98d9A2055570dC3ba71D232dc30A08BfA6
https://rayhungkao.github.io/transaction-dapp/
Put backend first, local test mainly rely on Truffle, and final deployment rely on Infura. On the other hand, frontend, web development and local test with react, and then deployment on Github pages.
- Note: frontend scripts are detailed in /client/README.md
- Use your Metamask account and a supported web browser e.g. Chrome.
- Install Node.js and npm
$node --version
v16.13.0
$npm --version
8.1.0
truffle and react
$npm install -g truffle
$truffle unbox react
$npm install @truffle/hdwallet-provider
$truffle develop
$compile //inside truffle console
$migrate
$test //by default it runs all test files
or run specific test file
$truffle test ./test/transaction.js
$truffle migrate --network ropsten