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.
- 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
- Java 17+
- Spring Boot
- Spring Data JPA
- MySQL Database
- Lombok
GET /allQuestionsβ Get all questionsGET /category/{category}β Get questions by categoryPOST /addβ Add a new question
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
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
- 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
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