MCPcopy Index your code
hub / github.com/Nasruddin/spring-boot-based-microservices

github.com/Nasruddin/spring-boot-based-microservices @v2.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.0 ↗ · + Follow
197 symbols 395 edges 72 files 7 documented · 4% updated 3mo agov2.0.0 · 2025-03-07★ 325
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

spring-boot-based-microservices

Basic skeleton for Spring Boot Microservices. It includes spring security for basic Auth. Spring cloud gateway is also implemented as an Edge Service. Lots of the spring cloud component integrated.

How to run

  • Navigate to root of the project
    cd spring-boot-based-microservices
  • Build the project
    mvn clean package -DskipTests     

Maven Build

  • Locate the docker directory from the root directory and run docker compose to startup the containers
    cd docker && docker compose up --build

Docker Compose Build

  • Check if all our services are running and healthy
    docker ps

Docker PS

  • Let's check if all the services are up and running. We will reach to eureka server using gateway. Open the browser and hit http://localhost:8443/eureka/web You will need to authenticate yourself before accessing the endpoint.
username : user
password : password

Eureka

  • Now, we have a look at our gateway endpoints configurations as well. Hit http://localhost:8443/actuator/gateway/routes in the browser again and, you should be able to find all the routes configured. Gateway Routes

  • Coming to swagger/openapi specs, here is the address to access them - http://localhost:8443/openapi/swagger-ui.html Swagger OpenApi Specs

  • Please use the below curl to generate the access token with both read and write scope.

curl -k http://writer:secret-writer@localhost:8443/oauth2/token -d grant_type=client_credentials -d scope="course:read course:write" 

Swagger OpenApi Specs Swagger OpenApi Specs

Note : Currently this project uses Spring Authorization server. Keep in mind, I'm planning to enhance the whole OAuth flow because it's in shaky state right now and, you may some face issues. We may also move to keycloak.

These instructions are basic starting point and, the project does lot of other stuff like elastic and mongo configuration etc. Please feel free to play around. I really want to maintain this and keep up-to-date, however my current role doesn't give me enough spare time. Therefore, contributors and their contributions are welcome :)

Extension points exported contracts — how you extend this code

CourseService (Interface)
(no doc) [6 implementers]
api/src/main/java/io/javatab/microservices/api/core/course/CourseService.java
CourseRepository (Interface)
(no doc)
microservices/course-service/src/main/java/io/javatab/microservices/core/course/persistence/CourseRepository.java
StudentRepository (Interface)
(no doc)
microservices/student-service/src/main/java/io/javatab/microservices/core/student/persistence/StudentRepository.java
SearchService (Interface)
(no doc) [5 implementers]
api/src/main/java/io/javatab/microservices/api/core/search/SearchService.java
VoteService (Interface)
(no doc) [5 implementers]
api/src/main/java/io/javatab/microservices/api/core/vote/VoteService.java
StudentService (Interface)
(no doc) [4 implementers]
api/src/main/java/io/javatab/microservices/api/core/student/StudentService.java
CourseCompositeService (Interface)
(no doc) [2 implementers]
api/src/main/java/io/javatab/microservices/api/composite/course/CourseCompositeService.java

Core symbols most depended-on inside this repo

run
called by 11
microservices/vote-service/src/main/java/io/javatab/microservices/core/vote/VoteServiceApplication.java
getHealth
called by 5
spring-cloud/gateway/src/main/java/io/javatab/springcloud/gateway/configuration/HealthCheckConfiguration.java
save
called by 5
microservices/vote-service/src/main/java/io/javatab/microservices/core/vote/persistence/RedisRepository.java
getMessage
called by 3
util/src/main/java/io/javatab/microservices/util/http/HttpErrorInfo.java
getId
called by 3
microservices/course-service/src/main/java/io/javatab/microservices/core/course/persistence/CourseEntity.java
getId
called by 3
microservices/student-service/src/main/java/io/javatab/microservices/core/student/persistence/StudentEntity.java
getVote
called by 2
api/src/main/java/io/javatab/microservices/api/core/vote/VoteService.java
createHttpErrorInfo
called by 2
util/src/main/java/io/javatab/microservices/util/http/GlobalControllerExceptionHandler.java

Shape

Method 124
Class 66
Interface 7

Languages

Java100%

Modules by API surface

microservices/course-service/src/main/java/io/javatab/microservices/core/course/persistence/CourseEntity.java18 symbols
spring-cloud/authorization-server/src/main/java/io/javatab/springcloud/auth/configuration/AuthorizationServerConfig.java9 symbols
util/src/main/java/io/javatab/microservices/util/http/HttpErrorInfo.java7 symbols
microservices/course-composite-service/src/main/java/io/javatab/microservices/composite/course/service/CourseCompositeIntegration.java7 symbols
microservices/student-service/src/main/java/io/javatab/microservices/core/student/persistence/StudentEntity.java6 symbols
util/src/main/java/io/javatab/microservices/util/http/ServiceUtil.java5 symbols
spring-cloud/authorization-server/src/main/java/io/javatab/springcloud/auth/jose/KeyGeneratorUtils.java5 symbols
spring-cloud/authorization-server/src/main/java/io/javatab/springcloud/auth/jose/Jwks.java5 symbols
microservices/course-composite-service/src/main/java/io/javatab/microservices/composite/course/service/CourseCompositeServiceImpl.java5 symbols
util/src/main/java/io/javatab/microservices/util/http/GlobalControllerExceptionHandler.java4 symbols
spring-cloud/gateway/src/main/java/io/javatab/springcloud/gateway/configuration/HealthCheckConfiguration.java4 symbols
spring-cloud/eureka-server/src/main/java/io/javatab/springcloud/eurekaserver/configuration/SecurityConfig.java4 symbols

For agents

$ claude mcp add spring-boot-based-microservices \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page