GitHunt
HR

hrishikeshnerkar/Quiz_App-Springboot-Backend

๐ŸŽฏ A simple Spring Boot backend for managing quizzes and questions. Built to explore REST APIs, JPA, and MySQL integration. Features quiz creation, question filtering, and result calculation.

๐Ÿ“š QuizApp Backend

A simple Spring Boot-based backend application for managing quizzes and questions. This project was built to understand the basics of Spring Boot, REST APIs, and JPA.


๐Ÿš€ Features

  • Add and retrieve quiz questions
  • Filter questions by category
  • Create quizzes with random questions
  • Retrieve quiz questions by quiz ID
  • Submit quiz responses and calculate score

๐Ÿ› ๏ธ Technologies Used

  • Java 17+
  • Spring Boot
  • Spring Data JPA
  • MySQL Database
  • Lombok

๐Ÿ“ฆ API Endpoints

๐Ÿ”น Question APIs (/question)

  • GET /allQuestions โ€“ Get all questions
  • GET /category/{category} โ€“ Get questions by category
  • POST /add โ€“ Add a new question

๐Ÿ”น Quiz APIs (/quiz)

  • POST /create?category={category}&numQ={num}&title={title} โ€“ Create a quiz
  • GET /get/{id} โ€“ Get quiz questions by quiz ID
  • POST /submit/{id} โ€“ Submit quiz responses and get score

๐Ÿงช Models

  • Question: Stores question details including options and correct answer
  • Quiz: Stores quiz metadata and associated questions
  • QuestionWrapper: Used to send questions without revealing correct answers
  • Response: Used to submit answers for evaluation

โš™๏ธ How to Run

  1. Clone the repository
    git clone https://github.com/your-username/quizapp-backend.git
    cd quizapp-backend
  2. Configure MySQL Database
    Make sure MySQL is running and create a database named quizapp.
    Update application.properties with your credentials:
spring.datasource.url=jdbc:mysql://localhost:3306/quizapp
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
  1. Build the project
    npm clean install
  2. Run the application
    mvn spring-boot:run

๐Ÿ‘ค Author

Hrishikesh
Full-stack developer passionate about building secure, scalable, and well-documented web applications.
Specialized in Spring Boot, React, and modern authentication flows.
Connect with me on LinkedIn