Skip to content

corbig/nest-notes-api-example

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.

NPM Version Package License NPM Downloads Travis Linux Coverage Gitter Backers on Open Collective Sponsors on Open Collective

Description

A notes taking API example powered with Nest.

This example provides :

  • A basic Rest API
  • Unit-testing
  • Authentication with role guards
  • Form validation
  • Postgres DB integration
  • Environments configuration
  • Swagger and Compodoc integration
  • CORS and headers securities (with helmet)

Installation

$ npm install

Init Postgre database

# Launching docker container
$ docker-compose -f docker/postgres.yml up -d

# Using Initialisation script (before this, you must run the app once to create tables)
$ psql -H localhost -P 5432 -U postgres -d noteDB -f docker/postgres_init.sql

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Swagger

The app provides a Swagger client to try the note REST API at http://localhost:3000/swagger

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Documentation

# Compodoc
$ npx compodoc -p tsconfig.json -s

Support

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.

Stay in touch

License

Nest is MIT licensed.

About

An example of notes API using Nest NodeJS framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published