Skip to content

Boilerplate app to demonstrate Node.js REST API with Express.js framework, The app contains User and Book entities with relations, Sequelize, Postgres, Jest tests, validation, Docker Compose for easy startup. Look at Readme.md file.

Notifications You must be signed in to change notification settings

bgmirko/nodejs-express-rest-api

Repository files navigation

book-management-q-software

Run the project

  1. In root of project run: "docker-compose up --build -d"

  2. To enter into server bash: "docker exec -it book-management-q-software-app-1 sh"

(check container name with: docker ps -a)

  1. Change directory: "cd src/database"

Database tables will be created programmatically (in step 1) it is not necessary to have migrations

  1. To fill database tables with data, in shell run seeders: "npx sequelize-cli db:seed:all"

Swagger documentation and Postman

Swagger documentation is visible on address http://localhost:3000/api-docs/ I made this documentation to have description of all routs and payloads and it is show case how that is implementing. To go deep in creation of full documentation is time consuming. Some routes requires/are gard with Auth header and require user login to use those routes.

The best way to test solution is to use Postman collection and environment from src/utils/postman folder. In those routes is included Auth header and this tool is out of the books for testing.

Run Jest test

note: For Jest tests docker-compose will create separate database

  1. Project should be in running state: "docker-compose up -d --build"

  2. Install jest in root of project with command: "yarn add jest"

  3. To run tests, in root of project run: "yarn run test"

About

Boilerplate app to demonstrate Node.js REST API with Express.js framework, The app contains User and Book entities with relations, Sequelize, Postgres, Jest tests, validation, Docker Compose for easy startup. Look at Readme.md file.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published