/TaskManagement-API

[NestJS] Template Backend API. A task management with an authentication ready.

Primary LanguageTypeScript

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

TASK MANAGEMENT WITH AUTHENTICATION API (Template for NestJS)

Project Setup

NestJS

  • Installation
    npm i -g @nestjs/cli
  • Create New Entities
    # --no-spec = don't generate testfile
    # create module 
    nest g module <noun>
    
    # create service | business logic
    nest g service <noun> --no-spec  
    
    # create controller | routes
    nest g controller <noun> --no-spec 

Database

  • PostgreSQL (TypeOrm)

    • Create PostgreSQL using Docker
    docker run --name postgres-nest -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres
    • [Linux] Systemd activate docker systemctl start docker

    • Run Docker

    docker container start postgres-nest
    • Useful Command
    docker container ls  # list of containers run
    
    docker stop rm <container name>  # stop container
    
    docker container rm <container name>  # delete container

Auth

  • JWT
  • Passport-JWT

Running the app

# development
npm run start

# watch mode
npm run start:dev

# production mode
npm run start:prod

CAVEATE

For the sake of I am using this as a template, .env are uploaded on this repo as well, make sure to add .env.stage.dev & .env.stage.prod to .gitignore once cloned.

License

This project is GPL licensed.