Skip to content
프로젝트

0xb4lamx/nestjs-boilerplate-microservice

GitHub에서 보기

소개

Nestjs 마이크로서비스 보일러플레이트: 이벤트 기반 아키텍처에 DDD, CQRS, 이벤트 소싱 적용

웹 및 앱 개발

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Description

Microservice boilerplate based on NestJS v10, built with TypeScript. Commitizen friendly

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. This project cover both, running on a containerized environment using Docker, or on your local machine.

Guidelines

Setup

Docker Environment

This section will cover the steps to follow for a containerized version of this project.

Prerequisites

Installation

(cd scripts/ && sh build.sh)

The build script Will:

  • Create private network for containers.
  • Configure and deploy MYSQL container.
  • Configure and deploy Adminer container.
  • Configure and deploy EventStore container.
  • Configure and deploy nestjs-boilerplate container.
  • Connect containers to private network.
  • Enables hot-reloading by mounting working directories inside nestjs-boilerplate container.
  • Create and mount data directory to mysql container for persistence under $HOME/mysql-data-dir.
  • Create and mount data directory to EventStore container for persistence under $HOME/eventstore-data-dir.

Usage

Access

  • EventStore:
    • credentials:

      User Password
      admin changeit
  • Adminer
    • Form

      Server User Password Database
      sql-db root root demo-db
  • Microservice Docker Container
        sudo docker exec -it devtest bash
    

Clean up

Soft clean up

(cd scripts/ && sudo sh cleanup.sh)

The cleanup script soft Will:

  • Remove private network.
  • Stop and remove MYSQL container.
  • Stop and remove Adminer container.
  • Stop and remove EventStore container.

Hard clean up

#both commands are equivalent
#option1 
(cd scripts/ && sudo sh cleanup.sh -h)
#option2
(cd scripts/ && sudo sh cleanup.sh --hard)

The cleanup script hard Will:

  • Remove private network.
  • Stop and remove MYSQL container.
  • Stop and remove Adminer container.
  • Stop and remove EventStore container.
  • Delete Mysql data directory.
  • Delete EventStore data directory.

local Environment

This section will cover the steps to follow for a local version of this project.

Prerequisites

PS: in order to start receiving events from the EventStore, you should enable projections. (disabled by default)

Installation

$ npm install

Database setup

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# debug mode
$ npm run start:debug

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Built With

  • Docker - Containerization technology
  • npm - Dependency Management
  • Nest

Future Goals

Add tests;

Contributing

You are welcome to contribute to this project, just open a PR.

License

MIT licensed.

관련 프로젝트 살펴보기

불러오는 중…