Skip to content

Server | Architecture

Mitchell Mastromonaco edited this page Apr 15, 2020 · 4 revisions

Table of Content

Overview

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.

Modules

Controller

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

Service

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.

Repository

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.

Clone this wiki locally