Skip to content

Quizzy – An intelligent quiz application built on microservices architecture with AI-powered quiz generation. Users can create, take, and manage quizzes, either from a question bank or dynamically using Google’s Gemini AI.

Notifications You must be signed in to change notification settings

Devansh-sys/Quizzy

Repository files navigation

🎯 Quizzy - Microservices Quiz Platform

License: MIT Java Spring Boot GitHub stars

A distributed quiz platform built with Spring Boot microservices, featuring user authentication, quiz management, and AI-powered question generation.

🌟 Features

  • User Management

    • JWT-based authentication
    • Role-based access control
    • User registration and profile management
  • Quiz System

    • Create and manage quizzes
    • Submit answers and view results
    • Track quiz history
  • Question Bank

    • Categorized questions
    • Multiple question types
    • AI-powered question generation
  • Rate Limiting

    • Redis-based rate limiting
    • Protects AI endpoints
    • Configurable limits

🏗️ System Architecture

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   API Gateway   │◄───►│  Quiz Service   │◄───►|   PostgreSQL   |
└─────────────────┘     └─────────────────┘     └─────────────────┘
        ▲                       ▲
        │                       │
        ▼                       ▼
┌─────────────────┐     ┌─────────────────┐
│  User Service   |     | Question Service |
└─────────────────┘     └─────────────────┘
        ▲                       ▲
        └───────────┬───────────┘
                    │
                    ▼
           ┌─────────────────┐
           |  Service Registry  |
           └─────────────────┘

🛠️ Tech Stack

  • Backend: Java 17, Spring Boot 3.1.1
  • Database: PostgreSQL
  • Authentication: JWT, Spring Security
  • Service Discovery: Eureka
  • API Gateway: Spring Cloud Gateway
  • AI: Google Gemini Pro
  • Caching: Redis
  • Build: Maven

🚀 Quick Start

Prerequisites

  • Java 17+
  • Maven 3.6.3+
  • PostgreSQL 13+
  • Redis 6.2+

Setup

  1. Clone the project

    git clone https://github.com/Devansh-sys/quizzy.git
    cd quizzy
  2. Set up databases

    CREATE DATABASE quiz_db;
    CREATE DATABASE user_db;
    CREATE DATABASE question_db;
  3. Configure services Update application.properties in each service with your database and Redis credentials.

  4. Run services

    # Start services in order
    cd service-registry && mvn spring-boot:run
    cd user-service && mvn spring-boot:run
    cd question-service && mvn spring-boot:run
    cd quiz-service && mvn spring-boot:run
    cd api-gateway && mvn spring-boot:run

📚 API Reference

Authentication

Add JWT token to header:

Authorization: Bearer <token>

Endpoints

User Service

  • POST /api/v1/auth/register - Register user
  • POST /api/v1/auth/authenticate - Login
  • GET /api/v1/users/me - User profile

Quiz Service

  • POST /quiz/create - New quiz
  • GET /quiz/{id} - Get quiz
  • POST /quiz/submit/{id} - Submit answers
  • GET /quiz/user/{userId} - User history

Question Service

  • GET /question/all - All questions
  • POST /question/add - Add question (Admin)
  • GET /question/category/{category} - By category
  • GET /question/generate - AI questions

🔒 Rate Limiting

  • 5 requests/minute per endpoint
  • Uses Redis

🤝 Contributing

  1. Fork the repo
  2. Create feature branch
  3. Commit changes
  4. Push and open PR

✨ Happy Quizzing! ✨

If you find this project useful, please consider giving it a ⭐️

About

Quizzy – An intelligent quiz application built on microservices architecture with AI-powered quiz generation. Users can create, take, and manage quizzes, either from a question bank or dynamically using Google’s Gemini AI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages