Skip to content

pesquisaedesenvolvimento/modular-monolithic-api-with-nestjs

Repository files navigation

Backend For Frontend (BFF)

Concepts Used

Modular Monolith

This is architecture design journey

The construction of the application

Installation

Node version used is v16.20.0, so in your terminal run the follow:

npm install or yarn

To start the project

npm run start:dev

Running with Swagger

Once the application is running you can visit http://localhost:3000/api to see the Swagger interface.

See here for more information.

Running with GraphQL

Once the application is running you can visit http://localhost:3000/graphql to see the GraphQL Playground interface.

See here for more information.

Examples

Create

mutation createTest {
  create(
    data: {
      name: "test"
      age: 1
      breed: "raca"
      photo: "https://example-image.jpg"
    }
  ) {
    name
    age
    breed
    photo
  }
}

Get

query test {
  findOne(id: 0) {
    name,
    age,
    photo
  }
}

Docker

Generate image

docker build -t bff-example-image .

Run container

docker run --name bff-example-container -dp 127.0.0.1:3000:3000 bff-example-image

Docker Compose

Up

docker-compose up

Down

docker-compose down

About

Example of architecture monolithic modular with API using NestJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages