Developing the backend
After this overview of architectures, we can start building the backend. In this sample, which is only an experiment, I've opted for the monolith architecture because it reduces the cold start delays and our backend logic is very small. In your solution, you need to think about the use cases and weigh the benefits and drawbacks of each option.
Defining the functionalities
In the previous chapter, we developed the frontend and hardcoded some data to display static pages. Now, we are going to create the backend to expose the necessary information that will be used by the frontend. Take a look at the following frontend views and what functionalities they will need from the backend:
- Home page: This page requires a list of all available products to display
- Product details: This page requires the detailed information about a product, including the list of user comments
- Shopping Cart: This page needs to display the selected products and allow the user to save or checkout the cart...