API for the Bloody Nose app. Live demo here.
- General Info
- Technologies Used
- Setup
- Endpoints
- Project Status
- Room for Improvement
- Acknowledgements
- Contact
API rest that manages all user and sessions information for the Bloody Nose application.
Front repository here.
- Node
- Express
- Typescript
- Bcrypt
- Chalk
- Cors
- Debug
- Dotenv
- Express-validation
- Fishery
- Joi
- JSONwebtoken
- Mongoose
- Morgan
- Multer
- Nodemon
- Sharp
- Jest
- Supertest
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.
- (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.
- (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 is: in progress
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.
- Many thanks to everyone who supported me along the road that took me here.
Created by Xavi - feel free to contact me!