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

Thursday, October 14, 2021

Install Docker Desktop on Windows and Linux

 

For Windows System requirements:

1.     Enable wsl2 feature in your windows.

2.     Enable virtualization to you system. (Docker desktop needs this feature)

3.     Download and install Docker Desktop

 

1. Enable wsl2 feature

WSL 2 (Windows subsystem for Linux) backend because Docker must run in Linux environment for this you have to enable wsl2 in your windows.

Enable the WSL 2 feature on Windows. For detailed instructions, refer to the (https://docs.microsoft.com/en-us/windows/wsl/install).

The following hardware prerequisites are required to successfully run WSL 2 on Windows 10 or Windows 11:

·         For Windows 11 64-bit: Home or Pro version 21H2 or higher, or Enterprise or Education version 21H2 or higher.

·         For Windows 10 64-bit: Home or Pro 2004 (build 19041) or higher, or Enterprise or Education 1909 (build 18363) or higher.

·         4GB system RAM

After you successfully install and setup wsl2 you will get wsl command prompt as like windows command prompt form search menu or any other place. With this terminal you can place Linux command in windows.

 

2. Enable virtualization

BIOS-level hardware virtualization support must be enabled in the BIOS settings. For detail info read this info: https://docs.docker.com/desktop/windows/troubleshoot/#virtualization-must-be-enabled

 

 

If your bios level virtualization is turned off then you have to turn it on.

To see virtualization is enable or not go to task manager by pressing ctrl+shif+esc button then go to performance tab.

See this article: https://mashtips.com/enable-virtualization-windows-10/

 

3. Download and install Docker Desktop

Download from here: (https://docs.docker.com/desktop/windows/install/)


                                                     For Linux

Click here to see details

Wednesday, October 6, 2021

vs-code configaration settings

 {

  "editor.fontSize": 17,

  "better-comments.multilineComments": true,

  "better-comments.highlightPlainText": false,

  "yaml.schemas": {

    "file:///c%3A/Users/Mehedi/.vscode/extensions/atlassian.atlascode-2.8.3/resources/schemas/pipelines-schema.json": "bitbucket-pipelines.yml"

  },

  "atlascode.bitbucket.enabled": false,

  "javascript.implicitProjectConfig.checkJs": false,

  "javascript.implicitProjectConfig.experimentalDecorators": false,

  // "files.autoSave": "afterDelay",

  "workbench.sideBar.location": "left",

  "window.zoomLevel": 1,

  "sync.autoDownload": true,

  "sync.autoUpload": true,

  "sync.gist": "a315796d6cea0099a0339668499857a8",

  "git.enableSmartCommit": true,

  "phpfmt.psr1": false,

  // "phpfmt.exclude": [

  //   "AllmanStyleBraces"

  // ],

  "phpfmt.passes": [

    "AlignDoubleArrow",

    "AlignEquals",

    "AlignDoubleSlashComments",

    "AlignGroupDoubleArrow",

    "AlignPHPCode",

    "AutoSemicolon",

    "ShortArray"

  ],

  "editor.formatOnSave": false,

  "[php]": {

    "editor.defaultFormatter": "kokororin.vscode-phpfmt",

    "editor.formatOnSave": true

  },

  "phpfmt.enable_auto_align": true,

  "workbench.iconTheme": "vscode-icons",

  "highlight-matching-tag.styles": {

    "opening": {

      "name": {

        "underline": "yellow"

      },

      "left": {

        "custom": {

          "borderWidth": "0 0 0 1px",

          "borderStyle": "dotted",

          "borderColor": "yellow",

          "borderRadius": "5px",

          "overviewRulerColor": "white"

        }

      },

      "right": {

        "custom": {

          "borderWidth": "0 1px 0 0",

          "borderStyle": "dotted",

          "borderColor": "yellow",

          "borderRadius": "5px",

          "overviewRulerColor": "white"

        }

      },

    }

  },

  "highlight-matching-tag.noDefaultEmptyElements": true,

  "[vue]": {

    "editor.defaultFormatter": "esbenp.prettier-vscode",

    "editor.formatOnSave": true

  },

  "[javascript]": {

    "editor.formatOnSave": true,

    "editor.defaultFormatter": "vscode.typescript-language-features",

  },

  "vetur.format.defaultFormatter.js": "vscode-typescript",

  "vetur.format.options.tabSize": 4,

  "workbench.colorTheme": "Monokai Night",

  "vsicons.dontShowNewVersionMessage": true,

  "tabnine.experimentalAutoImports": true,

  "workbench.editor.untitled.hint": "hidden",

  "files.exclude": {

    "": true

  },

  "search.useIgnoreFiles": false,

}