Fight Pandemics Token Badges for volunteers.
develop branch is the default branch
Folder structure:
base: contains Solidity smart contractsclient: frontend UI, contains React components to interact with contractsapi: backend API, Node with PostGres database
- Solidity compiler (solc) 0.7.3 (soon to be upgraded to 0.8.0)
- Yarn latest version
- NVM (Node Version Manager) - run
nvm installto install node version locally from.nvmrcfile within each folder - Install PostGres for your platform and create database named
badges_devbased on the database URL string below. - Create an environment file
/api/.envfile with the following key-value pairs.
NODE_ENV=development
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/badges_dev
- In
/clientcreate a.envfile with the following
REACT_APP_PINATA_API_KEY=
REACT_APP_PINATA_SECRET_API_KEY=
- contact @jontkoh for the Pinata keys
Involves the following steps:
- Install dependencies.
- Migrating database.
- Setup smart contract
- Run the
clientandapi.
Run yarn setup in project root directory to install dependencies for all folders.
Run cd api && NODE_ENV=development yarn migrate to migrate database.
- Run
cd base && yarn compileto compile the contracts and copy the contract ABI to/client. - Start local blockchain node with
yarn start. - Run
yarn deployto deploy contracts to local node.
Back in root directory, run yarn dev to run client and api in one terminal OR run yarn api:dev and yarn client:dev in separate terminals.