Voucher-API
Requirement
- Docker Installed on system
Libraries
Pandas
Psycopg2
FastAPI
PyArrow
Pydantic
Uvicorn
How to run
- Download the repo on your system or clone it using below command if git is installed
git clone https://github.com/hassansheikh23/Voucher-FastAPI.git - Move into Voucher-API folder
cd Voucher-API - Run below command to run the docker containers
docker-compose up - Once containers are up and running, open another terminal and run below command
docker exec -it app /bin/bash - Once connected to app conatiner, run below command
python /Voucher-API/main.py - After script completed, API is ready to be use
- Go to browser and type 127.0.0.1:8000/docs
- It will open FastAPI built in SwaggerUI to test Api request
- Click the "POST" button on UI and then select "Try it out"
- Enter below json in request body to be send from client
{
"customer_id": 247,
"country_code": "Peru",
"last_order_ts": "2021-02-27 00:00:00",
"first_order_ts": "2020-08-07 00:00:00",
"total_orders": 15,
"segment_name": "recency_segment"
} - Click Execute to see response from API