I'm implementing the backend service for my company completely from scratch,
it's a monolith but as we hit the scale we plan to migrate into microservices.
I did not find enough resources in the documentation, that talks about software architecting and practises, specifically given in this context
I would Also like to learn more about design patterns that can be used in this framework
#How do i architect my nestjs backend ?
9 messages · Page 1 of 1 (latest)
This is a pretty broad request, so I'll speak broadly 🙂
With Nest, think of all of your features as self-contained modules. The idea is that when the feature is "complete" it should be pretty easy to take the folder the feature belongs to and drop it into a new Nest project without having to reconfigure too much. Maybe the way the database works, maybe the imports for the module, but generally it should continue to "just work" in a different nest enviornment.
If you plan to split into microservices eventually, I'd highly suggest using Nx and making every feature you have a library, so that when you do split, you already have your features separated and can just point the imports to the correct spot. I'm already doing this with my side project even though I have no intentions of making it a microservice-like application, because the separation of the domains is that helpful
thank you for the response,
I'll look into your project for more reference
Also coming from java and oops world
I did not find anything related to design patterns and practises to follow while creating backend with this technology ?
Would really help if you have any reference or resource for them
What design patterns did you have in mind? Nest is, in the end, another Node framework, so usually looking up things about Node will net you more results, and then you can reframe it to fit the Nest module approach
That's kind of how Nest's modules work. They should be built in a way that you can extend upon them for your need through composition. If you have specific examples/issues it'll be a lot easier to help
Sorry to hop on this late, but I have some difficulties myself understanding how to properly structure my modules.
Maybe a silly question -- but if I notice that I am beginning to have several services in one module calling services within other modules, is that a good indication that perhaps they should all be consolidated under one module?