Skip to content

Latest commit

 

History

History
52 lines (31 loc) · 3.04 KB

1.overview.md

File metadata and controls

52 lines (31 loc) · 3.04 KB

Overview

Create a backend EASILY!

Even if you are new to the backend, you may know that the backend starts with a system of servers and databases. We help to develop to that level.

A basic backend system can be started with NestJS, Hasura, and Postgres. Postgres is a database to save persistent data, Hasura is a relaying server with query support, and NestJS is an implementing server with business logics.

Here are some descriptions for them used in this boilerplate.

Backend = NestJS + Hasura + Postgres

NestJS

Nest is the TypeScript framework to implement server based on Node.js, and it contains a lot of features, such as OOP (Object Oriented Programming), FP (Functional Programming), and so on.

Please see the official documents to know about NestJS.

In this boilerplate:

  • Nest server is basically an API server, but it serves as a webhook server of Hasura.
  • Nest server handles your data domain and execute main business logics.
  • Nest server is responsible for controlling user permissions, such as validating and issuing access tokens.
  • Nest server is responsible for executing command(creation, update, and deletion) data according to business logic (it corresponds to 'Mutation' in GraphQL).

Hasura

Hasura is a GraphQL engine with database management system, which includes functions that perform the tasks the server needs to do instead. In simple way, it is basically similar to a database administrator system, but as a relaying server, it has functions such as ACTIONS(Webhook), EVENTS(Batch), and User-Permissions(authentication), and of course supports GraphQL functionality for databases.

Please see the official documents to know about Hasura.

In this boilerplate:

  • Hasura is a GraphQL Engine that automatically generates basic CRUD(Query/Mutation) by connecting to databases.
  • Hasura is a database management system that can monitor and manage the database connected.
  • Hasura is a closer server to clients than Nest server, thus, the clients send a request to Hasura.
  • Hasura registers webhook handlers of Nest server, enabling them to run as GraphQL mutation through ACTIONS.
  • Hasura validates permissions to use query and mutation to control users with verification of the access token issued by Nest server.

Postgres

Postgres is an open-source relational database system. In fact, you can use another database system such like MySQL for your purposes, however, Postgres has affinity with NestJS and Hasura at variable examples and supports. Moreover, it is an advanced database system that has many advantages, including ACID compatibility, JSON and JSONB type support, and support for various advanced functions.

Please see the official documents to know about Postgres.

In this boilerplate:

  • Postgres is a database to save data.
  • Nest server connects to Postgres database to query and change data.
  • Hasura connects to Postgres database to query and monitor data.

Example flow of client request