Store Manager is a web application that helps store owners manage sales and product inventory records. This application is meant for use in a single store. This repository contains the API endpoints for the application.
Http Method | Endpoint | Functionality |
---|---|---|
POST | api/v1/auth/signup | Creates a new user account |
POST | api/v1/products | Used by the admin to add a new product |
POST | api/v1/saleorder | Used by the sale attendant to add a new sale order |
GET | api/v1/auth/signin | Authenticates and creates a token for the users |
GET | api/v1/products/<product_id> | Enables a user to fetch a specific product |
GET | api/v1/saleorder/<sale_order_id> | Enables a user to fetch a specific sale order |
GET | api/v1/products | Enables a user to fetch all products |
GET | api/v1/saleorder | Enables a user to fetch all sale orders |
- Open a command terminal in your preferred folder
- Run command
git clone https://github.com/calebrotich10/store-manager-api.git
to have a copy locally cd store-manager-api
- Create a virtual environment for the application
virtualenv venv
- Install dependencies from the
requirements.txt
filepip3 install -r requirements.txt
- Export environment variables to your environment
export JWT_SECRET_KEY=your-secret-key
,export FLASK_APP="run.py"
- Run the application using flask command
flask run
or using python3python3 run.py
Inside the virtual environment created above, run command: coverage run --source=app.api.v1 -m pytest app/tests/v1 -v -W error::UserWarning && coverage report
JWT
for authenticationpytest
for running tests- Python based framework
flask
- Flask packages
https://documenter.getpostman.com/view/5265531/RWguxwzy
This application was build as part of the Andela NBO 33 challenge