Skip to content

KMES Usage Scenario Workflow

Business Scenario

This guide demonstrates the installation, deployment and use of the EMS system in a steel-manufacturing context.

Prerequisites

Ensure your local workstation has the following software installed:

  • Docker
  • Visual Studio Code (with the Python extension recommended)
  • Node.js (version 20 or above)
  • Python 3.12.5 (note: avoid Python 3.12.6 or newer as per the README)
  • DBeaver (or an equivalent database client)

Proceed to prepare your environment according to the steps in README.md:

  1. Download Docker images
    Use docker-compose or docker pull/docker tag to obtain the postgres:16 and redis:latest images:
    sh
    # Example (refer to README.md for exact commands)
    # docker-compose -f mes-compose.yml -p kmes up -d
  2. Copy the environment-variable template:
    sh
    cp .env.template dev.env
    • You may adjust any variables in dev.env as required.
  3. Start services (PostgreSQL & Redis):
    sh
    docker-compose -f mes-compose.yml -p easy up -d
    # Or follow alternative startup methods as described in the README
    • Once started, verify the containers are running and connect to PostgreSQL via DBeaver.

Starting System Services

  1. Install backend dependencies:
    • make sure pip is latest version:pip install --upgrade pip
    • Install project dependencies:
      sh
      pip install -e .
      # Or, for faster installs via the Aliyun mirror:
      # pip install -e . -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
  2. Initialise the database:
    • In VS Code, select Python 3.12.5 as the interpreter.
    • Open the Debug view.
    • run the Server Cli - init-test configuration。
  3. Run the backend Services:
    • In VS Code’s Debug view
    • run the Web API Server - 8000 configuration.The API will start on port 8000.
  4. Install front-end dependencies:
    sh
    npm install
    # or
    # yarn install
  5. Run the front-end Service:
    sh
    npm run dev
  6. Access the system:
    • Open your browser to http://localhost:8881 (or your configured address).