QuizApp is a simple quiz application built using Java and Spring Boot. This application allows users to attempt quizzes, manage questions. It was developed as a demo project for learning purposes and does not include update or delete functionalities for quizzes or questions.
The application is built using a microservices architecture with the following four microservices:
- question-service: Manages quiz questions.
- quiz-service: Handles quiz-related operations.
- service-registry: Eureka client for connecting microservices.
- API gateway: A common API gateway to control API calls to specific microservices.
In the service-registry microservice, Eureka client is used for all the microservices to communicate. A Load Balancer is implemented to handle multiple instances of microservices within Eureka.
- Create and attempt quizzes
- Add and manage questions
- View quiz results
- RESTful API endpoints for quiz operations
- Uses Spring Boot for backend development
- Java
- Spring Boot
- Spring Cloud (for microservices management)
- Spring Data JPA
- MySQL Database
- Maven
- FeignClient (used in
quiz-service
to accessquestion-service
API endpoints)
quizApp-demo/
│-- src/
│ ├── main/
│ │ ├── java/com/example/quizapp/
│ │ │ ├── controller/ # Contains REST controllers for handling HTTP requests
│ │ │ ├── service/ # Business logic for quiz management
│ │ │ ├── repository/ # Interfaces for database interactions using JPA
│ │ │ ├── entities/ # Entity classes representing database tables
│ │ ├── resources/
│ │ │ ├── application.properties # Configuration file for database and server settings
│-- src/test/java/com/example/quizapp/ # Unit and integration tests
│-- pom.xml # Maven dependencies and build configuration
│-- README.md # Project documentation
API access is configured in the application.properties
file.
-
quiz-service:
POST /quiz
→ Create a quizGET /quiz
→ Get all quizzesGET /quiz/{id}
→ Get quiz by ID
-
question-service:
POST /question
→ Create a questionGET /question
→ Get all questionsGET /question/{id}
→ Get question by ID
-
API Gateway:
- Routes from a common port
8083
to fetch/quiz/**
and/question/**
endpoints.
- Routes from a common port
Feel free to fork this repository and submit pull requests with improvements!
This project is open-source and available under the MIT License.