This is a simple inventory management system API built with Flask and Flask-RESTful. It allows users to create, delete, update and retrieve products. It also allows users to add products to cart and purchase products.
- Product creation, deletion, update and retrieval.
- Adding product to cart and purchasing product
- Keeping track of product quantity in regards to purchase or add to cart functions, i.e the product quantity should reduce when a purchase is made, or when it is added to the "user's" cart; users should be informed when a product is "out of stock"
- Products should have (name, category, labels(e.g size, colour etc), quantity, price) A product can have one or more labels.
- Python 3.10: Base programming language for development
- Flask: Web framework for development
- Flask-RESTful: Provides API development tools for easy API development
- MongoDB: NoSQL database for development, staging and production environments
- PyMongo: Popular Python driver used for interacting with MongoDB databases
- Docker Engine and Docker Compose : Containerization of the application and services orchestration
Two user accounts have been created for testing purposes. The details are as follows:
-
John Doe
- email: johndoe@example.com
- password: TestPassword
-
Jane Doe
- email: janedoe@example.com
- password: TestPassword
-
The API documentation is available on
https://documenter.getpostman.com/view/15948667/2s9YeEcXbX
on your browser.
-
Clone the Repository
-
create a .env file with the variables in the env.sample file
cp env.sample .env
- Update MONGO_DB_URI in .env with yours so that the application can connect to the database
-
Run
make build
- Running the above command for the first time will download all docker-images and third party packages needed for the app.
- NB: This will take a few minutes for the first build
-
Run
make up
- Running the above command will Start up the following Servers:
- API Server --> http://localhost:8000
- Running the above command will Start up the following Servers:
-
Run
make down
to stop the servers -
Other commands can be found in the Makefile