-
Clone/fork this repo:
git clone https://github.com/Proof-Of-Humanity/proof-of-humanity-v2-web/
-
Use the repo Node/Yarn versions:
node --version yarn --version
This repo is pinned to Node
22.22.1and Yarn1.22.22inpackage.json. The same Node version is also recorded in.nvmrcand.node-version, so tools likenvm,asdf,mise, or Volta can pick it up.If a Git hook or GUI client reports an older Node version, fix the active shell/GUI environment and open a fresh terminal. The Husky hooks expect Node
22.22.1to already be active. -
Install the dependencies:
yarn
-
Copy the
.env.examplefile into.env.localand set the appropriate values:cp .env.example .env.local
DEPLOYED_APP= 'https://v2.proofofhumanity.id/' # deployed frontend application URL REACT_APP_IPFS_GATEWAY='https://cdn.kleros.link' # ipfs gateway endpoint
for
SUBGRAPH_URLrefer to Proof of Humanity v2 subgraph repository -
Start the development server:
yarn dev
Run the focused checks before opening a PR:
yarn run typecheck
yarn run lint
yarn run check
yarn run buildyarn run check runs the TypeScript and lint checks together. yarn run build catches route and production build errors that may not appear during development.
GitHub Actions remains the source of truth for CI. Locally, yarn run check && yarn run build is the matching pre-merge verification flow.
Use Prettier for formatting:
yarn run format
yarn run format:checkyarn run format formats the whole repository, which can create a large diff. Prefer running it on small branches or when a formatting-only diff is intentional.
Husky runs yarn lint-staged before commits.
lint-staged only checks files staged for commit:
- Prettier formats staged JavaScript, TypeScript, JSON, CSS, Markdown, MDX, and YAML files.
- Next lint runs only on staged JavaScript and TypeScript files using
next lint --file. - Generated files such as
src/generated/graphql.tsare skipped by the lint command.
Refer to : https://github.com/kleros/kleros-v2/blob/dev/CONTRIBUTING.md