This module is used to manage vendors, there purchase orders and vendor performance metrics.
- Language - Python 3.10
- Backend Framework - Django rest framework
- Database - PostgreSQL
-
clone the git repository
git clone https://github.com/kashi5/vendor_management.git
-
Install docker on you system if it is not installed.
-
Install minikube on your system
-
Install Helm on your system
-
Install kubectl on your system
-
Start the minikube cluster
minikube start
-
Create a namespace for the vendor-svc
kubectl create namespace vendor-svc
-
Install the helm chart
helm install vendor-svc ./k8s/vendor-svc
-
Check the status of the pods
kubectl get pods -n vendor-svc
-
Port forward the service to access the APIs
kubectl port-forward k8s/vendor-svc 8000:8000 -n vendor-svc
-
To check the API swagger documnetation
http://0.0.0.0:8000/api/docs/
-
To uninstall the helm chart
helm uninstall vendor-svc -n vendor-svc
-
Follow the steps in a chronological order to access the APIs
-
Enter the project root folder
cd vendor_management
-
To run the docker, build the image for any changes
docker-compose build
-
To start the app
docker-compose up -d
-
Wait for 3 or 4 minutes after the above command is run. Run database migrations
docker-compose run --rm vendor python manage.py migrate
-
Run Test suite
docker-compose run --rm vendor python manage.py test
-
To check the API swagger documnetation
http://0.0.0.0:8000/api/docs/
-
To access any APIs, register as user check the doumentation
http://0.0.0.0:8000/api/register/
-
Once registered, access the token. To access any other APIs you need to add the token in the header as Authorization Token <token_value>
http://0.0.0.0:8000/api/token/
-
To stop the docker container
docker-compose down
-
Filter based on vendor id on purchase order list endpoint not documented on swagger.
-
http://localhost:8000/api/docs/ # we can use localhost too