An interactive NFT minting carousel built as a Farcaster Mini App, showcasing a portrait collection created during Based House Devconnect. This project demonstrates modern Web3 development with React, TypeScript, and blockchain integration on the Base network.
Artist: @qabqabqab | Developer: @mattlee
Based House Heads is a touch-enabled carousel that allows users to browse through 18 unique portrait NFTs and mint them directly on the Base blockchain. The application integrates with Farcaster's social graph, providing a seamless social minting experience with wallet connection and transaction handling.
- React 18.3 with TypeScript 5.8 (strict mode)
- Vite 5.2 for fast development and optimized builds
- TanStack React Query 5.45 for data fetching and caching
- Touch gesture handling with swipe detection
- Wagmi (latest) - Type-safe Ethereum hooks and wallet connection
- Viem (latest) - Low-level Ethereum client library
- Farcaster Mini App SDK - Social integration and wallet connector
- Base Chain (Chain ID: 8453) - L2 deployment for low gas fees
- Zora Creator 1155 - ERC-1155 NFT standard implementation
- Zora ETH Minter - Decentralized minting protocol
- Mint price: 0.000777 ETH per NFT
- Biome.js 1.8 - Fast linting and formatting (zero config)
- TypeScript strict mode - Maximum type safety
- Vercel Edge Functions - Serverless OG image generation with
@vercel/og
- Touch-enabled swipe navigation with momentum tracking
- Keyboard navigation (arrow keys)
- Responsive image loading with fallbacks
- Smooth transitions and visual feedback
- One-click minting with transaction status tracking
- Gas estimation and error handling
- Post-mint success state with transaction links
- Ownership detection (prevents re-minting same NFT)
- Farcaster-native wallet connection
- Balance checking (NFT ownership + ETH balance)
- Multi-state UI (disconnected, connected, minting, success, error)
- Automatic wallet reconnection
- On-chain token URI resolution
- IPFS gateway support with fallbacks
- Client-side metadata caching
- Error boundaries and loading states
- Farcaster user profile display
- Open Graph meta tags for rich link previews
- Dynamic OG image generation per NFT
- Frame embed support for Farcaster feeds
useMint- Encapsulates minting logic, transaction handling, and state managementuseNftMetadata- Handles on-chain URI resolution and IPFS metadata fetchinguseFarcasterContext- Provides Farcaster SDK context throughout the app
- Centralized constants in
src/config/constants.ts - Type-safe ABI definitions in
src/config/abi.ts - Environment-based RPC configuration
src/
├── components/
│ ├── App.tsx # Main carousel logic
│ ├── MintButton.tsx # State machine for minting UI
│ ├── ConnectWallet.tsx # Wallet connection flow
│ ├── LoadingSpinner.tsx # Animated loading states
│ └── UserProfile.tsx # Farcaster profile display
├── hooks/
│ ├── useFarcasterContext.ts
│ ├── useMint.ts
│ └── useNftMetadata.ts
└── config/
├── constants.ts # 18 NFT configurations
└── abi.ts # Smart contract ABIs
- Node.js 18+ (or compatible runtime)
- pnpm (recommended) or npm
- Git
-
Clone the repository
git clone https://github.com/mattleesounds/based-house-heads.git cd based-house-heads -
Install dependencies
pnpm install # or npm install --legacy-peer-deps -
Configure environment variables
Create a
.envfile in the root directory:cp .env.example .env
Edit
.envand add your Coinbase Developer Platform RPC URL:VITE_BASE_RPC_URL=https://api.developer.coinbase.com/rpc/v1/base/YOUR_API_KEY_HERE
Get your API key at: https://portal.cdp.coinbase.com/
-
Start development server
pnpm dev # or npm run devOpen http://localhost:5173 in your browser.
- Swipe left/right on touch devices
- Use arrow keys on desktop
- Verify smooth transitions between all 18 NFTs
- Check that metadata loads for each NFT
- Click "Connect Wallet" button
- Connect a wallet (MetaMask, WalletConnect, etc.)
- Verify your address displays correctly
- Check that your Farcaster profile appears (if logged in)
- Navigate to any NFT
- Click "Mint" button
- Approve the transaction in your wallet
- Verify transaction success and block explorer link
- Check that the NFT appears as "Owned" after minting
- Try minting with insufficient ETH balance
- Try minting an NFT you already own
- Verify appropriate error messages display
- Test on mobile viewport (375px width)
- Test on tablet viewport (768px width)
- Test on desktop viewport (1920px width)
- Verify touch and mouse interactions work correctly
pnpm build
# or
npm run buildPreview the production build:
pnpm preview
# or
npm run previewThis project is configured for Vercel deployment with:
- Edge Functions for OG image generation (
/api/og-image) - Serverless functions for dynamic meta tags (
/api/og) - Automatic HTTPS and CDN distribution
- Environment variable management
-
Install Vercel CLI:
npm i -g vercel
-
Deploy:
vercel
-
Set environment variables in Vercel dashboard:
VITE_BASE_RPC_URL- Your Coinbase RPC endpoint
The /.well-known/farcaster.json file configures this app as a Farcaster Mini App. To use this for your own Farcaster account:
- Update
/.well-known/farcaster.jsonwith your domain and FID - Generate account association signature using Farcaster SDK
- Deploy to your domain
- Verify at
https://yourdomain.com/.well-known/farcaster.json
# Check code style
pnpm check
# or
npm run check
# Fix auto-fixable issues
pnpm check:fix
# or
npm run check:fix# Run TypeScript compiler
pnpm tsc
# or
npm run tscbased-house-heads/
├── api/ # Vercel serverless functions
│ ├── og.ts # Dynamic OG meta tags
│ └── og-image.tsx # OG image generation (Edge Runtime)
├── public/ # Static assets
│ ├── assets/
│ │ ├── heads/ # 18 NFT portrait images
│ │ ├── icons/ # UI icons
│ │ └── fonts/ # Custom fonts (TT Firs Neue)
│ └── .well-known/
│ └── farcaster.json # Farcaster app configuration
├── src/ # React application
│ ├── components/ # React components
│ ├── hooks/ # Custom React hooks
│ ├── config/ # Constants and ABIs
│ ├── App.tsx # Main app component
│ ├── main.tsx # Entry point
│ └── wagmi.ts # Wagmi configuration
├── .env.example # Environment variable template
├── vercel.json # Vercel deployment config
├── vite.config.ts # Vite bundler config
└── package.json # Dependencies and scripts
- Network: Base (Chain ID: 8453)
- Standard: ERC-1155 (multi-token)
- Minter: Zora ETH Minter (
0x04E2516A2c207E84a1839755675dfd8eF6302F0a)
Each of the 18 NFTs has its own contract address configured in src/config/constants.ts.
This project showcases:
- Type-safe Web3 development with Wagmi + Viem + TypeScript
- Modern React patterns (hooks, context, composition)
- State management with React Query (server state) and React state (UI state)
- Custom hook design for reusable blockchain logic
- Error boundary patterns and graceful degradation
- IPFS integration with fallback strategies
- Touch gesture detection and custom event handling
- Responsive design with mobile-first approach
- Edge Functions for dynamic OG image generation
- Monorepo-ready structure with clear separation of concerns
MIT
- Live App: based-house-heads.vercel.app
- Farcaster Documentation: miniapps.farcaster.xyz
- Zora Documentation: docs.zora.co
- Base Network: base.org