Skip to content

Sirius Web: cloud-based graphical modelers for dedicated DSLs (sample application)

License

Notifications You must be signed in to change notification settings

fzalila/sirius-web

Repository files navigation

Eclipse Sirius Web

Eclipse Sirius Web is a framework to easily create and deploy studios to the web. We keep the principles which made the success of Eclipse Sirius Desktop and make them available on a modern cloud-based stack.

Sirius Web

This repository, sirius-web, contains an example application of the Sirius Web platform, built using the frontend and backend components in sirius-components.

Building

To build and run the example application you will need the following tools:

To build the components in this repository, you will need the following tools installed:

  • Git

  • Java 11 (Java 12 or later are currently not supported)

  • Apache Maven 3.6.3

  • Recent versions of Node and NPM: in particular, Node >= 14 is required.

  • rollup (npm install -g rollup)

  • yalc (npm install -g yalc)

  • Docker, or an existing PostgreSQL installation, to run the application.

Warning
Note that there are issues with npm under Windows Subsystem for Linux (WSL). If you use WSL and encounter error messages like "Maximum call stack size exceeded" when running NPM, switch to plain Windows where this should work.

Building and publishing locally the frontend and backend components

Build steps:

  1. Clone the Sirius EMF JSON repository (the sirius-components backend depends on it):

    git clone https://github.com/eclipse-sirius/sirius-emf-json.git
  2. Build and install (locally) the EMF JSON JARs:

    cd sirius-emf-json
    mvn clean install -f releng/org.eclipse.sirius.emfjson.releng/pom.xml

    If you are behind a proxy, you may get Maven errors about checkstyle.org not being available. In this case you need to explicitly disable CheckStyle from the build: mvn clean install -f releng/org.eclipse.sirius.emfjson.releng/pom.xml -P\!checkstyle

  3. Clone the sirius-components repository

    git clone https://github.com/eclipse-sirius/sirius-components.git
  4. Build the frontend components:

    cd sirius-components/frontend
    npm install
    npm run build

    You may see some warnings when building the frontend (skipped optional dependencies during npm install, circular dependencies detected on an indirect dependency during the build). You can ignore them, they do not cause any actual issue at runtime.

  5. Publish the built version of the frontend components locally. Still from inside sirius-components/frontend:

    yalc publish
  6. Build the backend components:

    cd sirius-components/backend
    mvn clean install

    Here again, you may need to add -P\!checkstyle to the mvn command if you are behind a proxy.

Building the example application

  1. Clone the sirius-web repository

    git clone https://github.com/eclipse-sirius/sirius-web.git
  2. Build the frontend:

    cd sirius-web/frontend
    yalc add @eclipse-sirius/sirius-components
    npm install
    npm run build

    You may see some warnings when building the frontend (skipped optional dependencies during npm install). You can ignore them, they do not cause any actual issue at runtime.

  3. Copy the result of the frontend build as static resources in the appropriate backend project. From the root of the repository:

    cd sirius-web
    mkdir -p backend/sirius-web-frontend/src/main/resources/static
    cp -R frontend/build/* backend/sirius-web-frontend/src/main/resources/static
  4. Build the backend:

    cd sirius-web/backend
    mvn clean package

    The result is a read-to-run, Spring Boot "fat JAR" in backend/sirius-web-sample-application/target/sirius-web-sample-application-0.0.1-SNAPSHOT.jar.

Running the example application

  1. Sirius Web uses PostgreSQL for its database. For development or local testing, the easiest way is to start a PostgreSQL instance using Docker. The scripts folder contains an example script to do so. From the root of the sirius-web repository:

    ./scripts/restart-siriusweb-postgresql.sh
    Warning
    This may take a while the first time you run this as Docker will first pull the PostgreSQL image.

    If you do not have Docker or want to use an existing PostgreSQL installation, adjust the command-line parameters below and make sure the DB user has admin rights on the database; they are needed to automatically create the DB schema.

  2. Start the application:

    java -jar backend/sirius-web-sample-application/target/sirius-web-sample-application-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev --spring.datasource.url=jdbc:postgresql://localhost:5433/sirius-web-db --spring.datasource.username=dbuser --spring.datasource.password=dbpwd
  3. Point your browser at http://localhost:8080 and enjoy!

    Warning
    The initial version of Sirius Web has some known issues with Firefox. It is recommended to use a Chrome-based browser until these are fixed.

License

Everything in this repository is Open Source. Except when explicitly mentioned otherwise (e.g. for some resources likes images), the license is Eclipse Public License - v 2.0.

About

Sirius Web: cloud-based graphical modelers for dedicated DSLs (sample application)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published