Nestjs Bff

screenshot of Nestjs Bff
angular
nestjs

Nestjs Bff

A full-stack TypeScript solution, and starter project. Includes an API, CLI, and example client webapp. Features include production grade logging, authorization, authentication, MongoDB migrations, and end-to-end testing.

Overview:

NestJS-BFF is a full-stack TypeScript solution and starter project that aims to fast-track the development of enterprise-grade, modern NodeJs applications. It follows the Backend for Frontend (BFF) pattern, using NestJS as the primary framework for the backend. The frontend example is built with Angular, but it can be easily adapted to work with other client-side JavaScript frameworks like React or Vue.js. The project is designed as a mono-repo, containing a Backend, companion CLI, Frontend, and companion NPM packages. The core infrastructure is contained in NPM packages for easy updates through a simple NPM update command.

Features:

  • Strongly Typed backend: Leveraging the power of TypeScript, NestJS, and Express, the backend is strongly typed, ensuring a more robust and maintainable codebase.
  • DDD style layered architecture: The project follows a Domain-Driven Design (DDD) style layered architecture with Application Services and composable Domain objects, promoting clean separation of concerns.
  • Comprehensive authentication and authorization system: The library provides an in-the-box authentication and authorization system. It includes JWT authentication for robust and flexible security, as well as social login with Facebook (complete), Google, and Twitter (under development) using the Authorization Code Grant flow.
  • Secured-by-default with 'allow list' approach: The project follows a 'allow list' approach for security, ensuring that only explicitly permitted actions are allowed. This helps to prevent potential security vulnerabilities.
  • Flexible Caching: Leveraging the powerful cache-manager library, NestJS-BFF provides flexible caching options to improve performance and reduce database load.
  • Repository Pattern: The library includes the Repository Pattern out-of-the-box for simple data access.
  • MongoDB Migrations: NestJS-BFF provides easy database seeding and management through MongoDB Migrations.
  • Winston and Console Logger Service: The library includes a Winston and Console Logger Service, making it easy to log and manage application logs.
  • Configuration pattern: The project follows a simple and strongly typed configuration pattern, making it easier to manage and update configurations.
  • e2e Testing pattern leveraging Jest: The project includes an e2e testing pattern that leverages Jest, making it easier to write and run end-to-end tests.

Installation:

To install NestJS-BFF, follow these steps:

  1. Clone the repository:
git clone https://github.com/{repository-name}.git
  1. Install the dependencies:
cd nestjs-bff
npm install
  1. Navigate to the desired module (Backend, Frontend, etc.) and follow the README instructions for detailed installation and usage instructions.

Summary:

NestJS-BFF is a powerful full-stack TypeScript solution and starter project that aims to accelerate the development of enterprise-grade NodeJS applications. It follows a layered architecture, provides comprehensive authentication and authorization features, and includes various other features like caching, logging, and database management. With its strong typing and support for popular frameworks like Angular, NestJS-BFF offers a compelling web development stack. Although the library is currently not actively maintained, it can still serve as a valuable reference for building production-ready apps using NestJS.

angular
Angular

Angular is a TypeScript-based open-source framework by Google for building dynamic single-page applications and cross-platform mobile apps with MVC architecture and a rich set of features.

nestjs
Nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript.

fullstack
Fullstack Boilerplates

A fullstack boilerplate provides a starter application that includes both frontend and backend. It should include database, auth, payments, user roles and other backend services to build a fully featured saas or webapps.

template
Templates & Themes

A template or theme refers to a pre-designed layout or structure that provides a basic framework for building a specific type of application or website. It typically includes good design, placeholder content and functional features, allowing developers to customize and fill in the details according to their specific needs.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.