A real-time multiplayer quiz platform built with Next.js and Supabase, featuring multiple game modes, public/private rooms, and live leaderboards.
- 🎮 Multiple Game Modes: Quiz, Yes/No, Map, Type-Answer, and Tiles
- 🌍 Public Rooms: Jump into solo quizzes with curated question banks
- 🏠 Private Rooms: Create rooms with invite codes for friends or classrooms
- 👥 Friends System: Send friend requests, manage friendships
- 🎯 Real-time Matches: Live multiplayer gameplay with instant scoring
- 📊 Leaderboards: Per-match and per-room leaderboards
- 👤 User Profiles: Customizable profiles with stats tracking
- 🌐 Multilingual: English, Arabic (RTL), and French support
- Framework: Next.js 15 (App Router)
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth
- Real-time: Supabase Realtime subscriptions
- Styling: CSS Modules
- Deployment: Vercel
- Node.js 18+
- A Supabase project
- Environment variables configured
- Clone the repository:
git clone https://github.com/xamnay/Triviax.git
cd Triviax- Install dependencies:
npm install- Create
.env.localfile in the root directory:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
- Push your code to GitHub
- Go to Vercel and sign in with GitHub
- Click "Add New Project" and import your repository
- Add environment variables in Vercel project settings
- Click "Deploy"
triviax/
├── app/ # Next.js app directory
│ ├── auth/ # Sign in / Sign up pages
│ ├── dashboard/ # Dashboard page
│ ├── profile/ # User profile pages
│ ├── lobby/[roomId]/ # Room lobby & match pages
│ ├── providers/ # Auth & Language context providers
│ └── components/ # Shared UI components
├── components/
│ └── games/ # Game mode components (WorldMap, Tiles, etc.)
├── lib/
│ ├── database/ # Supabase client configuration
│ ├── game/
│ │ ├── rooms/ # Room & match management
│ │ ├── quiz/ # Quiz mode logic
│ │ ├── map/ # Map mode logic
│ │ ├── tiles/ # Tiles mode logic
│ │ ├── typeAnswer/ # Type-Answer mode logic
│ │ └── scoring/ # Scoring algorithms
│ ├── i18n/ # Translations (en, ar, fr)
│ └── profile/ # Profile utilities
└── package.json
Required (add to .env.local locally or to Vercel for production):
NEXT_PUBLIC_SUPABASE_URL- Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY- Your Supabase anon/public key
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLint
- Never commit
.env.localor any environment files - Supabase Row Level Security (RLS) policies protect all database tables
- All sensitive data is stored in environment variables
Private project