Skip to content

Latest commit

 

History

History
62 lines (40 loc) · 1.81 KB

README.md

File metadata and controls

62 lines (40 loc) · 1.81 KB

Grocery API

An API for inventory management, scoped to a small grocery store.

Install

  1. Clone the repo:

    gh repo clone POWRFULCOW89/Grocery-API

    or download as ZIP.

  2. Install the dependencies:

    npm i 
  3. Run the tests:

    npm test
  4. Run the app:

    npm run dev

An environment file is required in the project root, containg the MONGO_URI and SAMPLE_TOKEN variables for MongoDB and testing, respectively.

Project

The current project is built with Express, a Node.js framework for backend code. Mongoose is used as Object Document Mapper along with the NoSQL database MongoDB. Unit tests are modeled with Chai and run with Mocha. As authentication mechanism, a local strategy is implemented with Passport. Finally, the API is deployed to Heroku.

Project requirements

Users

  • Admin: Super user that can generate reports, manage inventory and users.
  • Manager: Logged in user that can manage the inventory and cashier users.
  • Cashier: User that can make, edit and close sales.

Models

  • Product:
    • Name, category, stock, price, code.
  • User:
    • Username, name, email, password, role.
  • Sale:
    • Products, quantity, subtotal, total.

API Documentation

The Grocery API documentation can be consulted in Swagger Hub.

Team