Fullstack NestJS

Welcome!


DRAFT: The Final Outcome

We are going to build and deploy a fully tested, secure REST API for a feature within our domain model using NestJS.

DRAFT: The Outline

Domain Driven Design (DDD)

Demos

Monorepo and Tooling

Demos

Nest Framework Tour

Demos

REST API

Demos

TypeORM and Databases

Demos

Authentication and Authorization

Demos

Configuration

Demos

API Testing

Demos

Deploying

Demos


The App

TLDR

The API layers consists for four standalone APIs that allow for CRUD operations on their domain models. Authentication happens at the Users API and provides authorization for the other features. Each API uses TypeORM to persist data to the data layer. Each API is independently deployed into their own standalone docker containers.

PHASE ONE

We have four features that we are going to expose with standalone APIs.

The users API will also handle the authentication functionality given the conceptual overlap.

We all of the APIs to authenicate with the users api before being able to do any kind of write operation such as create, update, or delete.

If possible, we want to add in a user role which would allow us to provide additional authorization mechanisms based on the rule. For instance, only an admin can create new users or perform a delete operation.

Each endpoint will be deployed in a standalone docker container.

We want to allow for the endpoints to be dynamically configured using environment variables and the built in Nest config service.

We will use sqlite as our data layer.

PHASE TWO

We want to expose a fedarated endpoint that composes the data from the other endpoints using GraphQL that will also be deployed in a standalone docker container.

PHASE THREE

We want to introduce a DEV and PROD environments.

We want to show how to deploy the APIs using Terraform.

We want to illustrate an ascending matrix of deployment options.

We will move our data layer into a legitimate database i.e. Postgres.

PHASE FOUR

TBD

Introduction

There has never been a better time to be a programmer and our mission is to help as many people as possible go as far as possible in this industry. In programming, coupling is usually considered something to avoid as it is an anti-pattern. It makes things less portable. Less scalable.

When it comes to people, the opposite is usually especially in the context of the right people. Our success is deeply coupled to the attention, generosity, and ideas of many, many programmers that were just a little further along their journey. We want to join ourselves to this virtuous circle by sharing some of the techniques and principles we have found to especially effective when developing at scale.

It is borderline ludicrous to try to teach enterprise development in a workshop setting. The very phrase enterprise development gets its name because of the context surrounding it. It is challenging to truly wrap your mind around the scale, complexity, nuances, etc of enterprise development until you are in the thick of it. How do you condense chaotic large-scale development into a neat, tightly packaged workshop? The examples just have a way of coming across as too silly or too complicated because the context isn't quite right.

With that said, we are asking you to suspend disbelief just a little bit and try to focus on the larger concepts at play. Enterprise development can be overwhelming but learning to be just a little bit enterprisey can be a lot of fun!

The Code

You can download the source code for the workshop at this GitHub link.

What to Expect

The examples in this book serve as more of a scratch-pad than a gold plated canonical reference manual. Our ultimate goal is to embark upon a journey that shows you how to start thinking about the realities of putting an enterprise-grade product in the market place.

There are a few pressing questions on our mind when we develop that will serve as the backdrop to the workshop.

Prerequisites

We recommend that you have the latest stable version (LTS) of Node installed .

The JavaScript ecosystem is "dynamic" and we ran into some significant problems using the latest features (current) version of Node.

Workshop Chapters

Feedback Wanted

We are always looking for ways to improve our documentation and workshops. If you have any feedback, please let us know by filling out 👉 this form. 👈

console.log(`Let's go!`);

Challenges

Clone the repository and make sure you can serve the portal application.

npm run s:portal-feature

Then switch to the starter branch for the workshop.

git checkout workshop/nest-start
< Nest Home