Competer is a Farcaster Mini-App that enables users to create and participate in on-chain contests with automated prize distribution. Built on the Base blockchain using OnchainKit and MiniKit, the platform supports various contest types including hackathons, sports betting, online games, creative challenges, and prediction markets.
- π± Native Mini-App: Runs seamlessly within Farcaster clients
- πΌοΈ Contest Frames: Beautiful, shareable contest cards in Farcaster feeds
- π€ Native Sharing: One-click sharing of contests on Farcaster
- π Farcaster Auth: Login with your Farcaster identity (FID-based)
- β‘ Real-time Updates: Live contest stats and notifications
- Contest Creation: Create contests with configurable parameters (title, description, entry fee, duration, prize mechanism)
- Multiple Contest Types: Support for hackathons, gaming, sports, creative challenges, prediction markets, and custom contests
- Prize Distribution: Automated prize distribution through smart contracts with multiple distribution types:
- Winner takes all
- Top three prizes
- Sponsor-funded rewards
- Wallet Integration: Seamless wallet connection using OnchainKit for Base blockchain
- Real-time Updates: Live contest stats and participant tracking
- Responsive Design: Modern UI that works across desktop and mobile devices
- React 18 with TypeScript
- Vite for build tooling and development
- Tailwind CSS with shadcn/ui components
- Wouter for lightweight routing
- TanStack Query for server state management
- OnchainKit for Coinbase wallet and Base blockchain integration
- Express.js with TypeScript
- PostgreSQL with Drizzle ORM
- Neon for serverless PostgreSQL hosting
- Zod for runtime validation
- Base (Ethereum L2) for low-cost transactions
- Smart Contracts for contest management and prize distribution
- Solidity for contract development
competer-miniapp/
βββ client/ # React frontend
β βββ src/
β β βββ components/ # UI components
β β βββ pages/ # Route pages
β β βββ hooks/ # Custom hooks
β β βββ lib/ # Utilities and configurations
β β βββ main.tsx # App entry point
β βββ index.html
βββ server/ # Express backend
β βββ index.ts # Server entry point
β βββ routes.ts # API routes
β βββ storage.ts # Database operations
β βββ db.ts # Database connection
βββ shared/ # Shared types and schemas
β βββ schema.ts # Database schema and types
βββ contracts/ # Smart contracts
β βββ ContestFactory.sol
β βββ Contest.sol
βββ public/ # Static assets
- Node.js 18+ and npm
- PostgreSQL database (or Neon account)
- Git
- Clone the repository:
git clone https://github.com/Gabrielnvk/competer-miniapp.git
cd competer-miniapp- Install dependencies:
npm install- Set up environment variables:
# Copy example environment file
cp .env.example .env
# Add your database URL
DATABASE_URL="your-postgresql-connection-string"- Set up the database:
npm run db:push- Start the development server:
npm run devThe application will be available at http://localhost:3000.
- Clone the repository:
git clone https://github.com/Gabrielnvk/competer-farcaster-miniapp.git
cd competer-farcaster-miniapp- Install dependencies:
npm install- Deploy to Vercel:
npx vercel --prodSet these in your Vercel dashboard:
DATABASE_URL- Your PostgreSQL database URL (Supabase/Neon)NODE_ENV- Set toproduction
After deployment:
- Update Manifest: Replace URLs in
public/.well-known/farcaster.jsonwith your live domain - Test Frames: Visit
/api/frames/contest/[id]/imageto test frame generation - Submit to Farcaster: Use Farcaster Developer Tools to register your Mini-App
GET /.well-known/farcaster.json- Farcaster manifestGET /api/frames/contest/:id/image- Contest frame imagePOST /api/frames/contest/:id/join- Join contest actionPOST /api/webhooks/farcaster- Farcaster webhook handler
The application uses PostgreSQL with the following main tables:
- users: User profiles with wallet addresses
- contests: Contest information including metadata, prizes, and timing
- contest_participants: Tracks user participation in contests
- contest_winners: Records prize distribution and winners
POST /api/users- Create a new userGET /api/users/wallet/:address- Get user by wallet address
GET /api/contests- List contests with optional filteringPOST /api/contests- Create a new contestGET /api/contests/:id- Get specific contest detailsPOST /api/contests/:id/join- Join a contestGET /api/contests/:id/participants- Get contest participants
GET /api/stats- Get platform statistics
Factory contract for deploying individual contest contracts with standardized functionality.
Individual contest contract managing:
- Entry fee collection
- Prize pool escrow
- Automated distribution
- Winner selection and validation
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and commit:
git commit -m 'Add feature' - Push to your branch:
git push origin feature-name - Submit a pull request
The application is designed to be deployed on Replit with automatic deployment capabilities:
- Connect your Replit account to this repository
- Configure environment variables in Replit
- Use Replit's deployment feature for production hosting
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or support, please open an issue on GitHub or contact the development team.
Built with β€οΈ for the Farcaster ecosystem on Base blockchain.