Skip to content

Nest API

Roland Schläfli edited this page May 21, 2020 · 9 revisions

Nest API

The Nest API is responsible for fetching data from the Metadata Service and the Poster Service and is used by the Ionic App as the single source of data through the exposed GraphQL API. As the name suggests, the API uses Nest.js, which is

a progressive Node.js framework for building efficient, reliable and scalable server-side applications

The Nest application itself is stateless, meaning that incoming requests are answered by querying the two services for metadata and posters, structuring the data, and returning it whereby no information is stored persistently. Based on that and with the use of Docker, it is easy to scale the application.

While there are two REST services providing all the required data used for Kwiz, introducing this GraphQL API is advantageous because of the following reasons:

  • There is only one endpoint the frontend (Ionic App) needs to query to get the relevant data.
  • The whole application logic is separated from both the user interface and data sources.
  • The interface and resolvers of GraphQL provide a convenient way of querying the data and selecting different fields from objects from different pages of the React application.
  • Substituting or extending the data sources is easy due to the modularized style of the architecture.