Development Environment - uzh/marugoto GitHub Wiki

Backend

  1. Install version 10 of Java Development Kit:
    https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase10-4425482.html

  2. Install Spring Tool Suite IDE:
    https://spring.io/tools

  3. Install ArangoDB Community Edition:
    Download version 3.2.15
    https://download.arangodb.com/arangodb32/MacOSX-10.8/x86_64/index.html
    Download file: arangodb3-3.2.15-1.x86_64.dmg
    Start ArangoDB and Choose «Auto»

    Admin Web Interface: http://localhost:8529/ (username root, no password)

  4. Start Spring Tool Suite
    choose your workspace directory

  5. Import Repository with:

    1. Window → ShowView → Other... → Git Repositories
    2. Clone a Git repository
    3. Clone URI: https://github.com/uzh/marugoto.git
      1. add your username and password
      2. choose "dev-backend" branch
      3. choose your workspace directory
      4. check Import all existing Eclipse projects... and Finish
  6. or do it with your favorite git client

    1. check File->Open Projects from File System...
    2. select marugoto/backend, marugoto/core + marugoto/shell
  7. Run > Run as > **Spring Boot App
    **

  8. Add --marugoto.dev.root.dir=/Daten/workspace-sts/marugoto to the program arguments for shell and Backend-Application, like in the screenshot is

  9. App is running under: http://localhost:8080/

  10. set up the database with (how each step works you can read below under Run different things)

    1. run Shell-Project
    2. import DemoTopic or other Topic from the content git
      check git repository out from a content repository
    3. create a user that you can log in

Problems

If you have the problem, that the problem "Could not resolve placeholder 'maven.multiModuleProjectDirectory' in value "${maven.multiModuleProjectDirectory}/backend/src/main/resources"".

then run once in the root of the marugoto git

./mvnw package -U -DskipTests

Run different things

Import prepared content (demo-storyline or example-storyline-vitamin2)

  • do-import /Daten/workspace-sts/marugoto-content/DemoTopic/ {{importerIdName e.g. demo-chris}} true

Unit-Tests

  • Select the package test and choose from the context menu "run as junit-test"

Shell-Project

  • Right click to the shell-subproject and run as "Java Application" and choose the Shell Application Class ch.uzh.marugoto.shell
  • Type help to see the possible commands

Simulate Email sending functionality

       For sending email functionality we will use https://mailtrap.io (fake SMTP testing server). 

  • Create account and log in to https://mailtrap.io with the credentials
  • Click in the mail-trap logo in the top left corner to access inboxes 
  • Choose Marugoto and there all the mail traffic will be presented together with the smtp configuration parameters.

Build the project with maven 

  • open the repository root-folder in shell
  • run "./mvnw package"
    without tests: "-DskipTests"

Run the shell project

  • run "java -jar shell\target\shell-1.0-SNAPSHOT.jar" in root-folder of repository

Create a user command with shell project

  • create-dev-users - autopopulate users
  • create-user - firstname lastname mail password

Truncate database

  • truncate-database

Frontend

Tools:

  1. Install version 10 of Node: https://nodejs.org/en/download/

  2. Install vue-cli globally: https://cli.vuejs.org/guide/installation.html

  3. Clone project from the Git repository: https://github.com/uzh/marugoto-frontend

    1. For latest changes - fetch ‘dev’ branch

    2. Run ‘npm install’ to install all dependencies

Serve for development:

Build is automated:

  • Build options can be found in .env files
  • .env is used for global configs
  • .env.development is used for development enviroment
  • .env.production is used for production build
  • .env.staging is used for staging, testing environment
  • .env.flag.local is used to prevent git from fetching these configs (useful in development process and testing cases)