Skip to content

Repository files navigation

NestJS Framework Boilerplate (MongoDB)

CI/CD

A local development setup or boilerplate for Nest.js framework with MongoDB and mongo-express using Docker Compose.

Quick Start

  1. Install Node.js - for IDE type checking.
  2. Install Yarn - for IDE type checking.
  3. Install Docker Compose and make sure it is running in the system background.
  4. Clone the app:
git clone git@github.com:dominicarrojado/nestjs-mongodb-boilerplate.git
  1. Install npm packages - for IDE type checking.
cd nestjs-mongodb-boilerplate
yarn install --frozen-lockfile
  1. Add file environment variables. For development it should have name stage.dev.env, where:
  • PORT - application port. (Example: 3000)
  • DB_URL - mongoDb url starting with mongodb+srv:// (in case of Mongo Cloud) or mongodb:// (in case of Mongo). (Example: mongodb+srv://login:password@hostname/dbName?retryWrites=true&w=majority&appName=Cluster0)
  • BOT_TOKEN - bot token given to you by BotFather. For more info please follow the tutorial
  • BOT_NAME - bot name from the tutorial. The name after @ symbol. (Example: for @test_bot we need to use test_bot)
  • WEB_APP_NAME - bot web app name from the tutorial.
  • THRESHOLD_FOR_POINTS - put 1 here.
  • MNEMONIC - mnemonic from TON
  • AUTH_DATE_SEC_TIMEOUT - put 1800
  • POINTS_REWARD - put 5
  • SERVER_ORIGIN - tonalty backend. For example: https://tonalty.localhost.direct:3000/
  1. Build and run the Docker image.
yarn docker-compose:dev
  1. Access the app at http://localhost:3000.
  2. Make file changes and it will automatically rebuild the app.

Running All Tests

yarn docker-compose:test

Running All Tests (with coverage)

yarn docker-compose:test:cov

Running Tests (Watch)

  1. Build and run the Docker image.
yarn docker-compose:test:watch
  1. Make file changes and it will automatically rerun tests related to changed files.

Build For Production

yarn docker-compose:prod

VSCode Extensions

Learn

Learn how to build this setup or boilerplate here.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages