A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.
NestJS Framework server project generated from official JHipster NodeJS blueprint. This sample project provides CRUD APIs implementation for a simple 'book' entity with title, author, isbn, publised, price as columns.
- dev, prod profiles
- App flow diagram using arkit
- typeorm for database interactions
- unit tests, test coverage reports
- Swagger API documentation
-
$ npm install
For prod database configuration, in src/orm.config.ts change your url connection:
if(process.env.NODE_ENV==='prod'){
ormconfig = {
...
url: 'YOUR CONNECTION URL',
logging: false,
synchronize: commonConf.SYNCRONIZE,
entities: commonConf.ENTITIES,
migrations: commonConf.MIGRATIONS,
cli: commonConf.CLI,
migrationsRun: commonConf.MIGRATIONS_RUN,
};
}
# Generate flow diagram. Below command generates a file named arkit.svg in the folder.
# The command uses npm package arkit.
$ npm run generate-flow-diagram
# development
$ npm run start
# watch mode
$ npm run start:dev
# build and run in production mode
$ set NODE_ENV=prod&& npm run build && npm run start:prod
# run production build with node
$ set NODE_ENV=prod&& node dist/main.js
The app is served on http://localhost:8081.
You can test the APIs using the Swagger API document page in your browser using the url http://localhost:8081/api/v2/api-docs/
You can specify dev or prod NODE_ENV value (default is dev as indicated in .env)
# run lint
$ npm run lint
# fix lint issues
$ npm run lint:fix
# run this and after you can execute debug task in VSCode
$ npm run start:debug
# unit tests
$ npm run test
# lint
$ npm run lint
# fix lint issues
$ npm run lint:fix
# test coverage of unit tests
$ npm run test:cov
# e2e tests with full app coverage report
$ npm run test:e2e
If you have any questions related to this sample application, Please feel free to contact me on LinkedIn, https://www.linkedin.com/in/gunasekhar-matamalam-5b06ab7b/ or e-mail me at [email protected] Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
Nest is MIT licensed.