-
Notifications
You must be signed in to change notification settings - Fork 0
Server | Architecture
The backend server is divided into four main sections.
The first section is the Express controllers which allow for setting up routes and interfacing with the client.
The second section is the services which are an abstraction layer to lighten the load on the next section.
The third section is the repositories which are the interface between Type ORM entities and the database.
Finally, there are the entities. See the database description for a detailed definition of each table in the database.
The controllers are where all the routing is set up for proper RESTful APIs. It adds a base of consistency to the rest of the backend and is there to receive and send messages to the client. For more information about the existing routes and the conventions for adding new routes, see endpoints
The services do all the heavy-lifting within the backend. Whereas the repository might sometimes set up some queriesm the service directs all the traffic to the different necessary repositories, makes sure the user is properly authentified and that the entities are properly retrieved. Furthermore, any logic necessary to be done to an entity will be done here.
The repository is the last line of defense before accessing the database. It mostly just sends SELECT queries to retrieve the necessary entities through the connection provider.