Overview
A simple backend server for an e-commerce site. See Live demo.
Available routes
- Public
- GET
/ - GET
/api/products - GET
/api/products/search?title='test' - POST
/api/user/signup - POST
/api/user/signin
- GET
- Private
- GET
/api/products/wishlist - PATCH
api/wishlist/add - DELETE
api/wishlist/remove
- GET
Project setup
Prerequisites
- On your system, you should have
node(v16.14.0 lts) andnpm(v8.3.1) installed. Installnodeandnpmif you don't already have them.
Clone the project
git clone https://github.com/akib22/assignment-backend.git
cd assignment-backend
Install dependencies
Setup environment variables
- Copy the
.env.examplefile and paste it into root in project directory as.env. - Open the
.envfile and set theMONGODB_URL,JWT_SECRET.
Run the project
- Run the project
- Run the project in development node
Run tests
- In watch mode