/task-management

A Node.js (NestJS Framework) back-end application to manage tasks, that provides a REST API completely document with open-api (swagger). It has 100% unit test coverage. It uses PostgreSQL.

Primary LanguageTypeScriptMIT LicenseMIT

Nest Logo

Build with NestJS framework

Coverage

Task Management

This is a service to manage tasks.

It's necessary to create a user to use the system. A user can only manage his own tasks.

This project is a back-end application using REST API to allow user register, user authentication, and task management.

Description

A Task has the following attributes:

Field name Description Type Default
title Name of task string
description Explanation about the task string
status Current status of the task string, enum: OPEN, IN_PROGRESS, DONE OPEN

Main technologies used

Highlights

  • 100% coverage with unit tests

Requirements

For local usage:

For local usage with Docker:

Running

With Docker

docker-compose up

Application container

docker exec -it taskmanagement_tasks bash

Extras

pgAdmin - PostgreSQL Tools

Optionally, to use pgAdmin:

  • Run:
cd extras && docker-compose up

Without Docker

Be sure to install the requirements. If using nvm, you can easily run:

$ nvm use
  • Create .env file:

    $ cp -v .env.example .env
  • Edit .env file to provide database connection configs.

  • Install dependencies and start the application:

    $ npm install
    
    # development
    $ npm run start
    
    # watch mode
    $ npm run start:dev
    
    # production mode
    $ npm run start:prod

Usage

Consult the API documentation available at swagger (OpenAPI 3.0)

TL;DR

  1. Open Postman application
  2. Import this collection
  3. Set the Postman Environments (use gear or eye buttons on top right):
    • key: taskManagementBaseURL value: http://10.12.0.2:3000 (as default)
    • key: taskManagementToken value: generated_token (generate it from /auth/signin)

Running unit tests

   npm run test:cov
   npm run test

Project Structure

  • Test files are located near the classes they test. This is recommended at Official Documentation.
  • The modules of this project are represented in the image below:

Diagram with the modules structure in this project