monorepo including the client (frontend and API) and evm components
<project>/
client/ <-- [web2] client / api using next.js
evm/ <-- [web3] contract code / tests / tasks using hardhat and ethers.js
package.json <-- scripts to control each component or together as a systemin .vscode/ there are some recommended workspace extensions and settings. you can install those to get the best experience working with the codebase:
- on the sidebar open the extensions panel (4 squares symbol)
- search for
@recommended - install all of them
- find
prettier-eslintin the list, click the extension and selectSwitch to Pre-Release Version - install dependencies (from the top level) run
npm install(this will install the monorepo, client and evm deps) - close and reopen VSCode (you must do this or some extensions wont work)
the client client/tsconfig.json has aliases set up for importing:
@styles/*: any CSS in theclient/styles/dir@evm/*: access to files inevm/dir (artifacts, types, deployment records)
the top-level package.json contains scripts to run the client/ and evm/ scripts individually or as a system
- individual:
npm run client: -- <script>ornpm run evm: -- <script> - together: top-level scripts (below)
run these from the project root
- install (installs deps for monorepo, client and evm components)
npm install- run dev mode (compiles evm and runs next.js dev mode)
- starts a local hardhat node
- compiles and deploys the contracts (
evm/tasks/dev.ts) and stores thedevelopmentdeployment record inevm/deployments/<Contract>.json - starts the client next.js dev server
npm run dev- compile both for prod
npm run build- run tests for evm and client
npm test