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 install
to install node version locally from.nvmrc
file within each folder - Install PostGres for your platform and create database named
badges_dev
based on the database URL string below. - Create an environment file
/api/.env
file with the following key-value pairs.
NODE_ENV=development
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/badges_dev
- In
/client
create a.env
file 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
client
andapi
.
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 compile
to compile the contracts and copy the contract ABI to/client
. - Start local blockchain node with
yarn start
. - Run
yarn deploy
to 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.