Simple sample Node.JS + TypeScript + PostgreSQL REST API Project for demonstration purposes.
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.
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.
- Install the dependencies
npm install
- Build the Javascript
npm run build
- Create and start the Docker Container with PostgreSQL database
npm run up
- Start the Node.JS Application
npm start
- Stop the Node.JS Application
- Stop and remove the Docker Container with PostgreSQL database
npm run down
- 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
Possible further improvements that should be done to this Application. Consider this as a TODOs list.
- 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)
- 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, ...