Skip to content

GiriGourav/Smart-AI-Based-Quiz-Generator

Repository files navigation

🧠 Smart AI-Based Quiz Generator

AI-Powered Quiz Platform built with Spring Boot Microservices

Java Spring Boot RabbitMQ Keycloak Spring AI

AI-powered quiz generation platform built using Spring Boot Microservices, Spring AI, RabbitMQ, and Keycloak Authentication.


πŸ“– Overview

Smart AI-Based Quiz Generator is a scalable backend system that automatically generates quizzes using Artificial Intelligence.

The platform demonstrates modern backend architecture used in production systems, including:

  • Microservices architecture
  • Event-driven communication
  • AI integration
  • Secure authentication
  • Cloud-native service design

πŸš€ Features

πŸ€– AI Quiz Generation

  • Dynamically generates quiz questions using Spring AI
  • Topic-based quiz creation
  • Automated question generation
  • Intelligent quiz building

πŸ” Secure Authentication

  • Keycloak OAuth2 authentication
  • JWT-based request validation
  • Role-based access control (RBAC)

⚑ Event-Driven Architecture

  • RabbitMQ messaging
  • Asynchronous communication between microservices
  • Decoupled and scalable system design

☁️ Cloud-Native Design

  • Spring Cloud Gateway
  • Service Discovery using Eureka
  • Centralized Configuration with Config Server

πŸ—οΈ System Architecture

System Architecture Diagram

πŸ“Š Quiz Generation Workflow

Quiz Generation Workflow

🧱 Microservices

🌐 API Gateway

Acts as the single entry point for all client requests.

Responsibilities:

  • Routing client requests
  • JWT token validation
  • Forwarding requests to appropriate microservices

πŸ“ Quiz Service

Handles:

  • Quiz creation
  • Quiz management
  • Fetching quizzes
  • Quiz metadata management

πŸ“‚ Category Service

Responsible for:

  • Managing quiz categories
  • Organizing quiz topics
  • Category-based classification

πŸ€– Question Generator Service

Handles AI integration.

Responsibilities:

  • Integrates Spring AI
  • Dynamically generates quiz questions
  • Communicates asynchronously via RabbitMQ

🧭 Service Registry

Implemented using Eureka.

  • Registers all microservices
  • Enables dynamic service discovery

βš™οΈ Config Server

Provides centralized configuration management for all microservices.


🧰 Tech Stack

Layer Technology
Backend Java 21, Spring Boot
Architecture Microservices
Cloud Spring Cloud
Service Discovery Eureka
API Gateway Spring Cloud Gateway
Messaging RabbitMQ
AI Integration Spring AI
Security Keycloak OAuth2
Build Tool Maven

πŸ“‚ Project Structure

Smart-AI-Based-Quiz-Generator
β”‚
β”œβ”€β”€ api-gateway
β”œβ”€β”€ category-service
β”œβ”€β”€ quiz-service
β”œβ”€β”€ questions-generator
β”œβ”€β”€ config-server
β”œβ”€β”€ service-registry
β”‚
└── README.md

πŸ” Authentication Flow

1️⃣ User logs in via Keycloak

2️⃣ Keycloak generates a JWT token

3️⃣ Client sends the token with API requests

4️⃣ API Gateway validates the token

5️⃣ Request is routed to the appropriate microservice


πŸ“‘ Service Communication

πŸ”Ή Synchronous Communication

  • REST APIs between microservices

πŸ”Ή Asynchronous Communication

  • RabbitMQ queues
  • Event-driven messaging between services

▢️ Running the Project

1️⃣ Clone Repository

git clone https://github.com/GiriGourav/Smart-AI-Based-Quiz-Generator.git

2️⃣ Navigate to Project

cd Smart-AI-Based-Quiz-Generator

3️⃣ Start Infrastructure Services

Start these services first:

config-server
service-registry

4️⃣ Start Microservices

category-service
quiz-service
questions-generator

5️⃣ Start API Gateway

api-gateway

πŸ“ˆ Future Improvements

  • Docker containerization
  • Kubernetes deployment
  • Redis caching
  • Distributed tracing (Zipkin / Sleuth)
  • CI/CD pipeline
  • Frontend dashboard
  • API documentation using Swagger / OpenAPI

πŸ‘¨β€πŸ’» Author

Gourav Giri

Backend Developer
Java β€’ Spring Boot β€’ Microservices

GitHub:
https://github.com/GiriGourav


⭐ Support

If you find this project useful, please star the repository ⭐


πŸ“œ License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages