GithubHelp home page GithubHelp logo

ysp0lur / nest-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from smarlhens/nest-boilerplate

0.0 0.0 0.0 3.47 MB

Nest.js boilerplate with CircleCI, Commitizen, Commitlint, Docker-Compose, ESLint, GitHub Actions, Husky, Lint-staged, OpenAPI, Prettier, PostGreSQL, Travis CI, TypeORM

JavaScript 9.20% TypeScript 87.43% Shell 3.36%

nest-boilerplate's Introduction

Nest logo TypeORM logo PostgreSQL logo Jest logo Prettier logo ESLint logo

Docker logo GitHub Actions logo CircleCI logo Travis CI logo

Nest 8 - Boilerplate

GitHub CI CircleCI Build Status Commitizen friendly code style: prettier Conventional Commits GitHub issues GitHub pull requests GitHub stars GitHub forks GitHub contributors GitHub license GitHub code size in bytes GitHub repo size

Table of contents


Getting started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

What things you need to install the software and how to install them :


Installation

  1. Clone the git repository

    git clone https://github.com/smarlhens/nest7-boilerplate.git
  2. Go into the project directory

    cd nest7-boilerplate/
  3. Checkout working branch

    git checkout <branch>
  4. Install NPM dependencies

    npm i
  5. Copy .env.dist to .env

    cp .env.dist .env
  6. Replace the values of the variables with your own

  7. Create Docker images and launch them

    docker-compose up -d --build

What's in the box ?

CircleCI

CircleCI automates your software builds, tests, and deployments.

CircleCI pipeline file: .circleci/config.yml.

For more configuration options and details, see the configuration docs.


Commitizen

commitizen is a command line utility that makes it easier to create commit messages following the conventional commit format specification.

Use git cz instead of git commit to use commitizen.

Add and commit with Commitizen

Configuration file: .czrc.


Commitlint

commitlint checks if your commit messages meet the conventional commit format.

Configuration file: .commitlintrc.json.

In general the pattern mostly looks like this:

type(scope?): subject  #scope is optional

Are you a good commitizen ?


Docker Compose

Compose file: docker-compose.yml.

Containers :

  • PostgreSQL 14
  • pgAdmin 6

Compose file uses .env.


ESLint

ESLint is a fully pluggable tool for identifying and reporting on patterns in JavaScript.

Configuration file: .eslintrc.js.

For more configuration options and details, see the configuration docs.


GitHub Actions

GitHub Actions makes it easy to automate all your software workflows, now with world-class CI/CD. Build, test, and deploy your code right from GitHub. Make code reviews, branch management, and issue triaging work the way you want.

CI workflow file: .github/workflows/ci.yml.


Husky

Husky is a package that helps you create Git hooks easily.

Configuration folder: .husky.


Lint-staged

Lint-staged is a Node.js script that allows you to run arbitrary scripts against currently staged files.

Configuration file: .lintstagedrc.json.


Prettier

Prettier is an opinionated code formatter.

Configuration file: .prettierrc.
Ignore file: .prettierignore.

For more configuration options and details, see the configuration docs.


Travis CI

Travis CI is a hosted continuous integration service used to build and test software projects hosted at GitHub.

Travis build file: .travis.yml.

For more configuration options and details, see the configuration docs.


Running the app

development

npm run start

watch mode

npm run start:dev

production mode

npm run start:prod

Code scaffolding

Run nest generate|g <schematic> <name> [options] to generate a new Nest Element.


Build

Run npm run build to build the project. The build artifacts will be stored in the dist/ directory.


Test

unit tests

npm run test

e2e tests

npm run test:e2e

test coverage

npm run test:cov

Further help

To get more help on the Nest CLI use nest --help or go check out the Nest CLI README.


Useful Docker commands

  1. If you want to check that all containers are up :

    docker-compose ps
  2. Other Docker commands :

    # Start Docker
    docker-compose start
    
    # Restart Docker
    docker-compose restart
    
    # Stop Docker
    docker-compose stop
    
    # Delete all containers
    docker rm $(docker ps -aq)
    
    # Delete all images
    docker rmi $(docker images -q)
  3. How to get a Docker container's IP address from the host ?

    docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <container>
    docker inspect $(docker ps -f name=<service> -q) | grep IPAddress

nest-boilerplate's People

Contributors

dependabot[bot] avatar renovate-bot avatar renovate[bot] avatar smarlhens avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.