- Install node and npm (https://nodejs.org/en/download/package-manager)
- Clone repo https://github.com/johnfoley14/BlockchainWeb3DApp
- Navigate into project directory
cd .\ticket-system-webapp\ - Install necessary packages
npm i. If you have errors installing dependencies, please refer to section at end of README. - Run local development environment
npm run start
The following may be done when demoing the webapp
- If encountering CORs errors when demoing project, try using chrome with
chrome.exe --user-data-dir="C://Chrome dev session" --disable-web-security. - Feel free to change doorman address in App.js. This will allow you to fully demo redeeming a ticket as the doorman would. This however requires the doormans private key. A doorman can be any wallet created on
http://localhost:3000/createWallet. I have also given links to successful use of this page in the report under Successful Links and Transactions.
Two testing frameworks are currently in use:
- Jest for testing frontend rendering and low level logic
- Truffle for testing the smart contract functions and testing contract deployment
Running tests:
- To run Jest test suite:
npm test - To run Truffle smart contract tests:
truffle test - To test smart contract deployment with truffle:
truffle develop. This should create a local development blockchain at http://127.0.0.1:9545/. Next deploy smart contract withmigrate --reset
If you are having difficulty installing dependencies or running commands, please try changing execution policy:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
Remember to change execution policy back after:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Default