Tuesday, October 19, 2021

kShop docker project installer commands

 

kShop project has to three folders

1.    Project (App)

2.    kshop-measurement-api (Api)(python)

3.    kShop (php) this file save the mesurment in database

  1. Project (App)

      The app which will use the API for mesurment.

  2. kshop-measurement-api

    This file holds the measurement calculation code which is api based.

kshop-measurement-api is made fully dockerised. So to run this api project your system must need docker setup.

To run this API go to kshop-measurement-api folder and open wsl command prompt if you are in windows OS.

Make Docker image and run project in single command:

                 docker-compose up -d --build

After this command kshop-measurement-api will serve in

http://localhost:5000/ 

Later command which you may needs after docker installation:

§  To see all docker images press: docker images

§  To see all containers : docker container ls

§  To stop all Docker containers, simply run the following command in your terminal::

1.     docker kill $(docker ps -q)

2.     docker rm $(docker ps -a -q)

3.     docker rmi $(docker images -q)

 

3. kShop

This project is fully made up with php for storing measurement data which was sended by python kshop-measurement-api 

Place this project in htdocs or www folder so that kshop-measurement-api  can use this. 

Note: kshop-measurement-api  project file __init__.py line 212  res = requests.post('http://192.168.1.198/kshop/api/measurement/create_measurement.php', data=data)

You needs to modify your localhosthost IP. (E.g. http://192.168.1.198)

 

This project has a database name kshop. So to use this project import the database also.

 

             kShop Api Test from postman

url: http://localhost:5000/upload

set : header as below
x-api-key:eiWee8ep9due4deeshoa8Peichai8Eih

 

set: body params as like below

image1: file.jpg

image2:file2.jpg

imga3:file3.jpg

customer_id:11

customer_gender:male

customer_age:22

customer_height:164

customer_weight:86