An AI-powered multiplayer quiz platform with Web3 theming where brains connect through the chain.
- ๐ค AI Generation: Auto-generate quiz questions using Groq's Llama 3.3 70B model
- โ๏ธ Manual Creation: Craft custom questions from scratch with full control
- Real-time Kahoot-style quiz gameplay
- Room code system for easy joining
- Live leaderboards with podium rankings
- Host controls for quiz flow management
- Instant feedback with answer explanations
- Browse community-created quizzes
- Advanced search and filtering
- Sort by popularity, trending, newest
- Play solo anytime at your own pace
- Daily featured challenges
- Detailed Quiz Summary: Question-by-question breakdown with performance stats
- Quiz History: Track all your attempts with dates and scores
- Creator Analytics: Insights into quiz performance and question difficulty
- Personal Stats: Accuracy percentages, total attempts, best times
- Achievement System: 6 unlockable badges
- ๐ฏ First Steps - Complete your first quiz
- โญ Perfect Score - Get 100% accuracy
- โก Speed Demon - Complete quiz in under 60 seconds
- ๐ Quiz Creator - Create your first quiz
- ๐ฅ Social Butterfly - Take 10 different quizzes
- ๐ฅ Streak Master - 5 perfect scores in a row
- Custom display names and avatars
- Personal bio section
- Profile statistics display
- Share results to Twitter/X and Farcaster
- Copy results to clipboard
- Public leaderboards for each quiz
- Frontend: Next.js 15 + React 19
- Styling: Tailwind CSS + shadcn/ui
- Real-time Database: SpacetimeDB (multiplayer sync + persistent storage)
- AI Generation: Groq API (Llama 3.3 70B)
- Language: TypeScript
- Deployment: Vercel-ready
- Node.js 18+ installed
- Groq API key (free tier available at console.groq.com)
- Clone the repository
git clone https://github.com/mrbrightsides/chainedbrain.git
cd chainedbrain- Install dependencies
npm install- Set up environment variables
Create a .env.local file in the root directory:
NEXT_PUBLIC_GROQ_API_KEY=your_groq_api_key_here- Run the development server
npm run dev- Open in browser
http://localhost:3000
chainedbrain/
โโโ src/
โ โโโ app/
โ โ โโโ page.tsx # Main application page
โ โ โโโ layout.tsx # Root layout
โ โ โโโ api/
โ โ โโโ proxy/ # API proxy endpoint
โ โโโ components/
โ โ โโโ ui/ # shadcn/ui components
โ โ โโโ CreateQuiz.tsx # Quiz creation interface
โ โ โโโ LiveSession.tsx # Multiplayer session UI
โ โ โโโ EnhancedGallery.tsx # Quiz gallery with search/filters
โ โ โโโ QuizHistory.tsx # User quiz history
โ โ โโโ Achievements.tsx # Achievement tracking
โ โ โโโ CreatorAnalytics.tsx # Analytics dashboard
โ โ โโโ ProfileEditor.tsx # Profile customization
โ โ โโโ About.tsx # About page
โ โโโ lib/
โ โ โโโ groq/
โ โ โโโ groqService.ts # Groq API integration
โ โโโ spacetime/ # SpacetimeDB client setup
โ โโโ spacetime_module_bindings/ # Auto-generated DB bindings
โโโ spacetime-server/
โ โโโ src/
โ โโโ lib.rs # SpacetimeDB schema & reducers
โโโ public/ # Static assets
โโโ README.md # This file
- Click "Create Quiz" tab
- Choose your mode:
- AI Mode: Enter topic, difficulty, and question count โ AI generates instantly
- Manual Mode: Add questions one by one with custom options
- Review & Start: Preview questions, then start a live session or save to gallery
- Create or select a quiz
- Click "Start Live Session"
- Share the 6-digit room code with players
- Control quiz flow: start questions, show answers, view live rankings
- See final leaderboard with podium
- Click "Join Live" tab
- Enter room code and your nickname
- Wait in lobby for host to start
- Answer questions in real-time
- Compete for top rankings!
- Browse quizzes in "Gallery" tab
- Use search/filters to find topics
- Click "Play Solo" to start
- Complete at your own pace
- Submit score to public leaderboard
- quiz: Quiz metadata, questions, settings
- live_session: Active multiplayer sessions
- participant: Session players and scores
- quiz_attempt: Historical quiz attempts
- user_achievement: Earned badges
- user_stats: Aggregate user statistics
- user_profile: Profile customization
- question_analytics: Question performance data
- daily_challenge: Featured daily quizzes
create_quiz: Save new quizstart_live_session: Initialize multiplayer sessionjoin_session: Add player to sessionsubmit_answer: Record player answerrecord_quiz_attempt: Save quiz historyaward_achievement: Grant badgesupdate_user_stats: Update statisticsset_daily_challenge: Set featured quiz
ChainedBrain embraces Web3 aesthetics with:
- Purple/blue/teal gradient themes
- Chain link motifs throughout the UI
- Smooth animations and transitions
- Responsive design for mobile and desktop
- Clean, modern component architecture
| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_GROQ_API_KEY |
Groq API key for AI generation | Yes |
- Core quiz creation (AI + Manual)
- Live multiplayer sessions
- Public gallery with solo play
- Detailed quiz summaries
- Quiz history tracking
- Achievement system
- Social sharing
- Advanced gallery (search, filters, sorting)
- Creator analytics dashboard
- Profile customization
- Daily challenges
- Enhanced social features
- Team mode (2v2, 3v3)
- Question types (true/false, fill-in-blank)
- Image-based questions
- Leaderboard seasons
- Mobile app
- NFT badges (Web3 integration)
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
- Improve documentation
MIT License - feel free to use this project for your own purposes.
Created by mrbrightsides
Website: rantai.elpeef.com
- Groq for blazing-fast AI inference
- SpacetimeDB for real-time multiplayer capabilities
- shadcn/ui for beautiful UI components
- Vercel for seamless deployment
- The open-source community