Skip to content

Quizizen (Knowledge Competition) is a comprehensive digital civic education quiz platform built with Flutter and Supabase. This application aims to promote civic awareness and education through an engaging, interactive quiz format. The platform provides a gamified learning experience where users can test and expand their knowledge

Notifications You must be signed in to change notification settings

Mahad-Ghauri/Digital_Quiz_Competition_Platform

Repository files navigation

🎮 Digital Quiz Competition Platform

Flutter Firebase Supabase

📋 Table of Contents

✨ Overview

Digital Quiz Competition Platform is a modern, interactive application that revolutionizes the way quiz competitions are conducted. Built with Flutter, it provides a seamless experience across multiple platforms while maintaining high performance and security standards.

🎯 Features

👥 User Management

  • 🔐 Secure Authentication
    • Email/Password login
    • Social media integration
    • Role-based access control
  • 👤 Profile Management
    • Customizable profiles
    • Achievement tracking
    • Performance history

🎯 Quiz Features

  • 📝 Quiz Creation
    • Multiple question types
    • Rich media support
    • Time-based challenges
  • ⚡ Real-time Competition
    • Live leaderboards
    • Instant feedback
    • Score tracking
  • 🏆 Tournament System
    • Custom tournament creation
    • Bracket management
    • Prize distribution

🎨 UI/UX Features

  • ✨ Modern Interface
    • Material Design 3
    • Dark/Light themes
    • Responsive layouts
  • 🎭 Interactive Elements
    • Smooth animations
    • Gesture controls
    • Haptic feedback

📁 Project Structure

lib/
├── Components/          # Reusable UI components
│   ├── buttons/        # Custom button widgets
│   ├── cards/          # Card-based UI elements
│   └── dialogs/        # Modal and popup components
│
├── Controllers/        # Business logic controllers
│   ├── auth/          # Authentication logic
│   ├── quiz/          # Quiz management
│   └── user/          # User management
│
├── Models/            # Data models
│   ├── quiz.dart      # Quiz data structure
│   ├── user.dart      # User data structure
│   └── tournament.dart # Tournament data structure
│
├── Providers/         # State management
│   ├── auth_provider.dart
│   ├── quiz_provider.dart
│   └── theme_provider.dart
│
├── Services/          # API and backend services
│   ├── firebase_service.dart
│   ├── supabase_service.dart
│   └── storage_service.dart
│
├── Utils/            # Utility functions
│   ├── constants.dart
│   ├── helpers.dart
│   └── validators.dart
│
├── Views/            # Screen implementations
│   ├── auth/         # Authentication screens
│   ├── quiz/         # Quiz-related screens
│   └── profile/      # Profile management screens
│
└── Widgets/          # Custom widgets
    ├── common/       # Shared widgets
    └── specific/     # Feature-specific widgets

🛠️ Technical Stack

Core Technologies

graph TD
    A[Flutter] --> B[Firebase]
    A --> C[Supabase]
    B --> D[Authentication]
    B --> E[Firestore]
    C --> F[Database]
    C --> G[Storage]
Loading

Key Dependencies

Category Packages Version
🎨 UI Material Design, Cupertino Icons Latest
🔄 State Provider ^6.1.1
📦 Storage Shared Preferences ^2.2.2
🎥 Media Image Picker, Video Player Latest
✨ Animation Flutter Animate, Lottie Latest

🚀 Getting Started

Prerequisites

# Required Tools
- Flutter SDK >=3.0.0
- Dart SDK
- Android Studio / VS Code
- Firebase CLI
- Supabase CLI

Installation

# Clone the repository
git clone [repository-url]

# Navigate to project directory
cd digital_quiz_competition_platform

# Install dependencies
flutter pub get

# Run the app
flutter run

📱 Platform Support

Android 📱

  • Minimum SDK: 21
  • Target SDK: 33
  • Architecture: ARM, x86

iOS 🍎

  • Minimum Version: iOS 12.0
  • Target Version: iOS 16.0
  • Devices: iPhone & iPad

Web 🌐

  • Modern Browsers Support
  • Progressive Web App Ready
  • Responsive Design

🔧 Setup Guide

Firebase Configuration

  1. Create Firebase Project
  2. Enable Authentication
  3. Set up Firestore
  4. Configure Security Rules

Supabase Setup

  1. Create Supabase Project
  2. Configure Database
  3. Set up Storage
  4. Generate API Keys

📊 Architecture

System Architecture

graph TB
    subgraph Frontend
        A[Flutter UI] --> B[State Management]
        B --> C[Controllers]
    end
    
    subgraph Backend
        D[Firebase] --> E[Authentication]
        D --> F[Firestore]
        G[Supabase] --> H[Database]
        G --> I[Storage]
    end
    
    C --> D
    C --> G
Loading

Authentication Flow

sequenceDiagram
    participant User
    participant App
    participant Firebase
    participant Supabase
    
    User->>App: Login Request
    App->>Firebase: Authenticate
    Firebase-->>App: Auth Token
    App->>Supabase: Validate Token
    Supabase-->>App: User Data
    App-->>User: Success Response
Loading

Quiz Competition Flow

stateDiagram-v2
    [*] --> Registration
    Registration --> WaitingRoom
    WaitingRoom --> ActiveQuiz
    ActiveQuiz --> Results
    Results --> [*]
    
    state ActiveQuiz {
        [*] --> QuestionDisplay
        QuestionDisplay --> AnswerSubmission
        AnswerSubmission --> ScoreUpdate
        ScoreUpdate --> QuestionDisplay
    }
Loading

🔧 Technical Documentation

Database Schema

Users Collection

{
  "users": {
    "userId": {
      "email": "string",
      "displayName": "string",
      "photoURL": "string",
      "role": "string",
      "createdAt": "timestamp",
      "lastLogin": "timestamp",
      "stats": {
        "quizzesTaken": "number",
        "averageScore": "number",
        "rank": "number"
      }
    }
  }
}

Quizzes Collection

{
  "quizzes": {
    "quizId": {
      "title": "string",
      "description": "string",
      "category": "string",
      "difficulty": "string",
      "timeLimit": "number",
      "questions": [
        {
          "question": "string",
          "options": ["string"],
          "correctAnswer": "string",
          "points": "number"
        }
      ],
      "createdBy": "string",
      "createdAt": "timestamp"
    }
  }
}

API Endpoints

Authentication

// Firebase Authentication
POST /auth/signup
POST /auth/login
POST /auth/logout
GET /auth/user

// Supabase Authentication
POST /auth/v1/signup
POST /auth/v1/login
POST /auth/v1/logout
GET /auth/v1/user

Quiz Management

// Quiz Operations
GET /quizzes
POST /quizzes
GET /quizzes/:id
PUT /quizzes/:id
DELETE /quizzes/:id

// Quiz Participation
POST /quizzes/:id/join
POST /quizzes/:id/submit
GET /quizzes/:id/results

Performance Optimization

Caching Strategy

graph LR
    A[User Request] --> B{Cache Check}
    B -->|Hit| C[Return Cached Data]
    B -->|Miss| D[API Request]
    D --> E[Update Cache]
    E --> F[Return Data]
Loading

State Management Flow

graph TD
    A[User Action] --> B[UI Event]
    B --> C[Controller]
    C --> D[Provider Update]
    D --> E[State Change]
    E --> F[UI Update]
    F --> G[Cache Update]
Loading

Security Measures

Authentication Flow

graph TD
    A[Login Request] --> B[Input Validation]
    B --> C[Firebase Auth]
    C --> D[Token Generation]
    D --> E[Token Validation]
    E --> F[Session Creation]
    F --> G[Access Granted]
Loading

Data Protection

  • 🔒 End-to-End Encryption
  • 🛡️ Input Sanitization
  • 🔐 Token-based Authentication
  • 📝 Audit Logging
  • 🚫 Rate Limiting

Error Handling

Error Flow

graph TD
    A[Error Occurs] --> B{Error Type}
    B -->|Network| C[Retry Logic]
    B -->|Auth| D[Re-authenticate]
    B -->|Validation| E[User Feedback]
    B -->|Server| F[Fallback Mode]
Loading

Testing Strategy

Test Coverage

pie
    title Test Coverage Distribution
    "Unit Tests" : 40
    "Integration Tests" : 30
    "UI Tests" : 20
    "Performance Tests" : 10
Loading

📈 Performance Metrics

Key Performance Indicators

Metric Target Current
App Size < 50MB 45MB
Launch Time < 2s 1.8s
Frame Rate 60 FPS 58 FPS
Memory Usage < 100MB 85MB

Optimization Techniques

  1. Image Optimization

    • Lazy loading
    • Caching
    • Compression
  2. State Management

    • Selective rebuilds
    • Memory efficient providers
    • Proper disposal
  3. Network Optimization

    • Request batching
    • Response caching
    • Compression

🤝 Contributing

Development Workflow

  1. Fork the repository
  2. Create feature branch
  3. Commit changes
  4. Push to branch
  5. Create Pull Request

Code Style

  • Follow Flutter style guide
  • Use meaningful variable names
  • Add comments for complex logic
  • Write unit tests

🌟 Join Our Community 🌟

Instagram Linkdeln GitHub


Made with ❤️ by Mahad Ghauri

Contact: mahadghauri222@gmail.com

© 2025 Quzizen All rights reserved.

About

Quizizen (Knowledge Competition) is a comprehensive digital civic education quiz platform built with Flutter and Supabase. This application aims to promote civic awareness and education through an engaging, interactive quiz format. The platform provides a gamified learning experience where users can test and expand their knowledge

Resources

Security policy

Stars

Watchers

Forks

Packages

No packages published