Skip to content

ditkrg/backend-for-frontends-template

Repository files navigation

Nest Logo

Backend For Frontends is a reusable, production-ready, containerized implementation of the BFF Pattern in TypeScript and Node.js

Package License

Description

The Backend for Frontends implements the BFF pattern. It is intended to conceal access tokens obtained from an Authorization Server from the browser by storing and refreshing access tokens on an intermediary backend through which the client communicates to the APIs. Authentication of the client requests happen through a SAMESITE, Secure, HTTP-Only Cookie.

Installation

$ yarn install

Running the app

# development watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

Environment Variables

PORT=3002 # The port to listen on

Configurations

The app uses uses node-config for configuration, check their wiki to see how to provide configuration values.

A template file example.json can be found in the config directory.

You can also check the types source file to see the allowed configuration values.

License

Nest is MIT licensed.