Skip to content

Poggioli/express-mongoose-study

Repository files navigation

Express-mongoose-study


Build Lint Test Coverage Status

About the project

This is a study project using the express and mongoose libraries, it aims to learn more about creating RESTFULL API's and about non-relational databases, it also serves to learn how to assemble a CI/CD pipeline using github Actions

Stack

  • Node.js v16.13.0
  • Typescript v4.4.4
  • MongoDB

Configuration

Requirements

Resources available

Endpoints /v1:

Items

  • GET /items
  • GET /items/:id
  • POST /items
  • PUT /items/:id
  • DELETE items/:id

Users

  • GET /users/:id
  • POST /users
  • POST /users/authenticate
  • DELETE /users/:id

Roles

  • GET /roles
  • GET /roles/:id
  • POST /roles
  • PUT /roles/:id
  • DELETE /roles/:id

Docker image

To create a docker image of this app just run the follow command

docker build . -t express-mongoose-study &&
docker run -p 3002:3002 express-mongoose-study

The application will respond on port 3002, to test if it went up correctly, just access health endpoint

Getting started

Run locally

npm install &&
docker-compose up mongoDB &&
npm run start:dev

Run tests

npm install &&
npm run test

The results can be seen in coverage/index.html

Run SonarQube quality gate

npm install &&
docker-compose up sonarqube &&
npm run sonar

The results can be seen in localhost:9000

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published