Skip to content

alexmarqs/nestjs-clean-architecture-example

Repository files navigation

NestJS Clean Architecture Example

Notifications microservice built with NestJS + Prisma (MySQL DB for test purposes), following a Clean Architecture approach. If you are coming from Java you can always check some of my other repositories using clean architecture, example: https://github.com/alexmarqs/musicweather-api-clean-architecture!

ci workflow

Installation

$ yarn

Diagram

diagram

Open API (Swagger)

$ yarn start:dev

Then, open your browser and go to http://localhost:3000/api

Kafka

We could use Docker (docker-compose) to run Kafka. However this time we will use Upstash, a Redis-like service (free tier) that also provides a Kafka instance. You can check it out here: https://upstash.com/

Running the app

# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

# run prisma migrations in dev mode
$ yarn prisma:migrate:dev

# open prisma studio
$ yarn prisma:studio

Test

# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov

About

Example of a node microservice with NestJS + Prisma + Clean Architecture (notifications API)

Topics

Resources

Stars

Watchers

Forks