Skip to content
This repository has been archived by the owner on Nov 7, 2020. It is now read-only.

Obeo/sirius-web-contrib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IMPORTANT: This project was transitional (it was only needed during the code contribution to Eclipse Sirius). It is archived and then will be removed completely. Please see https://github.com/eclipse-sirius/sirius-web instead.

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.

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:

  • Git

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

  • Apache Maven 3.6.3

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

  • Rollup for bundling sirius-components (npm install -g rollup)

  • Yalc (npm install -g yalc): optional, only needed for local publication of the frontend components

  • Docker, or an existing PostgreSQL installation.

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
  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
  5. Publish the built version of the frontend components locally. Still from sirius-components/frontend:

    yalc publish
  6. Build the backend components:

    cd sirius-components/backend
    mvn clean install

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
  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

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 repository:

    cd sirius-web
    ./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 installation, adjust the 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!

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.