whitechain-dapp-vite starter is a client-only single-page app for Whitechain Sepolia with wallet connect and contract calls already wired. You clone it, add a Reown project id, and run. It runs on React 19, Vite, TanStack Router, and Tailwind v4, with Reown AppKit over wagmi v3 and viem. It suits developers who want a static dapp without building the wallet layer by hand. For a server-rendered app that can hide secrets behind a backend, use the Next dapp template instead.
This is a static SPA with no server, so it cannot hold secrets. Everything in the bundle ships to the browser. A Reown
projectId is public by design, which is fine. Never put a privileged key in a VITE_* variable.What you get
- Wallet connect through Reown AppKit, with the connected account, network, and WBT balance.
- A public read of the Storage contract that shows the current value with no wallet connected.
- A write that stores a new value and refreshes the read when the transaction confirms.
- A standalone codebase: every dependency is a public npm package, and the web3 layer lives in
src/lib.
Before you start
- Node.js 20.19 or later and pnpm through Corepack.
- A Reown project id from dashboard.reown.com.
- Optional: your own Storage contract. The template defaults to a public verified one, so you can skip this. To use your own, deploy with Hardhat or Foundry and copy its address.
- Test WBT for the write transaction, from the faucet.
1. Get the template
Clone the templates repository and enter the dapp folder.Terminal
2. Install dependencies
Enable the pinned pnpm through Corepack, then install. Every dependency comes from public npm, so no registry token is needed.Terminal
3. Configure the environment
Copy the example file and set the public values. Vite exposesVITE_* variables to the browser bundle at build time.
Terminal
VITE_STORAGE_ADDRESS is optional. The template defaults to a public, verified Storage contract on Whitechain Sepolia: 0xC880eF22c01184a3Db08F2c306684311C48cB495. Set the variable only to point at your own deployment.4. Run the app
Terminal
http://localhost:5173. The Storage card reads the current value over the public RPC right away. Select Connect wallet, approve the connection, and the account, network, and balance appear.
5173 is the Vite default. If it is already in use, Vite starts on the next free port and prints the URL.5. Read and write the contract
retrieve() is a view call, so the stored value shows without a wallet. store(uint256) sends a transaction. With a wallet connected on Whitechain Sepolia, enter a number and confirm it in the wallet. The value updates once the transaction confirms. Open the transaction on the explorer to check it.
If the wallet is on another network, the panel shows a switch action.
store() stays disabled until the wallet is on Whitechain Sepolia (chain 1874).How it looks

The Vite dapp: wallet and Storage contract cards
Project layout
Components
The web3 layer lives insrc/lib and the panels in src/components/web3. Each essential part is below, trimmed to the lines that matter.
Chain and wallet config
src/lib/wagmi.ts defines the chain with viem’s OP Stack chainConfig, then wires Reown AppKit over wagmi. Change the RPC URL to use your own node; set enableCoinbase: true to add the Coinbase connector.
src/lib/wagmi.ts
Wallet state hook
src/lib/wallet.ts gives the panels one shape for account and network state. The connection itself is opened through the AppKit modal, not here.
src/lib/wallet.ts
Wallet panel
src/components/web3/wallet-panel.tsx opens the modal to connect, then reads the balance with wagmi.
src/components/web3/wallet-panel.tsx
Storage read
retrieve() is a public view call, so it runs over the RPC with no wallet connected.
src/components/web3/storage-panel.tsx
Storage write
store(uint256) is a write, gated on a connected wallet. The read refreshes once the transaction confirms.
src/components/web3/storage-panel.tsx
Troubleshooting
`typecheck` reports `Cannot find module './routeTree.gen'`
`typecheck` reports `Cannot find module './routeTree.gen'`
Run
pnpm dev or pnpm build once. The TanStack Router plugin generates src/routeTree.gen.ts.The wallet connects but the Storage panel stays disabled
The wallet connects but the Storage panel stays disabled
Set
VITE_STORAGE_ADDRESS and switch the wallet to Whitechain Sepolia (chain 1874).`pnpm install` reports an engine error
`pnpm install` reports an engine error
Use Node 20.19 or later.

