Designing around major data entities
The fourth step in router-first architecture is achieving a stateless, data-driven design. To achieve this, it helps a lot to organize your APIs around major data components. This will roughly match how you consume data in various components in your Angular application. We will start off by defining our major data components by creating a rough data entity relationship diagram (ERD). In Chapter 10, RESTful APIs and Full-Stack Implementation, we will design and implement an API for the user data entity using Swagger.io and Express.js.
Defining entities
Let's start by taking a stab at what kind of entities you would like to store and how these entities might relate to one another.
Here's a sample design for LemonMart, created using draw.io:
Figure 7.28: ERD for LemonMart
At this moment, whether your entities are stored in a SQL or NoSQL database is inconsequential. My suggestion is to stick...