Skip to content

A Java Spring Boot based OnlineIDE with Angular Frontend and GitLab connectivity.

Notifications You must be signed in to change notification settings

lucaired/onlineide

Repository files navigation

Online IDE

This is the repository for the project "OnlineIDE" in the course "Advanced Topics of Software Engineering".

Created by:

Deployment

The application can be easily deployed once access to the GitLab repository is granted.

  • Copy the docker-compose.yml file from the project root and place it in a desired location.
  • Use the GitLab deployment credentials to grant docker access to the container-registry. By running the following command:
docker login -u <CI_DEPLOY_USERNAME> -p <CI_DEPLOY_TOKEN> gitlab.lrz.de:5005
  • By providing the OAUTH-credentials, the application can be started simply by calling docker-compose up:
OAUTH_CLIENT_ID=<OAUTH_CLIENT_ID> OAUTH_CLIENT_SECRET=<OAUTH_CLIENT_SECRET> docker-compose up

These steps are automated for deployments to our live environment (Google VM) using our continuous deployment strategy.

Scaling

In order to launch multiple instances of a microservice, the --scale SERVICE=NUM option of docker-compose up can be used. Currently, the maximum number of instances per microservice is limited to 5, as this corresponds to the range of host port mappings in docker-compose.yml.

Run locally

To run the online IDE locally, you can basically follow the steps of the deployment section above. However, with the following differences:

  • Use different credentials to log in to the LRZ Container Registry if necessary.
  • Make sure to set the environment variables $OAUTH_CLIENT_ID and $OAUTH_CLIENT_SECRET or specify the concrete values directly in the docker-compose up command described above.
  • Make sure that you use the OAuth credentials for the local application, not the ones for the production version.

Postman collection

The REST API can be explored with the following Postman Collection, which can be imported into the local Postman instance by one click. It provides all relevant requests, if possible with matching sample data. Authenticated requests can therefore be easily executed as follows:

  1. Select the environment "Production" in the upper right corner. This will set the correct URL and the necessary OAuth credentials.
  2. Right click on our collection "OnlineIDE (5-1)" on the left, then click "Edit". The "Authorization" tab will already have all the necessary data entered. You just have to scroll down, click on "Get New Access Token" and log in to the LRZ. In the afterwards appearing modal, click on "Use Token" (top right). Now the OAuth Access Token will be passed automatically with every request.
  3. In order for the access to work outside the browser, we have to pass the XSRF token for non-GET requests. This is what you get back from the server with each request. Click on the request "[DUMMY] Obtain XSRF token", so that its custom Postman script takes the XSRF token as a variable and adds it to all future requests as a header.
  4. Execute arbitrary requests without necessary changes in "Authorization" or "Headers"

Run in Postman

About

A Java Spring Boot based OnlineIDE with Angular Frontend and GitLab connectivity.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published