kbss-cvut / s-pipes-editor-ui

MIT License
0 stars 0 forks source link

SPipes Editor UI

We will use $PROJECT_ROOT as the root directory of this project, i.e., the directory where this README is located. Similarly, we will define:

Running Editor UI

Default configuration assumes that:

Installing docker is summarized in using-docker.md.

There are two ways to run the editor, using docker-compose and using spe.

Running editor using docker-compose

To run the editor using docker-compose, do the following steps:

Run editor using spe script

spe script can be used to execute the editor from a command line by specifying one or more directories from which SPipes scripts should be loaded. Internally the script uses docker-compose.yml file and environment variables specified in $PROJECT_ROOT/.env.custom-script-paths.

To run the editor using spe script, do the following steps:

Use the correct spe script extension:

Note that in windows if using git with core.autocrlf=true (set by default) spe.sh (and other files) git will replace line endings (LF) for windows line endings (CRLF). In this case, the spe.sh script will not be executable in wsl. To make the script executable line endings should be replaced.

Configuration of environment variables in Windows

.env file is used by docker compose by default. The .env.custom-script-paths is used by the spe script.

To override default configuration create $PROJECT_ROOT/.env and use following variables:

Building

$ npm install

IMPORTANT - https://github.com/facebook/create-react-app/issues/10811. The npm@7.13.0 version is required and npm update --force command.

Will create a dist directory containing your compiled code.

Depending on your needs, you might want to do more optimization to the production build.

Development

Run development server

$ npm run dev

Development with Docker Compose

Here is the common procedure to debug individual services of the s-pipes-editor-ui. <service-name> can be replaced by one of the values s-pipes-editor-ui, s-pipes-editor-rest and s-pipes-engine.

  1. cd to $PROJECT_ROOT.
  2. Run docker-compose -f docker-compose-dev.yml up if not running already. Otherwise, run docker-compose -f docker-compose-dev.yml start.
  3. Stop the service which you want to develop docker-compose -f docker-compose-dev.yml stop <service-name>
  4. Start <service-name> in development environment
    • s-pipes-editor-ui - run npm run dev
    • s-pipes-editor-rest - start run/debug springboot configuration in IntelliJ IDEA
    • s-pipes-engine - start run/debug springboot configuration in IntelliJ IDEA

Composing up, start and stop can also be done trough docker desktop and intellij idea service tab.

Dockerization

The docker image of SPipes Editor UI can be built by docker build -t s-pipes-editor-ui .

Then, SPipes Editor UI can be run as docker run -e SERVICE_URL=<SPIPES_BACKEND_URL> -p 3000:80 s-pipes-editor-ui
where denotes the URL where SPipes backend is running.

Docker-compose

You can run editor together with backend using docker orchestration. The docker-compose is composed of 4 services and can be run via docker-compose up:

Required manual steps:

GitHub Logo Architecture images

Prettier

We use Prettier to keep the codebase formatting consistent. To simplify this process, a pre-commit Git hook is set up with Husky.

Note

Skeleton is from - React Starter Boilerplate with Hot Module Replacement and Webpack 4

License

Licensed under GPL v3.0.