generator-nn v0.0.4
generator-nn
Yeoman generator for scaffolding NestJs apps.
Prerequisites
node
yarn
ts-node
-> installable by runningyarn global add ts-node
docker
docker-compose
Note 1.
All the following commands can be executed by both yarn and npm.
Note 2.
Please bear in mind that this generator's creator doesn't want to deal with either Microsoft's or Apple's bs, so the generator currently works only on linux 😆.
Installation
First, install Yeoman and generator-nn.
yarn global add yo
yarn global add generator-nn
Then generate your new project:
yo nn
Migrations
Typeorm migrations are handled by the typeorm
script. It can be used in the following manner:
yarn typeorm migration:generate -n <migration-name>
-> Generates a migration based on the added entities;yarn typeorm migration:create -n <migration-name>
-> Creates an empty migration;yarn typeorm migration:run
-> Applies migrations;
Make sure to have the db
service running before running these scripts.
Running the app
There are 2 available environments for running the application: local
and dev
. Note that, in this context,
dev
refers to running all the services by docker-compose
.
Local
The local
environment uses the port 3000
.
- Run
yarn start:dependencies
- In a different console, run
yarn start
Dev
The dev
environment uses the port 3001
.
- Run
yarn start:docker
Test
# unit tests
$ yarn test
# e2e tests
$ yarn test:e2e
Getting To Know Yeoman
- Yeoman has a heart of gold.
- Yeoman is a person with feelings and opinions, but is very easy to work with.
- Yeoman can be too opinionated at times but is easily convinced not to be.
- Feel free to learn more about Yeoman.
License
MIT © miutamihai