npm install && npm start
- Import connect.js
- Invoke in start()
- Setup .env in the root
- Add MONGO_URI with correct value
- auth.js
- products.js
Email Validation Regex
/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
- Validate - name, email, password - with Mongoose
- Hash Password (with bcryptjs)
- Save User
- Generate Token
- Send Response with Token
- Validate - email, password - in controller
- If email or password is missing, throw BadRequestError
- Find User
- Compare Passwords
- If no user or password does not match, throw UnauthenticatedError
- If correct, generate Token
- Send Response with Token
- Validation Errors
- Duplicate (Email)
- Cast Error
- helmet
- cors
- xss-clean
- express-rate-limit
Product Store API that manages user and thier store of defferent products
To get a local copy up and running, follow these steps.
In order to run this project you need:
Clone this repository to your desired folder:
cd my-folder
git clone [email protected]
Install this project with:
cd to file
yarn install
To run the project, execute the following command:
npm run dev
You can deploy this project using:
git push main
๐ค Said laasri
- GitHub: @Said-laasri
- Twitter: @saidlaasr
- LinkedIn: SAID LAASRI
- I will add a feature for a new project.
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
If you like this project consider giving it a star โญ๏ธ.
I would like to thank Microverse for giving me the opportunity to work on this project.
- LazyCoders
- Coding Partners
This project is MIT licensed.