This project is for the blockchain application My Dapp. It contains code for the Smart Contract, web-based dapp and NodeJS server.
In order to develop and build "My Dapp," the following pre-requisites must be installed:
- Visual Studio Code (or any IDE for editing Javascript)
- NodeJS
- Yarn (DappStarter uses Yarn Workspaces)
- Flow CLI (https://docs.onflow.org/docs/cli) (after installation run
flow cadence install-vscode-extension
to enable code highlighting for Cadence source files)
Using a terminal (or command prompt), change to the folder containing the project files and type: yarn
This will fetch all required dependencies. The process will take 1-3 minutes and while it is in progress you can move on to the next step.
Using a terminal (or command prompt), change to the folder containing the project files and type: yarn start
This will run all the dev scripts in each project package.json.
To view your dapp, open your browser to http://localhost:5000
We
lerna run deploy --scope=@trycrypto/dappstarter-dapplib --stream
to compile contracts/*.sol files, deploy them to the blockchain.
Run the dapp in a separate terminal. You must have run npm run deploy
for the dapp to see most recent smart contract changes.
lerna run dev --scope=@trycrypto/dappstarter-client --stream
runs the dapp on http://localhost:5001 using webpack dev server
Run the server in a separate terminal. You must have run npm run deploy
for the dapp to see most recent smart contract changes.
lerna run dev --scope=@trycrypto/dappstarter-server --stream
runs NodeJS server app on port 5002 with NestJS
DappStarter currently does not provide blockchain migration scripts to be used in production. However, here are the scripts for generating production builds:
lerna run build:prod
generates dapp bundle for production.