The World Will Waffle!!!
A real-time multiplayer trivia platform built on Farcaster, where players compete for prizes in themed quiz games.
- Framework: Next.js 16 with React 19
- Database: PostgreSQL 17 (Docker)
- ORM: Prisma v7 with database adapters
- Web3: Coinbase OnchainKit, Wagmi, Viem
- Social: Farcaster MiniKit, Neynar SDK
- Styling: Tailwind CSS v4
- Package Manager: pnpm
- Node.js ≥ 20.19
- pnpm 9.15+
- Docker (for PostgreSQL)
pnpm installdocker run --name waffles-postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=waffles \
-p 5432:5432 \
-d postgres:17Create a .env file in the project root:
# Database
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/waffles"
# Add your other environment variables here
# NEYNAR_API_KEY=
# NEXT_PUBLIC_APP_FID=
# etc.pnpm prisma migrate devpnpm prisma db seedpnpm devThe app will be available at http://localhost:3000
# Build for production
pnpm build
# Start production server
pnpm start
# Open Prisma Studio (database GUI)
pnpm prisma studio
# Generate Prisma Client
pnpm prisma generate
# Run migrations
pnpm prisma migrate dev
# Lint code
pnpm lint# Check container status
docker ps | grep waffles-postgres
# Stop database
docker stop waffles-postgres
# Start database
docker start waffles-postgres
# View logs
docker logs waffles-postgres
# Remove container (data will be lost)
docker rm -f waffles-postgres# Create a new migration
pnpm prisma migrate dev --name migration_name
# Reset database (⚠️ deletes all data)
pnpm prisma migrate reset
# Pull schema from database
pnpm prisma db pull
# Push schema to database (without migrations)
pnpm prisma db pushwaffles/frontend/
├── prisma/
│ ├── schema.prisma # Database schema
│ ├── generated/ # Generated Prisma Client
│ ├── migrations/ # Database migrations
│ └── seed.ts # Database seeding script
├── src/
│ ├── app/ # Next.js App Router
│ │ └── (platform)/ # Platform routes
│ │ └── game/ # Game-related pages
│ ├── actions/ # Server Actions
│ ├── components/ # React components
│ ├── hooks/ # Custom React hooks
│ └── lib/ # Utilities & configs
│ └── db.ts # Prisma client instance
├── scripts/ # Utility scripts
├── public/ # Static assets
├── prisma.config.ts # Prisma configuration
└── next.config.ts # Next.js configuration
- Farcaster integration for authentication
- Referral system with invite codes
- Waitlist management
- Reward system for inviting friends
- Themed trivia games (Football, Movies, Anime, Politics, Crypto)
- Configurable game parameters (entry fee, prize pool, duration)
- Real-time game status tracking
- Leaderboard system
- Ticket-based entry system (USDC)
- Live gameplay with question rounds
- Scoring with latency-based points
- Real-time chat during games
The database is organized into 4 main layers:
- User & Growth: User accounts, referrals, rewards
- The Arena: Games, questions, themes
- The Action: Tickets, players, answers
- Utils: Chat, notifications
See prisma/schema.prisma for the complete schema.
Ensure all required environment variables are set in your production environment:
DATABASE_URL- Production PostgreSQL connection stringNEYNAR_API_KEY- For Farcaster integrationNEXT_PUBLIC_APP_FID- Your Farcaster app FID- Additional API keys as needed
pnpm buildpnpm startBuilt with ❤️ by the Waffles team