Coder Social home page Coder Social logo

nest-boiler-plate's Introduction

Nest Logo

Description

Nest framework TypeScript starter repository.

Installation

$ pnpm install

Running the app

# development
$ pnpm run start

# development with watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod

Husky

Read docs to install husky here

For first time

# add next command into package.json or run on console
pnpm exec husky

Add commands into .husky folder:

pre-commmit

# copy this into .husky/pre-commmit

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint-staged

commit-msg

# copy this into .husky/pre-commmit

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}

or run these commands manually:

pre-commmit

echo "pnpm lint-staged" > .husky/pre-commit

commit-msg

# use one of both
echo "npx --no -- commitlint --edit ${1}" > .husky/commit-msg
echo "npx --no -- commitlint --edit \$1" > .husky/commit-msg

Migrations

Create a migration

$ npm run migrate:create <path>
$ yarn migrate:create <path>

# example
$ npm run migrate:create src/migrations/migration_name
$ yarn migrate:create src/migrations/migration_name

Generate a migration

$ npm run migrate:g <path>
$ yarn migrate:g <path>

# example
$ npm run migrate:g src/migrations/migration_name
$ yarn migrate:g src/migrations/migration_name

Run a migration

$ npm run migrate:run
$ yarn migrate:run

Revert a migration

$ npm run migrate:rollback
$ yarn migrate:rollback

Migrations scripts with yarn

"typeorm": "ts-node ./node_modules/typeorm/cli",
"migrate:create": "yarn typeorm migration:create",
"migrate:g": "yarn typeorm -d ./src/config/data.source.ts migration:generate",
"migrate:run": "yarn typeorm migration:run -d ./src/config/data.source.ts",
"migrate:rollback": "yarn typeorm -d ./src/config/data.source.ts migration:revert"

Migrations scripts with npm

"typeorm": "ts-node ./node_modules/typeorm/cli",
"migrate:create": "npm run typeorm -- migration:create",
"migrate:g": "npm run typeorm -- -d ./src/config/data.source.ts migration:generate",
"migrate:run": "npm run typeorm migration:run -- -d ./src/config/data.source.ts",
"migrate:rollback": "npm run typeorm -- -d ./src/config/data.source.ts migration:revert"

Recommendations

  • To install ts-node globally
$ npm install -g ts-node
  • Copy migrations scripts into the package.

nest-boiler-plate's People

Contributors

aleoliva2409 avatar

Watchers

 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.