This guide explains how to install dependencies, run the app locally, execute contract tests, and build production artefacts.
The repository ships with a Development Container configuration under .devcontainer/ that provides Bun, Node.js 20, and Foundry pre-installed. Launching the project in GitHub Codespaces or VS Code with the Dev Container
extension automatically:
extension automatically:
- Installs frontend dependencies via
bun install. - Fetches Foundry libraries inside
contracts/withforge install. - Exposes common ports (
5173for Vite,6006for Storybook). - Adds editor extensions for Bun, Solidity, ESLint, and Prettier.
Use this environment to avoid manual toolchain setup. The sections below outline the same steps for local machines without Codespaces support.
- Node.js alternative: Bun v1.0 or newer.
- Package manager: Bun ships with its own package manager; no separate installation is required.
- Smart contract tooling: Foundry (
forge,cast,anvil). - Version control: Git.
- Optional: MiniKit test harness for end-to-end World App flows.
Clone the repository and install dependencies with Bun:
bun installThe lockfile (bun.lock) is committed to ensure reproducible installs. Use bun install --frozen-lockfile in CI.
Start the Vite development server:
bun run devThis exposes the app at http://localhost:5173. The app expects the following environment variables (configure via .env.local):
VITE_PUBLIC_APP_ID: World App identifier for the dApp.VITE_PUBLIC_CONTRACT_ADDRESS: Deployed diamond address on Worldchain.
Storybook helps validate components in isolation:
bun run storybookRun ESLint using the Bun script:
bun run lintPrettier is configured via ESLint. Fix issues automatically with:
bun run lint -- --fixCreate an optimised bundle:
VITE_PUBLIC_APP_ID=<app-id> \
VITE_PUBLIC_CONTRACT_ADDRESS=<contract-address> \
bun run buildOutputs live in dist/. Deploy them through the deploy-app.yml workflow or your preferred static host.
Install dependencies and run tests:
cd contracts
forge install
forge testSet FOUNDRY_PROFILE to select between configurations (e.g., default, ci). Deployment scripts reside in contracts/script/ and rely on environment variables documented inside each script.
- Ensure Bun is the latest stable release;
bun upgraderesolves many dependency issues. - Delete
.turboandnode_modulesif builds fail unexpectedly, then reinstall. - Use
anvilto spin up a local Ethereum-compatible node when iterating on contract interactions.
- Read the frontend architecture documentation for implementation details.
- Review smart contracts for diamond layout, facets, and upgrade processes.
- Inspect the workflow reference to understand CI/CD automation.