Development Environment - uzh/marugoto GitHub Wiki
Backend
-
Install version 10 of Java Development Kit:
https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase10-4425482.html -
Install Spring Tool Suite IDE:
https://spring.io/tools -
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)
-
Start Spring Tool Suite
choose your workspace directory -
Import Repository with:
- Window → ShowView → Other... → Git Repositories
- Clone a Git repository
- Clone URI: https://github.com/uzh/marugoto.git
- add your username and password
- choose "dev-backend" branch
- choose your workspace directory
- check Import all existing Eclipse projects... and Finish
-
or do it with your favorite git client
- check File->Open Projects from File System...
- select marugoto/backend, marugoto/core + marugoto/shell
-
Run > Run as > **Spring Boot App
** -
Add --marugoto.dev.root.dir=/Daten/workspace-sts/marugoto to the program arguments for shell and Backend-Application, like in the screenshot is
-
App is running under: http://localhost:8080/
-
set up the database with (how each step works you can read below under Run different things)
- run Shell-Project
- import DemoTopic or other Topic from the content git
check git repository out from a content repository - 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:
-
Install version 10 of Node: https://nodejs.org/en/download/
-
Install vue-cli globally: https://cli.vuejs.org/guide/installation.html
-
Clone project from the Git repository: https://github.com/uzh/marugoto-frontend
-
For latest changes - fetch ‘dev’ branch
-
Run ‘npm install’ to install all dependencies
-
Serve for development:
-
Run ‘npm run serve’ for local development
-
App is running under: http://localhost:4020/
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)