Support Local is THE one-stop shop for all things local. It compiles all local businesses, and services in an easy-to-use portal and allows them to offer their products and services to customers through the platform.
This is the backend repository for the Support Local web application built upon Node.js with RESTful APIs developed using Express. Data for the application is stored on MongoDB. Integration tests are written with Jest.
Main App Link: https://support-local-frontend.onrender.com/
Frontend Repository: https://github.com/xavierkoo/support-local-frontend
- Express
- Node.js
- MongoDB
- Jest
git clone git@github.com:xavierkoo/support-local-backend.git
npm install
MONGODB_URI=mongodb://[username:password@]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
PORT=3001
npm run dev
npm run lint
You may make API calls to the server locally via localhost:3001
.
https://support-local-backend.onrender.com/api
GET: /merchants
Send: NIL
Receive: All Merchant Objects || Response Code - 404
GET: /merchants/:id
Send: merchantId (ObjectId)
Receive: Specific Merchant Object || Response Code - 404
PATCH: /merchants/:id
Send: merchantId (ObjectId), productId (ObjectId Array)
Receive: Updated Merchant Object, Response Code - 204 || Exception
GET: /orders
Send: NIL
Receive: All Order Objects || Response Code - 404
GET: /orders/:id
Send: orderId (ObjectId)
Receive: Specific Order Object || Response Code - 404
POST: /orders
Send: user (ObjectId), orderDate (String), orderStatus (String), products (ObjectId Array), deliveryDate (String)
Receive: New Order Object Response Code - 201 || Exception
PATCH: /orders/:id
Send: orderStatus (String)
Receive: Updated Order Object, Response Code - 204 || Exception
GET: /products
Send: NIL
Receive: All Product Objects || Response Code - 404
GET: /products/:id
Send: productId (ObjectId)
Receive: Specific Product Object || Response Code - 404
POST: /products
Send: name (String), price (Number), specialPrice (Number), category (String), rating (Number), imgUrl (String), numberSold (Number), productDesc (String), productSpec (String Array), merchant (ObjectId), reviews (ObjectId Array)
Receive: New Product Object, Response Code - 201 || Exception
GET: /products/:id
Send: productId (ObjectId)
Receive: Specific Product Object, Response Code - 204 || Exception
PATCH: /products/:id
Send: name (String), price (Number), specialPrice (Number), category (String), rating (Number), imgUrl (String), numberSold (Number), productDesc (String), productSpec (String Array), merchant (ObjectId), reviews (ObjectId Array)
Receive: Updated Order Object, Response Code - 204 || Exception
PATCH: /products/:id
Send: reviews (ObjectId Array)
Receive: Updated Order Object, Response Code - 204 || Exception
GET: /reviews
Send: NIL
Receive: All Review Objects || Response Code - 404
GET: /reviews/:id
Send: reviewId (ObjectId)
Receive: Specific Review Object || Response Code - 404
POST: /reviews
Send: user (ObjectId), product (ObjectId), rating (Number), orderDetails (String)
Receive: New Review Object, Response Code - 201 || Exception
GET: /users
Send: NIL
Receive: All User Objects || Response Code - 404
GET: /users/:id
Send: userId (ObjectId)
Receive: Specific User Object || Response Code - 404
POST: /users
Send: email (String), password (String), profImageUrl (String), reviews (ObjectId Array), orderDetails (ObjectId Array)
Receive: New User Object, Response Code - 201 || Exception
PATCH: /users/:id
Send: orderDetails (ObjectId Array)
Receive: Updated User Object, Response Code - 204 || Exception
PATCH: /users/:id
Send: reviews (ObjectId Array)
Receive: Updated User Object, Response Code - 204 || Exception