Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

ttcchhmm/chr-ide

Repository files navigation

Docker Image CI

CHR IDE is a web-based playground built around CHR++

How to run

A Docker image is provided with this project:

docker run --rm -p 3000:3000 -v chr-ide-build:/build -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/ttcchhmm/chr-ide:latest

Then open http://localhost:3000 in your web browser.

Note

The image hosted on GitHub is built for x86_64 and arm64.

Configuration

If you're only using it on your local machine, the Docker image is plug-and-play, no additional configuration is required.

However, if you're hosting it over the network some configuration is required:

Browser support

For a better experience, a browser that supports the File System Access API is recommended. As of writing, only Chromium-based browsers running on a desktop OS are supported.

Browsers without this API will fallback to downloading the current workspace every time the user wants to save.

Development

Dependencies

  • An UNIX-based system: Linux (Arch, Ubuntu) and macOS were tested as development targets
    • Windows users are encouraged to use WSL
  • Node.js: At least version 22
  • CHR++
  • A C++ compiler: Both GCC and LLVM should work
    • GCC is used when running CHR IDE with Docker
  • Git
  • Docker: Optional, only when testing the final production image

Visual Studio Code is the recommended editor when working on this project, but any code editor will do.

Build and run using npm

The following npm scripts are available across the entire project structure:

  • build: Rebuild every workspace from scratch
  • clean: Delete build output
  • lint: Run ESLint
  • dev:backend: Start the backend on port 3000
  • dev:frontend: Start the frontend on port 4000
  • dev:simple-client: Start the simple client

Global structure

This project is written using TypeScript and the frontend uses Nuxt with Vue Single-File Components (SFC).

The CHR IDE source is composed of a single monorepo:

How CHR programs are executed

CHR IDE relies on Socket.io for an asynchronous, event-driven and reliable communication between the backend and the frontend.

sequenceDiagram

loop While the user is on the application
  User ->> Backend: Send a CHR program
  Backend --> Backend: Generate a chrpp file
  Backend ->> User: Inform the user that chrppc is about to run
  Backend --> Backend: Run chrrpc
  break If chrppc fails
    Backend ->> User: Inform the user that chrppc failed
  end
  Backend ->> User: Inform the user that the C++ compiler is about to run
  Backend --> Backend: Run a C++ compiler
  break If the C++ compiler fails
    Backend ->> User: Inform the user that the C++ compiler failed
  end
  Backend ->> User: Inform the user that the program is about to run
  Backend ->> Program: Start
  loop While the program is running
      break If the process ends unexpectedly
        Backend ->> User: Inform the user that the program failed
      end
      Program ->> Backend: Send a CHR trace
      Backend --> Backend: Parse the trace
      Backend ->> User: Send the parsed result
      User --> User: Update the interface
  end
  Program ->> Backend: End
  Backend ->> User: Inform the user that the execution finished
end
Loading

Build the Docker image

To build the Docker image from sources, run:

docker build -t chr-ide:latest .

And to run it:

docker run --rm -p 3000:3000 chr-ide:latest

Credits

This project was made under the supervision of Vincent Barichard, associate professor at LERIA (University of Angers) and the author of the CHR++ project.

CHR IDE was written by:

About

A web-based playground for CHR++

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 3

  •  
  •  
  •