For the complete documentation index, see llms.txt. This page is also available as Markdown.
Ch 1: Project Setup and Providers
In this chapter, you'll set up the React frontend project and configure the provider stack that enables shielded wallet interactions in the browser. Estimated time: ~15 minutes
Creating the web package
From the root of your clown-beatdown monorepo, create a new Vite + React + TypeScript project:
cdpackagesbuncreateviteweb--templatereact-tscdweb
Install dependencies
Install the core dependencies for wallet connection, shielded interactions, UI, and animations:
The Vite config below uses the SWC plugin for faster builds. Install it as a dev dependency:
bunadd-d@vitejs/plugin-react-swc
Copy public assets
Copy the public/ folder from the seismic-starter repo into packages/web/public/. This includes the clown sprites, button images, background, logo, and audio files used by the game UI.
Configure Vite
Update vite.config.ts:
The envDir points to the monorepo root so that .env files at the top level are available to the web package.
Environment variables
Create a .env file at the monorepo root:
VITE_CHAIN_ID determines which chain the app connects to — 31337 is the local sanvil node.
Setting up the provider stack
The key architectural pattern in a seismic-react app is the provider stack. This wraps your application in the context providers needed for wallet connection and shielded operations.
Create src/App.tsx:
What's happening here?
The provider stack nests four layers, each adding functionality:
WagmiProvider — manages wallet connections and chain state via wagmi hooks (useAccount, useConnect, etc.)
QueryClientProvider — provides React Query for caching and background data fetching
RainbowKitProvider — adds a polished wallet connect modal UI
ShieldedWalletProvider — the Seismic-specific layer from seismic-react that derives a shielded wallet client from the connected wagmi account, enabling shielded reads and writes. It takes config and options — the options include publicTransport, publicChain, and an onAddressChange callback.
The onAddressChange handler auto-funds new wallets when running on sanvil (local dev), so you don't need to manually send ETH to test accounts.
Supporting files
Before wiring up the entry point, create the supporting modules that main.tsx and App.tsx will import.
Redux store — Create src/store/store.ts:
MUI theme — Create src/theme.ts:
Page components — Create src/pages/Home.tsx:
Create src/pages/NotFound.tsx:
Stylesheets — Create src/App.css (empty for now) and replace src/index.css with:
Entry point: main.tsx
Create src/main.tsx to bootstrap the app with theme and state management: