Skip to content

Sample Node.JS + TypeScript + PostgreSQL REST API Application

License

Notifications You must be signed in to change notification settings

michalmokros/task-mgmt-app

Repository files navigation

Task Management Application

Simple sample Node.JS + TypeScript + PostgreSQL REST API Project for demonstration purposes.

About

Description

This is a REST API Node.JS Application written in TypeScript with PostgreSQL Database for task management. Each task is assigned to a Project and can have up to 100 Tags. The Tasks can be filtered by their Tags, Projects and all other attributes that they contain. Requests to this Application need to have an Authorization header in the form of a Bearer Token.

How To Use

Available endpoints are described through API Documentation which was done in OpenAPI. To view this documentation go to Editor Swagger and input file openapi.yaml to render the endpoints. Don't forget to use the Authorization header with value Bearer eyJhbGciOiJIUzI1NiJ9.aGVsbG93b3JsZA.vyzLvRb1Wd_T-1Zbh9E9GyqflKi5RFfr2-vinM70Ff0 when testing the endpoints.\

For experiments you can use available pregenerated Postman Collection with already filled authorization, URLs, parameters, queries and bodies.

Configuration

Requirements

Setup

  1. Install the dependencies
    npm install
  2. Build the Javascript
    npm run build
  3. Create and start the Docker Container with PostgreSQL database
    npm run up
  4. Start the Node.JS Application
    npm start

Cleanup

  1. Stop the Node.JS Application
  2. Stop and remove the Docker Container with PostgreSQL database
    npm run down

Development

  • Start the Application through Typescript files
    npm run dev
  • Start the Application with reload on changes in code
    npm run watch
  • Run the linters on the code and fix errors and warnings
    npm run lint
  • Remove all generated files
    npm run clean

Continuation

Possible further improvements that should be done to this Application. Consider this as a TODOs list.

Functionality

  • Tests
  • Static Code Analysis + Coverage Report
  • Run Node.JS Application in Docker Container
  • Create Entity Relationship Diagram for the database
  • Use Advanced Database Manipulation (Migrations and Volume Storage)

Logic

  • Ensure that Project can have some limited number of Tasks
  • Use more advanced pagination(start, cursor) of results for requests that list entities
  • Pump up Authentication/Authorization (Sign Up/In, Reset Password)
  • Security Measures - Rate Limiting, CSRF, HSTS, ...

About

Sample Node.JS + TypeScript + PostgreSQL REST API Application

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published