How do I handle an assignment like this folder structure wise?

Hi, Just have a very aching problem rn with an assignment I need to work on. Disclaimer: I am not looking for solutions as to code wise and how I should write the code, I am just looking to figure out how I would organize the folder structure for it? Please look through the images they provide some more information.
No description
No description
No description
15 Replies
JavaBot
JavaBot2d ago
This post has been reserved for your question.
Hey @verbose! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
verbose
verboseOP2d ago
If I can sum it up in a single sentence or 2: this is a microservice project using eureka but theres nothing microservice about it?? only a backend, then a frontend theres really no need for microservice in the backend as to my knowledge but I may be wrong
Kyo-chan
Kyo-chan2d ago
There is never any need for microservice. Here it's a little ridiculous, but like the backend could be run as multiple instances that could be deployed and undeployed independantly in a kubernetes.
dan1st
dan1stthis hour
there can be advantages for microservices in some cases, especially when you want to scale some parts without the overhead of scaling others which can be a significant advantage in big applications to a point where it's needed For the folder structure, you probably want a Maven (or Gradle) module per service as well as possibly modules for common code between services - and then use the normal Maven/Gradle folder structure for these modules
verbose
verboseOP22h ago
yeah its ridiculous but its supposed to teach us about microservices with spring, which im being honest its really not going to be doing that with something this simple so like a shared folder for the common code and then every other service its in its own folder with a appropriate name and bundled with Maven that makes sense I had gpt generate something similar but I really want to go the monorepo route for this I dont think seperate repositories will make this easier
dan1st
dan1st22h ago
Do you know what Maven modules are? I don't know whether you actually need common code but you can do that
verbose
verboseOP22h ago
no not really first time hearing it I just searched it up ill give it a read nothing about the services will be common, they each have their own controllers, repository, dtos, service
dan1st
dan1st22h ago
Are you using maven?
verbose
verboseOP22h ago
yeah I will be using maven thats just convention for the class
blood-bank-system/
├── eureka-server/ # Service registry
│ ├── src/
│ │ ├── main/java/com/eureka/server
│ │ │ └── EurekaServerApplication.java
│ ├── resources/application.yml
│ └── pom.xml
├── blood-bank-service/ # Micro-Service 1: Blood Bank API
│ ├── src/
│ │ ├── main/java/com/bloodbank
│ │ │ ├── controller/ # REST Controllers
│ │ │ ├── service/ # Service Layer
│ │ │ ├── entity/ # JPA Entities
│ │ │ ├── repository/ # JPA Repositories
│ │ │ ├── dto/ # Data Transfer Objects
│ │ │ └── BloodBankServiceApplication.java
│ ├── resources/
│ │ ├── application.yml # Eureka Client Config
│ │ ├── validation.properties # Custom Validation Messages
│ └── pom.xml
├── react-frontend/ # Micro-Service 2: React Frontend
│ ├── src/
│ │ ├── components/ # React Components
│ │ ├── services/ # Axios for API Calls
│ │ ├── App.js # Main App Component
│ │ ├── index.js # Entry Point
│ │ ├── routes/ # React Router
│ ├── public/
│ ├── package.json
├── shared-library/ # Shared DTOs or Utilities (optional)
│ ├── src/
│ │ ├── main/java/com/shared
│ └── pom.xml
├── docker-compose.yml # Docker Compose for all services
└── README.md
blood-bank-system/
├── eureka-server/ # Service registry
│ ├── src/
│ │ ├── main/java/com/eureka/server
│ │ │ └── EurekaServerApplication.java
│ ├── resources/application.yml
│ └── pom.xml
├── blood-bank-service/ # Micro-Service 1: Blood Bank API
│ ├── src/
│ │ ├── main/java/com/bloodbank
│ │ │ ├── controller/ # REST Controllers
│ │ │ ├── service/ # Service Layer
│ │ │ ├── entity/ # JPA Entities
│ │ │ ├── repository/ # JPA Repositories
│ │ │ ├── dto/ # Data Transfer Objects
│ │ │ └── BloodBankServiceApplication.java
│ ├── resources/
│ │ ├── application.yml # Eureka Client Config
│ │ ├── validation.properties # Custom Validation Messages
│ └── pom.xml
├── react-frontend/ # Micro-Service 2: React Frontend
│ ├── src/
│ │ ├── components/ # React Components
│ │ ├── services/ # Axios for API Calls
│ │ ├── App.js # Main App Component
│ │ ├── index.js # Entry Point
│ │ ├── routes/ # React Router
│ ├── public/
│ ├── package.json
├── shared-library/ # Shared DTOs or Utilities (optional)
│ ├── src/
│ │ ├── main/java/com/shared
│ └── pom.xml
├── docker-compose.yml # Docker Compose for all services
└── README.md
gpt came up with this
dan1st
dan1st22h ago
Do you just have a single microservice? a frontend isn't really a microservice
verbose
verboseOP22h ago
from the requriements we have 2 microservices one react frontend (which is not) and then a backend microservice yeah I know but the assignment states otherwise 😂
dan1st
dan1st22h ago
wow the tasks perfectly prepares you for the real world make a monolith and call it a microservice I have no more objections
verbose
verboseOP22h ago
ah the dream to work as a java developer such a world were microservices are implemented for something that doesnt even need to be a microservice but for the sake of the name I shall consider this closed thanks for the help @dan1st @Kyo-chan :thumbsupcat:
JavaBot
JavaBot22h ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
JavaBot
JavaBot22h ago
Post Closed
This post has been closed by <@400463761011507212>.
Want results from more Discord servers?
Add your server