Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š 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


About

🎯 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.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages