Skip to content

Latest commit

 

History

History
87 lines (61 loc) · 3.77 KB

README.md

File metadata and controls

87 lines (61 loc) · 3.77 KB

Bloody Nose API

Quality Gate Status Duplicated Lines (%) Code Smells Lines of Code Coverage Technical Debt

API for the Bloody Nose app. Live demo here.

Table of Contents

General Information

API rest that manages all user and sessions information for the Bloody Nose application.

Front repository here.

Technologies Used

  • Node
  • Express
  • Typescript
  • Bcrypt
  • Chalk
  • Cors
  • Debug
  • Dotenv
  • Express-validation
  • Fishery
  • Joi
  • JSONwebtoken
  • Mongoose
  • Morgan
  • Multer
  • Nodemon
  • Sharp
  • Jest
  • Supertest

Setup

You will find all the dependencies at the package.json file. Run the command npm install in your CLI to install them.

The command npm run start starts the server in the development mode. You will need to specify a port to open it in a http://localhost address.

The command npm run start:dev starts the server in watch mode.

Endpoints

  • (POST) /users/register -> Must create a new user with an encrypted password. Body -> Its body must have an user object with the following properties: id, username and email.
  • (POST) /users/login -> Log the user into the application. Body -> Its body must return an object with a valid token.

Protected endpoints

  • (GET) /sessions/list -> Retrieves a list of available sessions when te request contains a valid token. It accepts page and style parameters. Body -> Its body must return a list of sessions.
  • (GET) /sessions/session/:id -> Retrieves a session when te request contains a valid token. Body -> Its body must return a session.
  • (POST) /sessions/add -> Allows the user to create a new session. Body -> Its body must return an object with a valid session.
  • (DELETE) /sessions/delete -> Allows the user to delete a session. Body -> Its body must return an object with a delete confirmation message.
  • (PATCH) /sessions/edit/:id -> Allows the user to edit a session. Body -> Its body must return an object with the edited session.

Project Status

Project is: in progress

Room for Improvement

To do:

  • Add endpoint test for the POST and PATCH session endpoints.
  • Refine session schema to narrow the validation fields.
  • Create and endpoint to update user data.

Acknowledgements

  • Many thanks to everyone who supported me along the road that took me here.

Contact

Created by Xavi - feel free to contact me!