SplitBase is a split-payment app built on the Base blockchain. It helps groups quickly split bills at dinners or events and settle using Base Pay (USDC).
- Fast splitting: Enter total amount and participants, and get per-person amount automatically
- Base Pay: Settle with USDC on the Base network
- Real-time status: Live payment status and clear progress
- Sharing: Generate share links and QR codes to invite friends
- NFT receipts: Optionally mint an NFT receipt after completion
- MiniKit integration: Optimized mobile experience
- Next.js 15 - React framework with App Router
- React 18 - UI library with modern hooks and concurrent features
- TypeScript 5 - Type-safe development with strict mode
- Tailwind CSS 3.4 - Utility-first CSS framework with custom design system
- Radix UI - Accessible, unstyled UI primitives
- Dialog, Alert Dialog, Select, Switch, Tabs, Tooltip, Progress
- Custom Design System - Brand-specific colors, gradients, and animations
- Responsive Design - Mobile-first approach with MiniKit optimizations
- React Query (TanStack Query) - Server state management and caching
- React Hook Form - Form handling with Zod validation
- Custom Hooks - Reusable logic for split bills, payments, and notifications
- Motion (Framer Motion) - Smooth animations and transitions
- Custom Animations - Brand-specific keyframes and transitions
- Interactive Elements - Hover effects, loading states, and micro-interactions
- Next.js API Routes - RESTful API endpoints
- Route Structure:
/api/ โโโ bills/ # Bill management โโโ friends/ # Friend management โโโ nft/ # NFT operations โโโ notify/ # Push notifications โโโ split/ # Split bill operations โโโ webhook/ # External integrations
- Redis (Upstash) - In-memory data store with TTL
- Temporary storage for active splits
- Session management
- Real-time data caching
- Data Models:
- SplitBill, Participant, Friend, PaymentTransaction
- NFTReceipt, NotificationPayload
- Split Utilities - Bill calculation and participant management
- Friend Management - Contact list and social features
- Notification System - Real-time updates and push notifications
- NFT Generation - Receipt minting and metadata handling
- Multi-Network Configuration:
- Base Mainnet (Chain ID: 8453)
- Base Sepolia Testnet (Chain ID: 84532)
- USDC Contract Integration:
- Mainnet:
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 - Testnet:
0x036CbD53842c5426634e7929541eC2318f3dCF7e
- Mainnet:
- OnchainKit - Base blockchain integration
- USDC transfer functionality
- Sponsored transactions support
- Transaction status tracking
- Wagmi + Viem - Ethereum wallet integration
- Multi-wallet support
- Transaction signing and broadcasting
- Farcaster Mini App SDK - Social app framework
- Frame SDK - Farcaster Frame integration
- Mobile Optimizations - Safe area handling, native sharing
User Action โ UI Component โ API Route โ Business Logic โ Storage/Blockchain
โ โ โ โ โ
Form Input โ State Update โ HTTP Request โ Validation โ Redis/Contract
โ โ โ โ โ
Real-time โ WebSocket โ Notification โ UI Update โ Success State
- Local State - Form inputs, UI interactions
- Server State - API data, caching, real-time updates
- Blockchain State - Transaction status, USDC balances
- Global State - User preferences, app configuration
- Zod Schema Validation - Type-safe data validation
- Sanitization - XSS prevention and input cleaning
- Rate Limiting - API abuse prevention
- Transaction Verification - Hash validation and confirmation
- Address Validation - Ethereum address format checking
- Amount Validation - USDC decimal precision handling
- Code Splitting - Dynamic imports and lazy loading
- Image Optimization - Next.js Image component
- Bundle Optimization - Tree shaking and dead code elimination
- Redis Caching - Fast data retrieval
- Connection Pooling - Efficient database connections
- Async Operations - Non-blocking I/O operations
- MiniKit Optimizations - Frame-specific performance
- Progressive Web App - Offline capabilities
- Responsive Images - Adaptive image loading
- Next.js 15 - React framework with App Router
- React 18 - UI library
- TypeScript 5 - Type safety
- Tailwind CSS 3.4 - Styling framework
- OnchainKit - Base blockchain integration
- MiniKit - Farcaster Mini App framework
- Wagmi - React hooks for Ethereum
- Viem - TypeScript interface for Ethereum
- Radix UI - Accessible UI primitives
- Lucide React - Icon library
- Motion - Animation library
- React Hook Form - Form handling
- React Query - Server state management
- Redis (Upstash) - Data storage
- Zod - Schema validation
npm install
# or
yarn installCreate a .env.local file and set:
# Base config
NEXT_PUBLIC_ONCHAINKIT_PROJECT_NAME=SplitBase
NEXT_PUBLIC_URL=http://localhost:3000
NEXT_PUBLIC_ICON_URL=http://localhost:3000/icon.png
NEXT_PUBLIC_ONCHAINKIT_API_KEY=your_onchainkit_api_key_here
# Frame metadata
NEXT_PUBLIC_APP_SUBTITLE=A new bill-splitting experience
NEXT_PUBLIC_APP_DESCRIPTION=Quickly split and settle with Base Pay and USDC
NEXT_PUBLIC_APP_TAGLINE=Base Pay splitting, easy settlement
# Redis (optional, for notifications and storage)
REDIS_URL=your_redis_url
REDIS_TOKEN=your_redis_tokennpm run devOpen http://localhost:3000 to view the app.
- Enter a title and description
- Set total amount (USDC) and participant count
- Auto-calculate per-person amount
- Generate share link and QR code
- Join via QR or shared link
- Sign in with Basename (.base)
- Pay USDC via OnchainKit
- Status updates in real time
- Live progress display
- Participant list and status tracking
- Auto notification when completed
- NFT receipt (coming soon)
- Generate/share QR codes
- Copy share links
- Native share API support
- Celebration animation on completion
SplitBase/
โโโ app/ # Next.js App Router
โ โโโ api/ # API routes
โ โ โโโ bills/ # Bill management APIs
โ โ โ โโโ participant/ # Participant operations
โ โ โ โโโ user/ # User bill operations
โ โ โโโ friends/ # Friend management API
โ โ โโโ nft/ # NFT operations API
โ โ โ โโโ create/ # NFT creation
โ โ โ โโโ list/ # NFT listing
โ โ โ โโโ [nftId]/ # Individual NFT operations
โ โ โโโ notify/ # Notification API
โ โ โโโ split/ # Split bill API
โ โ โ โโโ create/ # Create split
โ โ โ โโโ [billId]/ # Individual split operations
โ โ โโโ webhook/ # Webhook handling
โ โโโ components/ # React components
โ โ โโโ ui/ # Reusable UI components
โ โ โ โโโ bottom-navigation.tsx
โ โ โ โโโ create-split-form.tsx
โ โ โ โโโ friend-modal.tsx
โ โ โ โโโ nft-card.tsx
โ โ โ โโโ payment-button.tsx
โ โ โ โโโ receipt-detail.tsx
โ โ โ โโโ split-bill-detail.tsx
โ โ โ โโโ wallet-modal.tsx
โ โ โโโ AppLayout.tsx # Main app layout
โ โ โโโ DemoComponents.tsx # Development components
โ โโโ bills/ # Bills page
โ โโโ create/ # Create split page
โ โโโ friends/ # Friends management
โ โ โโโ leaderboard/ # Friends leaderboard
โ โโโ nfts/ # NFT management
โ โ โโโ [nftId]/ # Individual NFT page
โ โโโ receipts/ # Receipt viewing
โ โ โโโ [billId]/ # Individual receipt
โ โโโ split/ # Split bill management
โ โ โโโ [billId]/ # Individual split
โ โโโ AppContent.tsx # Main app content
โ โโโ globals.css # Global styles
โ โโโ layout.tsx # Root layout
โ โโโ page.tsx # Home page
โ โโโ providers.tsx # Context providers
โ โโโ theme.css # Theme configuration
โโโ components/ # Shared components
โ โโโ magicui/ # Custom UI components
โ โ โโโ animated-gradient-text.tsx
โ โ โโโ aurora-text.tsx
โ โ โโโ border-beam.tsx
โ โ โโโ magic-card.tsx
โ โ โโโ neon-gradient-card.tsx
โ โ โโโ particles.tsx
โ โ โโโ pulsating-button.tsx
โ โ โโโ rainbow-button.tsx
โ โ โโโ typing-animation.tsx
โ โโโ ui/ # Base UI components
โ โโโ alert-dialog.tsx
โ โโโ button.tsx
โ โโโ card.tsx
โ โโโ dialog.tsx
โ โโโ form.tsx
โ โโโ input.tsx
โ โโโ select.tsx
โ โโโ ... # Other UI primitives
โโโ lib/ # Utility libraries
โ โโโ config.ts # Network configuration
โ โโโ friend-utils.ts # Friend management utilities
โ โโโ nft-compositor.ts # NFT composition logic
โ โโโ nft-generation.ts # NFT generation utilities
โ โโโ nft-storage.ts # NFT storage management
โ โโโ nft-types.ts # NFT type definitions
โ โโโ notification-client.ts # Notification client
โ โโโ notification.ts # Notification utilities
โ โโโ redis.ts # Redis client configuration
โ โโโ split-storage.ts # Split bill storage
โ โโโ split-utils.ts # Split bill utilities
โ โโโ types.ts # Core type definitions
โ โโโ utils.ts # General utilities
โโโ public/ # Static assets
โ โโโ hero.png # Hero image
โ โโโ icon.png # App icon
โ โโโ logo.png # App logo
โ โโโ screenshot.png # App screenshot
โ โโโ splash.png # Splash screen
โโโ next.config.mjs # Next.js configuration
โโโ tailwind.config.ts # Tailwind CSS configuration
โโโ tsconfig.json # TypeScript configuration
โโโ components.json # UI components configuration
โโโ package.json # Dependencies and scripts
โโโ README.md # Project documentation
- File-based routing with dynamic segments
- Layout composition for consistent UI structure
- API routes for backend functionality
- Server and client components separation
- Atomic design principles with reusable UI components
- Compound components for complex interactions
- Custom hooks for business logic encapsulation
- Context providers for global state management
- API-first design with RESTful endpoints
- Real-time updates via Redis pub/sub
- Optimistic updates for better UX
- Error boundaries for graceful failure handling
- Multi-network support with configuration-driven approach
- Contract abstraction for USDC operations
- Transaction management with status tracking
- Wallet integration via OnchainKit and Wagmi
- First L2-native bill splitting app on Base network
- USDC-first approach with precise 6-decimal calculations
- Sponsored transactions for seamless user experience
- Real-time blockchain state synchronization
- Farcaster Mini App integration for social discovery
- Friend management system with leaderboards
- Social sharing with QR codes and deep links
- Community-driven features and interactions
- Progressive Web App capabilities for mobile experience
- Real-time collaboration with live updates
- Smart notifications with contextual awareness
- Accessibility-first design with Radix UI primitives
- Serverless API with Redis caching layer
- Edge computing via Vercel deployment
- Real-time sync between frontend and blockchain
- Optimistic updates for instant user feedback
- Gas fee optimization through transaction batching
- Fallback mechanisms for network issues
- Transaction status tracking with user-friendly updates
- Multi-wallet support for maximum compatibility
- Code splitting with dynamic imports
- Image optimization with WebP and responsive loading
- Bundle optimization through tree shaking
- Mobile-first performance optimizations
- Ethereum Mainnet integration for broader adoption
- Polygon for lower gas fees
- Arbitrum for high-performance transactions
- Cross-chain bridges for seamless asset movement
- Friend leaderboards and achievement systems
- Social payments with social media integration
- Group management with roles and permissions
- Event planning with bill splitting integration
- Payment analytics with spending insights
- Group spending patterns and trends
- Personal finance tracking and budgeting
- Tax reporting and export capabilities
- Native iOS app with Apple Pay integration
- Android app with Google Pay support
- Offline capabilities with local storage
- Push notifications for real-time updates
- PostgreSQL migration for persistent data storage
- Microservices architecture for better scalability
- GraphQL API for flexible data querying
- CDN optimization for global performance
- Smart contract upgrades with new features
- Layer 3 solutions for ultra-low fees
- Privacy features with zero-knowledge proofs
- DeFi integration for yield generation
- Smart bill categorization with ML
- Fraud detection using AI algorithms
- Personalized recommendations for users
- Predictive analytics for spending patterns
- SDK development for third-party integrations
- API documentation with interactive examples
- Developer portal with analytics and tools
- Plugin system for extensibility
- Lending protocols for bill financing
- Yield farming with USDC deposits
- Insurance products for payment protection
- Staking rewards for active users
- B2B bill splitting for corporate expenses
- API access for business integrations
- White-label solutions for partners
- Enterprise security and compliance features
- Multi-language support for international users
- Local payment methods integration
- Regional compliance and regulations
- Cultural adaptations for different markets
- Contract Addresses:
- Mainnet:
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 - Testnet:
0x036CbD53842c5426634e7929541eC2318f3dCF7e
- Mainnet:
- Token Standard: ERC-20 USDC with 6 decimal places
- Network: Base (L2 Ethereum rollup)
- Amount Calculation: Precise USDC amount calculation with 6 decimal precision
- Transaction Building: USDC transfer call data generation
- Wallet Integration: Multi-wallet support via OnchainKit
- Transaction Monitoring: Real-time status tracking and confirmation
- Receipt Generation: Optional NFT receipt minting
- Gas Fee Coverage: Optional gas fee sponsorship for users
- Transaction Optimization: Batch transactions for cost efficiency
- Fallback Handling: Graceful degradation for non-sponsored transactions
- Storage Strategy: Temporary storage with TTL (Time To Live)
- Data Types: Strings, Hashes, Lists, Sets
- Key Patterns:
split:{billId}- Split bill dataparticipants:{billId}- Participant listtransactions:{billId}- Transaction recordsfriends:{address}- User friend list
// Core entities and relationships
SplitBill (1) โโ (N) Participant
Participant (1) โโ (1) PaymentTransaction
Participant (1) โโ (1) NFTReceipt
User (1) โโ (N) Friend- Hot Data: Active splits and recent transactions
- Warm Data: User preferences and friend lists
- Cold Data: Completed splits and historical data
- TTL Management: Automatic expiration for temporary data
- WebSocket Integration: Real-time status updates
- Push Notifications: Mobile push for important events
- Email Integration: Optional email notifications
- In-app Notifications: Toast messages and status updates
- Payment Received: When a participant pays
- Bill Completed: When all participants have paid
- Payment Reminder: Automated reminders for pending payments
- Friend Activity: Social notifications for friend interactions
- Metadata Creation: Bill details and participant information
- Image Composition: Dynamic receipt image generation
- IPFS Storage: Decentralized metadata storage
- Contract Minting: ERC-721 token creation
- Verification: On-chain receipt verification
- Dynamic Content: Real-time bill information
- Verification: On-chain proof of payment
- Sharing: Social media integration
- Collection: User receipt gallery
- Code Splitting: Dynamic imports for route-based code splitting
- Image Optimization: Next.js Image component with WebP support
- Bundle Analysis: Webpack bundle analyzer integration
- Lazy Loading: Component and route lazy loading
- Connection Pooling: Efficient Redis connection management
- Query Optimization: Optimized data retrieval patterns
- Caching Layers: Multi-level caching strategy
- Async Operations: Non-blocking I/O operations
- MiniKit Integration: Frame-specific performance optimizations
- Touch Interactions: Optimized touch event handling
- Safe Area: Proper mobile safe area handling
- Progressive Enhancement: Graceful degradation for older devices
- Zod Schemas: Type-safe validation for all inputs
- XSS Prevention: Input sanitization and output encoding
- SQL Injection: Parameterized queries and input validation
- Rate Limiting: API abuse prevention with rate limiting
- Address Validation: Ethereum address format verification
- Amount Validation: USDC decimal precision validation
- Transaction Verification: Hash validation and confirmation
- Contract Verification: Verified smart contract interactions
- Encryption: Sensitive data encryption at rest
- Access Control: Role-based access control (RBAC)
- Audit Logging: Comprehensive activity logging
- Data Privacy: GDPR-compliant data handling
# Build the application
npm run build
# Deploy to Vercel
vercel --prod
# Or use Vercel CLI
vercel# Required environment variables
NEXT_PUBLIC_ONCHAINKIT_PROJECT_NAME=SplitBase
NEXT_PUBLIC_URL=https://your-domain.com
NEXT_PUBLIC_ICON_URL=https://your-domain.com/icon.png
NEXT_PUBLIC_ONCHAINKIT_API_KEY=your_onchainkit_api_key
# Frame metadata
NEXT_PUBLIC_APP_SUBTITLE=A new bill-splitting experience
NEXT_PUBLIC_APP_DESCRIPTION=Quickly split and settle with Base Pay and USDC
NEXT_PUBLIC_APP_TAGLINE=Base Pay splitting, easy settlement
# Redis configuration
REDIS_URL=your_redis_url
REDIS_TOKEN=your_redis_token
# Optional: Analytics
NEXT_PUBLIC_GA_ID=your_google_analytics_id- Domain: Custom domain with HTTPS
- CDN: Global content delivery network
- Redis: Upstash Redis for data storage
- Monitoring: Vercel Analytics and Speed Insights
- SSL: Automatic HTTPS via Vercel
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env.local
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm start- ESLint: Code quality and consistency
- Prettier: Code formatting
- TypeScript: Type checking
- Hot Reload: Fast development iteration
- TypeScript: Strict mode enabled
- ESLint: Comprehensive linting rules
- Prettier: Consistent code formatting
- Git Hooks: Pre-commit validation
- Unit Tests: Component and utility testing
- Integration Tests: API endpoint testing
- E2E Tests: User flow testing
- Performance Tests: Load and stress testing
- GitHub Actions: Automated testing and deployment
- Vercel Integration: Automatic deployments on push
- Environment Management: Staging and production separation
- Rollback Strategy: Quick rollback capabilities
- Core Web Vitals: LCP, FID, CLS tracking
- Bundle Analysis: Webpack bundle size monitoring
- Error Tracking: Sentry integration for error monitoring
- User Analytics: Anonymous usage analytics
- Transaction Success Rate: Payment success tracking
- Gas Fee Analysis: Cost optimization monitoring
- Network Health: Base network status monitoring
- Contract Events: Smart contract interaction tracking
- Ethereum Mainnet integration for broader adoption
- Polygon for lower gas fees
- Arbitrum for high-performance transactions
- Cross-chain bridges for seamless asset movement
- Friend leaderboards and achievement systems
- Social payments with social media integration
- Group management with roles and permissions
- Event planning with bill splitting integration
- Payment analytics with spending insights
- Group spending patterns and trends
- Personal finance tracking and budgeting
- Tax reporting and export capabilities
- Native iOS app with Apple Pay integration
- Android app with Google Pay support
- Offline capabilities with local storage
- Push notifications for real-time updates
- PostgreSQL migration for persistent data storage
- Microservices architecture for better scalability
- GraphQL API for flexible data querying
- CDN optimization for global performance
- Smart contract upgrades with new features
- Layer 3 solutions for ultra-low fees
- Privacy features with zero-knowledge proofs
- DeFi integration for yield generation
- Smart bill categorization with ML
- Fraud detection using AI algorithms
- Personalized recommendations for users
- Predictive analytics for spending patterns
- SDK development for third-party integrations
- API documentation with interactive examples
- Developer portal with analytics and tools
- Plugin system for extensibility
- Lending protocols for bill financing
- Yield farming with USDC deposits
- Insurance products for payment protection
- Staking rewards for active users
- B2B bill splitting for corporate expenses
- API access for business integrations
- White-label solutions for partners
- Enterprise security and compliance features
- Multi-language support for international users
- Local payment methods integration
- Regional compliance and regulations
- Cultural adaptations for different markets
- MiniKit Documentation - Farcaster Mini App framework
- OnchainKit Documentation - Base blockchain integration
- Base Developer Docs - Base network development
- USDC on Base - USDC token information
- Base Discord - Developer community
- Farcaster Discord - Social protocol community
- Base Builders - Builder resources and grants
- Base Pay - Base payment solution
- Farcaster - Decentralized social protocol
- Mini Apps - Mini application ecosystem
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project follows the Contributor Covenant Code of Conduct.
This project is licensed under the MIT License - see the LICENSE file for details.
- Base Team - For building an amazing L2 ecosystem
- Farcaster Team - For the social protocol infrastructure
- OnchainKit Team - For the blockchain integration tools
- Open Source Community - For the amazing tools and libraries
SplitBase - Making bill splitting simple, social, and secure on Base. ๐