Build a Simple Inventory Management System API
Using the CRUD HTTP API over a local MongoDB instance as your database back-end, build a logging API for supermarket purchase receipts that has the following functionality:
Clone this project
npm install
npm start
make your environment variable .env file
Fill in this data for mongodb
server=
database=
No test for now
- Ability to log purchase receipts
- Ability to query DB for total sales in a given month
- Ability to query DB for complete product list
- Ability to add/modify/delete products
- Ability to query DB for monthly sales by product
HTTP verb | Routes | Description |
---|---|---|
GET | /api/v1/products | Get all products |
POST | /api/v1/products/add | add a product - params [name, amount] |
DELETE | /api/v1/products/:id | Delete a specific product by id |
PUT | /api/v1/products/:id | Update a particular product [name, amount] |
POST | /api/v1/purchase/:id | Purchase a product and get receipt [quantity] |
GET | /api/v1/total | Get total sale in a month [takes a query params month] |
GET | /api/v1/month | get monthly sale by product [takes a query param product] |