Skip to content

xamnay/Triviax

Repository files navigation

Triviax - Quiz Game Platform

A real-time multiplayer quiz platform built with Next.js and Supabase, featuring multiple game modes, public/private rooms, and live leaderboards.

Features

  • 🎮 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

Tech Stack

  • Framework: Next.js 15 (App Router)
  • Database: Supabase (PostgreSQL)
  • Authentication: Supabase Auth
  • Real-time: Supabase Realtime subscriptions
  • Styling: CSS Modules
  • Deployment: Vercel

Getting Started

Prerequisites

  • Node.js 18+
  • A Supabase project
  • Environment variables configured

Installation

  1. Clone the repository:
git clone https://github.com/xamnay/Triviax.git
cd Triviax
  1. Install dependencies:
npm install
  1. Create .env.local file in the root directory:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
  1. Run the development server:
npm run dev
  1. Open http://localhost:3000 in your browser

Deployment

Deploy to Vercel

  1. Push your code to GitHub
  2. Go to Vercel and sign in with GitHub
  3. Click "Add New Project" and import your repository
  4. Add environment variables in Vercel project settings
  5. Click "Deploy"

Project Structure

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

Environment Variables

Required (add to .env.local locally or to Vercel for production):

  • NEXT_PUBLIC_SUPABASE_URL - Your Supabase project URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY - Your Supabase anon/public key

Scripts

  • npm run dev - Start development server
  • npm run build - Build for production
  • npm run start - Start production server
  • npm run lint - Run ESLint

Security

  • Never commit .env.local or any environment files
  • Supabase Row Level Security (RLS) policies protect all database tables
  • All sensitive data is stored in environment variables

License

Private project

About

A multiplayer quiz game platform built with Next.js and Supabase, featuring public rooms, private rooms, friend system, and real-time match gameplay.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages