The Quiz Microservices Application is a modular and scalable system designed to manage and deliver quizzes. It leverages Spring Boot and a microservices architecture to ensure flexibility, maintainability, and high availability.
- API Gateway: Centralized entry point for managing and routing API requests.
- Question Service: Manages question creation, updates, and retrieval.
- Quiz Service: Handles quiz creation, user assignments, and score management.
- Service Registry: Service discovery for managing microservices.
- Java
- Spring Boot
- Spring Cloud
- Eureka (Service Discovery)
- MySQL
- Feign Client
- Lombok
- Description: Manages and routes API requests.
- Dependencies:
spring-boot-starter-actuator
spring-cloud-starter-gateway
spring-cloud-starter-netflix-eureka-client
- Configuration:
spring.application.name=Api-Gateway server.port=8083 eureka.client.service-url.defaultZone=http://localhost:8761/eureka/ spring.cloud.gateway.routes[0].id=QUESTION-SERVICES spring.cloud.gateway.routes[0].uri=lb://QUESTION-SERVICES spring.cloud.gateway.routes[0].predicates[0]=Path=/question/** spring.cloud.gateway.routes[1].id=QUIZ-SERVICES spring.cloud.gateway.routes[1].uri=lb://QUIZ-SERVICES spring.cloud.gateway.routes[1].predicates[0]=Path=/quiz/**
- Description: Manages questions, including creation, updates, and retrieval.
- Dependencies:
spring-boot-starter-data-jpa
spring-cloud-starter-netflix-eureka-client
spring-boot-starter-web
mysql-connector-j
lombok
- Configuration:
spring.application.name=Question-Services server.port=8081 spring.datasource.url=jdbc:mysql://localhost:3306/trial spring.datasource.username=root spring.datasource.password=12345678 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true eureka.client.service-url.defaultZone=http://localhost:8761/eureka/
- Description: Manages quizzes, including creation, user assignments, and score management.
- Dependencies:
spring-boot-starter-data-jpa
spring-cloud-starter-openfeign
spring-boot-starter-web
mysql-connector-j
lombok
- Configuration:
spring.application.name=Quiz-Services server.port=8082 spring.datasource.url=jdbc:mysql://localhost:3306/trial spring.datasource.username=root spring.datasource.password=12345678 spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect spring.jpa.hibernate.ddl-auto=update spring.jpa.show-sql=true eureka.client.service-url.defaultZone=http://localhost:8761/eureka/
- Description: Eureka server for service discovery.
- Dependencies:
spring-boot-starter-web
spring-cloud-starter-netflix-eureka-server
lombok
- Configuration:
spring.application.name=ServiceRegistry server.port=8761 eureka.client.register-with-eureka=false eureka.client.fetch-registry=false
- Java 21
- Maven
- MySQL
- Clone the repository:
git clone https://github.com/shreyanshagr/Quiz-Microservices-Application.git
- Navigate to the project directory:
cd Quiz-Microservices-Application
- Build the project:
mvn clean install
- Start the Service Registry:
cd ServiceRegistry mvn spring-boot:run
- Start the Question Service:
cd Question-Services mvn spring-boot:run
- Start the Quiz Service:
cd Quiz-Services mvn spring-boot:run
- Start the API Gateway:
cd Api-Gateway mvn spring-boot:run
- Access the API Gateway at
http://localhost:8083
. - Use the following endpoints to interact with the services:
- Question Service:
http://localhost:8083/question
- Quiz Service:
http://localhost:8083/quiz
- Question Service:
- Fork the repository.
- Create your feature branch:
git checkout -b feature/AmazingFeature
- Commit your changes:
git commit -m 'Add some AmazingFeature'
- Push to the branch:
git push origin feature/AmazingFeature
- Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Spring Boot
- Spring Cloud
- Eureka
This README provides an overview of the project, detailed descriptions of each service, installation and running instructions, and guidelines for contributing.