Giter Club home page Giter Club logo

nestjs-boilerplate's Introduction

Backend Challenge API

Tech Stack: Node.js, Typescript, Nest.js, PostgreSQL

Requirements

  • Node v16.13.2 or higher
  • Docker and docker compose

Run Application Locally

$ git clone
$ npm install
$ docker compose up
this will start postgres and adminer on local containers
adminer is lighwheight DBMS that runs on browser
-> access adminer on your localhost:8080

* server: db
* username: pgsql
* password: pgsql
* leave the database field empty
(you may change these values on docker-compose.yml following your preferences)

-> create a database with the name of your preference and leave it empty
-> create a .env file on project root following .env.example model and fill
the placeholders with the same values above
$ npm run start:dev

API Docs

[Swagger] http://localhost:300/api-docs

Tests

# unit tests
$ npm run test

# test coverage
$ npm run test:cov

Linter and formatting

# find problems
$ npm run lint

# find and fix problems automatically
$ npm run lint:fix

# format code
$ npm run format

Folder Structure

> src
  > core                            (files that are used all over the API)
     > error                        (files to do the error handling and format API errors)
     > request-interceptor          (Nest.js interceptor to catch errors and do API logging)
     > api-validation.pipe.ts       (Nest.js pipe to validate DTOs)
     > swagger-response.ts          (abstraction to add and reuse swagger responses)

  > modules


  > typings             (contains all the API typings)

  > test
    > integration      (integration tests mocking the database)
    > mocks            (mocks used all over the tests using builder pattern)
    > unit             (unit tests)



nestjs-boilerplate's People

Contributors

hps-matheus avatar hpsmatheus avatar

Watchers

James Cloos avatar  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.