A Base app/Farcaster Mini App for saying "GM" daily across Base, Celo, and Optimism networks
OnePulse is a Base app/Farcaster Mini App that lets users say "GM" (Good Morning) daily across multiple blockchain networks, track their streaks, and earn rewards in USDC (configurable). Built with modern Web3 technologies, it demonstrates seamless integration between Farcaster, smart contracts, and real-time databases.
- Multi-Chain GM Tracking - Say GM on Base, Celo, and Optimism
- Real-Time Streaks - Track current and highest streaks
- ERC-20 Rewards - Automatic token rewards for daily participation
- Farcaster Integration - Native Mini App experience
- Live Statistics - Real-time updates via SpacetimeDB
| Category | Technology | Version |
|---|---|---|
| Frontend | Next.js, React, TypeScript | 16.0, 19.0, 5.0 |
| Styling | Tailwind CSS | 4.1 |
| Web3 | OnchainKit, Wagmi, Viem, AppKit (Reown) | latest, 2.19, 2.38, 1.8.14 |
| Database | SpacetimeDB | 1.7 |
| Farcaster | MiniApp SDK | 0.2.1 |
| UI | Radix UI, Motion | latest |
app/ # Next.js App Router
βββ api/ # API routes (auth, gm, claims)
βββ layout.tsx # Root layout
βββ page.tsx # Main app page
βββ globals.css # Global styles
components/ # React components
βββ gm-chain-card/ # Per-chain GM UI
βββ providers/ # Context providers
βββ ui/ # Reusable UI components
βββ ...
contracts/ # Solidity smart contracts
hooks/ # Custom React hooks
lib/ # Utilities and configurations
server/ # Rust/SpacetimeDB backend
- Node.js 18+ or Bun
- Coinbase Developer Platform account
- Farcaster account
# Clone repository
git clone https://github.com/nirwanadoteth/onepulse.git
cd onepulse
# Install dependencies
npm install
# Configure environment
cp .env.example .env.local
# Edit .env.local with your API keys
# Start development server
npm run devVisit http://localhost:3000 to see the app.
# Required environment variables
NEXT_PUBLIC_ONCHAINKIT_API_KEY=your_cdp_api_key
NEXT_PUBLIC_ONCHAINKIT_PROJECT_ID=your_cdp_project_id
NEXT_PUBLIC_REOWN_PROJECT_ID=your_reown_project_id
NEXT_PUBLIC_URL=http://localhost:3000
# Smart contract addresses
NEXT_PUBLIC_DAILY_GM_ADDRESS_BASE=0x...
NEXT_PUBLIC_DAILY_GM_ADDRESS_CELO=0x...
NEXT_PUBLIC_DAILY_GM_ADDRESS_OPTIMISM=0x...
NEXT_PUBLIC_DAILY_REWARDS_V2_ADDRESS_BASE=0x...
NEXT_PUBLIC_DAILY_REWARDS_V2_ADDRESS_CELO=0x...
NEXT_PUBLIC_DAILY_REWARDS_V2_ADDRESS_OPTIMISM=0x...
# Neynar
NEYNAR_API_KEY=
# Database
SPACETIMEDB_HOST_URL=
SPACETIMEDB_MODULE=
# Redis
KV_REST_API_URL=
KV_REST_API_TOKEN=
# Signer PK
BACKEND_SIGNER_PRIVATE_KEY=0x...
# Paymaster endpoint from Coinbase (optional)
PAYMASTER_ENDPOINT=graph TD
A[Farcaster Frame] --> B[Mini App SDK]
B --> C[React App]
C --> D[Root Providers]
D --> E[GM Components]
E --> F[Smart Contracts]
F --> G[SpacetimeDB]
- Server Components - Data fetching and static content
- Client Components - Interactive UI and wallet connections
- Custom Hooks - Reusable logic for GM stats, connections
- Context Providers - Global state management
- One GM per UTC day per network
- Automatic streak calculation
- Real-time statistics updates
- Base - Ethereum L2 with low fees
- Celo - Mobile-first blockchain
- Optimism - Optimistic rollup
- ERC-20 token rewards (currently use USDC)
- Automatic claiming
- Reward history tracking
npm dev # Start development server
npm run build # Build for production
npm run typecheck # Run TypeScript checks
npm run check # Run ultracite check
npm run format # Format code with ultraciteThe project maintains high code quality with:
- TypeScript strict mode enabled
- Biome lint and format tools with ultracite settings
- Automated import sorting
- Components:
PascalCase(UserCard) - Hooks:
camelCasewithuseprefix (useGmStats) - Utilities:
camelCase(normalizeChainId) - Constants:
UPPER_SNAKE_CASE(API_TIMEOUT)
npm run build
vercel --prod- Deploy to production domain
- Generate signed manifest at Farcaster Manifest Tool
- Update
minikit.config.tswith signedaccountAssociation - Redeploy
Set production environment variables in your hosting platform:
NEXT_PUBLIC_ONCHAINKIT_API_KEYNEXT_PUBLIC_ONCHAINKIT_PROJECT_IDNEXT_PUBLIC_URL(production domain)- Smart contract addresses
- Architecture Overview
- Farcaster MiniApp Checklist
- OnchainKit Best Practices
- Performance Optimization
- Security Guidelines
- Smart Contracts - DailyGM.sol, DailyRewards.sol
- Component Library - Reusable UI components
- Hooks Reference - Custom React hooks
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes following our coding standards**
- Run quality checks (
npm check) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow TypeScript strict mode
- Use functional components with proper typing
- Implement proper error handling
- Add comments for complex business logic
- Update documentation for new features
# Check manifest is accessible
curl https://your-domain/.well-known/farcaster.jsonEnsure sdk.actions.ready() is called in your Mini App initialization.
- Verify wallet is connected to correct network
- Check sufficient balance for gas fees
- Confirm smart contract addresses are correct
- Verify SpacetimeDB endpoint accessibility
- Check subscription queries are properly formatted
- Ensure event handlers are correctly configured
Note: For detailed troubleshooting, see our Farcaster MiniApp Checklist.
- π Live Demo
- π Farcaster Documentation
- π Reown AppKit
- π OnchainKit
- π Next.js Docs
- π¨ Tailwind CSS
This is a live Farcaster Mini App accessible through Farcaster clients and Base app, as well as via web browsers.
Use at your own risk. This application interacts with blockchain networks and may involve financial transactions.
β Star us on GitHub β’ π Report Issues
