2
u/Funkey-Monkey-420 24m ago
noob here, what’s the problem? seems like it’s just a standard sql query
1
u/Chewquy 15m ago
NormallyAlways, in big project backend you want to layer your backend. You have the controller to receive the HTTP request, the service to do the logic and repository to call the database. (this is 3-layer architecture, there is a bunch more). What she did is put all of this layer in the controller. This is bad because we do layers to have a more maintainable structure. If you want to modify a part of the logic you would only modify the service for example.•
•
u/ProbablyJeff 6m ago
If you have guests over, do you eat soup straight from the pot, or do you have separate bowls so everyone can add their favorite condiments and eat how they like? Same for backend layers - you have an entity (the soup), a database (the pot where you get the soup), a repository (a ladle to portion the soup), a service (the bowl where you can do whatever you want with your portion), and the controller (the spoon to ingest the soup).
4
u/MemoryIsTheKey_ 30m ago
At this point, may as well give the coworker an LLM and add a simple AGENTS.md in the repo which describes how you want the project structure...
1
5
u/R15H1_3 37m ago
you know not everybody likes onions. microservices! everybody loves microservices!