In this task, I chose to use CommonJS modules to demonstrate my understanding of them. Additionally, I deliberately pushed dev.env to showcase the local variables I worked with.
The backend meets all neccessary requirements:
- /users POST - create user with the next fields: first_name (required, only letters), last_name (only letters), email (required, unique, correct format), phone (correct format), password (hash)
- /login POST - create API for user login by email and password. Use JWT authentication
- /users/:id GET - get 1 user by id.
- /users/:id PUT - update user, add validation. Connect Socket.IO for sending push notifications after user update.
The task includes the following technologies and libraries:
- PostgreSQL Database
- JavaScript
- Node.js/Express.js
- Bctypt
- Joi
- JWT
- Pg
- Socket.io