contracts/MembershipNFT.sol(ERC-721): Admin/public mint with price.contracts/RewardToken.sol(ERC-20): Mintable by RunClub for rewards.contracts/RunClub.sol: EmitsRunLoggedand mints rewards per km.
- Install deps:
npm installnpm i -D hardhat @nomicfoundation/hardhat-toolbox @openzeppelin/contracts
- Compile/deploy locally:
npx hardhat compilenpx hardhat node- In another shell:
npx hardhat run scripts/deploy.ts --network localhost
- Configure frontend env (
.env.local):NEXT_PUBLIC_MEMBERSHIP_ADDRESS=0x...NEXT_PUBLIC_REWARD_TOKEN_ADDRESS=0x...NEXT_PUBLIC_RUNCLUB_ADDRESS=0x...NEXT_PUBLIC_URL=http://localhost:3000NEXT_PUBLIC_ONCHAINKIT_API_KEY=...(optional)
- Home: Connect wallet and mint membership or continue local.
- Dashboard: Log runs locally and on-chain. Proof URL simple checks.
- Leaderboard (future): Query
RunLoggedevents and aggregate.
This is a demo Mini App application built using OnchainKit and the Farcaster SDK. Build a waitlist sign-up mini app for your company that can be published to the Base app and Farcaster.
Before getting started, make sure you have:
- Base app account
- A Farcaster account
- Vercel account for hosting the application
- Coinbase Developer Platform Client API Key
git clone https://github.com/base/demos.gitcd demos/minikit/waitlist-mini-app-qs
npm installCreate a .env.local file and add your environment variables:
NEXT_PUBLIC_PROJECT_NAME="Your App Name"
NEXT_PUBLIC_ONCHAINKIT_API_KEY=<Replace-WITH-YOUR-CDP-API-KEY>
NEXT_PUBLIC_URL=npm run devThe minikit.config.ts file configures your manifest located at app/.well-known/farcaster.json.
Skip the accountAssociation object for now.
To personalize your app, change the name, subtitle, and description fields and add images to your /public folder. Then update their URLs in the file.
vercel --prodYou should have a URL deployed to a domain similar to: https://your-vercel-project-name.vercel.app/
Add your production URL to your local .env file:
NEXT_PUBLIC_PROJECT_NAME="Your App Name"
NEXT_PUBLIC_ONCHAINKIT_API_KEY=<Replace-WITH-YOUR-CDP-API-KEY>
NEXT_PUBLIC_URL=https://your-vercel-project-name.vercel.app/Add environment variables to your production environment:
vercel env add NEXT_PUBLIC_PROJECT_NAME production
vercel env add NEXT_PUBLIC_ONCHAINKIT_API_KEY production
vercel env add NEXT_PUBLIC_URL production- Navigate to Farcaster Manifest tool
- Paste your domain in the form field (ex: your-vercel-project-name.vercel.app)
- Click the
Generate account associationbutton and follow the on-screen instructions for signing with your Farcaster wallet - Copy the
accountAssociationobject
Update your minikit.config.ts file to include the accountAssociation object:
export const minikitConfig = {
accountAssociation: {
"header": "your-header-here",
"payload": "your-payload-here",
"signature": "your-signature-here"
},
frame: {
// ... rest of your frame configuration
},
}vercel --prodGo to base.dev/preview to validate your app:
- Add your app URL to view the embeds and click the launch button to verify the app launches as expected
- Use the "Account association" tab to verify the association credentials were created correctly
- Use the "Metadata" tab to see the metadata added from the manifest and identify any missing fields
To publish your app, create a post in the Base app with your app's URL.
For detailed step-by-step instructions, see the Create a Mini App tutorial in the Base documentation.