MCPcopy Index your code
hub / github.com/0xb4lamx/nestjs-boilerplate-microservice

github.com/0xb4lamx/nestjs-boilerplate-microservice @v1.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.0 ↗ · + Follow
187 symbols 332 edges 63 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Description

Microservice boilerplate based on Nest, a framework 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 && sudo 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

  • To access the App home page navigate to http://localhost:3000 [DEFAULT PORT].
  • To access the EventStore Admin UI navigate to http://localhost:2113 [DEFAULT PORT].
  • To access the Adminer UI navigate to http://localhost:8080 [DEFAULT PORT].
  • To change default setting, edit script/dev/evVAr.sh

Access

  • EventStore:
  • credentials:

    User Password
    admin changeit
    - Adminer
    - Form
    Server User Password Database
    sql-db root root b2h-db
    - Microservice Docker Container
    ```bash
    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

# 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

License

Nest is MIT licensed.

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Class 97
Method 84
Function 3
Interface 3

Languages

TypeScript100%

Modules by API surface

src/shared/services/config.service.ts10 symbols
src/snake-naming.strategy.ts9 symbols
src/shared/services/logger.service.ts8 symbols
src/modules/users/services/users.service.ts8 symbols
src/modules/users/controllers/users.controller.ts8 symbols
src/modules/users/repository/user.repository.ts6 symbols
src/modules/users/entities/user.entity.ts6 symbols
src/shared/services/generator.service.ts4 symbols
src/shared/services/aws-s3.service.ts4 symbols
src/modules/users/queries/handlers/get-users.handler.ts4 symbols
src/modules/users/queries/handlers/get-user.handler.ts4 symbols
src/modules/users/events/impl/abstract.event.ts4 symbols

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add nestjs-boilerplate-microservice \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page