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 and has data persisted using a database.
| Method | Endpoint | Functionality |
|---|---|---|
| POST | /api/v2/auth/signup |
Create a new user |
| POST | /api/v2/auth/login |
Login a registered user |
| POST | /api/v2/auth/logout |
Logout a logged in user |
| Method | Endpoint | Functionality |
|---|---|---|
| POST | /api/v2/products |
Add a new product |
| GET | /api/v2/products |
Get all products |
| GET | /api/v2/products/<int:product_id> |
Get specific product |
| GET | /api/v2/sales |
Get all sale orders |
| GET | /api/v2/sales/<int:sale_id> |
Get specific sale order |
| PUT | /api/v2/products/<int:product_id> |
Update specific product fields |
| DELETE | /api/v2/products/<int:product_id> |
Delete specific product |
| Method | Endpoint | Functionality |
|---|---|---|
| GET | /api/v2/products |
Get all products |
| GET | /api/v2/products/<int:product_id> |
Get specific product |
| POST | /api/v2/sales |
Add sale order |
- Clone repo using
https://github.com/TooColline/Store-Manager-Api-V2.git cd Store-Manager-Api-V2- Create a virtual environment
virtualenv venvand activate itsource venv/bin/activate - Install dependencies of the application using
pip3 install -r requirements.txt - Export these environment variables
export FLASK_APP="run.py"for your app andexport JWT_SECRET_KEY=yourkey - Run the application
python3 run.pyorflask run
Run this command inside your virtual environment: coverage run --source=app.api.v2.views -m pytest /tests/v2 -v -W error::UserWarning && coverage report
- Python flask framework
pytestfor running testsflask JWTfor authpylintfor python linting library
This was challenge 3 as part of the Bootcamp 33 NBO Andela.