Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

3.Microservice Structure

Andriws Luna edited this page May 15, 2021 · 6 revisions

Microservice Struture

In this topic, the structure of a gRPC API microservice created by Upper will be discussed.

We will use the actor service as an example for a topic.

Unlike the monolithic server, a microservice does not have the upper.json file.

Dockerfile

Configuration file for using microservices as Docker containers.

/bin

This folder contains the file serever.dart which is responsible for running the gRPC server as a microservice.

/lib/proto_generated

This folder contains the classes generated by the compilation of the proto3 file. Do not touch them.

/lib/src

This folder contains the files necessary for the microservice to function.

actor_orm.dart

This file contains the static ORM of the actor table to perform all operations with the database.

actor_server.dart

This file implements the gRPC server for the microservice.

actor_service.dart

This class implements the five operations defined in the proto3 file.

connection.dart

This file provides a valid connection to the postgres database. It is not necessary to change it manually, just change the project connection and use the update command to update the connection of all microservices.