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 questionsGET /category/{category}โ Get questions by categoryPOST /addโ Add a new question
๐น Quiz APIs (/quiz)
POST /create?category={category}&numQ={num}&title={title}โ Create a quizGET /get/{id}โ Get quiz questions by quiz IDPOST /submit/{id}โ Submit quiz responses and get score
๐งช Models
Question: Stores question details including options and correct answerQuiz: Stores quiz metadata and associated questionsQuestionWrapper: Used to send questions without revealing correct answersResponse: Used to submit answers for evaluation
โ๏ธ How to Run
- Clone the repository
git clone https://github.com/your-username/quizapp-backend.git cd quizapp-backend - 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- Build the project
npm clean install
- 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