kwanj-k / storemanager-API

Store Manager is a web application that helps store owners manage sales and product inventory records. This is version one that uses data structures.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

StoreManager-API 🏬

License: MIT PRs Welcome PEP8 Build Status Coverage Status Maintainability

Summary

Store Manager is a web application that helps store owners manage sales and product inventory records.

NOTE

  • The project is managed using PivotalTracker board click here

  • To see documentation click here

  • To see API on heroku click here

  • Sometimes even with a good token you might denied access,just send request again(currently working on it)

Run in Postman

Getting Started

  • Clone the repository:

    https://github.com/kwanj-k/storemanager-API.git

  • Navigate to the cloned repo.

Prerequisites

1. Python3
2. Flask
3. Postman

Installation

After navigating to the cloned repo;

Create a virtualenv and activate it ::

create a directory 
cd into the directory
virtualenv -p python3 venv
source venv/bin activate

Install the dependencies::

pip install -r requirements.txt 

Configuration

After activativating the virtualenv, run:

```
export FLASK_APP="run.py"
export FLASK_DEBUG=1
export APP_SETTINGS="development"
```

Running Tests

Run:

pytest --cov-report term-missing --cov=app

Testing on Postman/Docs

Fire up postman and start the development server by:

$ flask run

To use the docs click here

On Post man:

Navigate to  http://127.0.0.1:5000/api/v1/

Test the following endpoints:

Note

  • A super admin can access both admin and attendant routes
  • An admin can access his/her routes and attendant routes only
  • An attendant can only access her routes
  • One who adds a store is by default the only superadmin

Unsrestricted endpoints

EndPoint Functionality
POST /stores Create a store
POST /auth/login Login a user

Attendant endpoints

EndPoint Functionality
GET /products Get all the products
GET /products/Id/ Get a product by id
POST /products/Id/ Sell a product

Admin endpoints

EndPoint Functionality
POST /attendant/ Add a store attendant
POST /products/ Add a product
PUT /products/Id/ Update the information of a product
DELETE /products/Id/ Remove a product
GET /sales/ Get all the the sale records
GET /sales/Id/ Get a specific sale
PUT /sales/Id/ Update a specific sale
DELETE /sales/id Delete a specific sale

Super Admin endpoint

EndPoint Functionality
POST /admin/ Add an admin

Authors

  • Kelvin Mwangi - Initial work - kwanj-k

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Contribution

Fork the repo, create a PR to this repository's develop.

About

Store Manager is a web application that helps store owners manage sales and product inventory records. This is version one that uses data structures.

License:MIT License


Languages

Language:Python 100.0%Language:Procfile 0.0%