Skip to content
Sebi1006 edited this page Jun 23, 2021 · 17 revisions

Setup

Check out this repository. It needs to be located in an folder called zeta.

To setup Zeta for development mode, you need:

You need to setup 3 things:

  1. MongoDB:
    • To start, call in command line: mongod(.exe) --dbpath "*full path to where I want my Docker files to be stored*".
    • You can also create a batch/shell script containing this command. In Windows you should replace mongod with the full path to mongod in double quotes. It also helps to add a pause / read at the end to catch possible errors if MongoDB shuts down unexpectedly.
  2. Frontend:
    • Make sure Yarn is installed.
    • Clone the yFiles repositories at the same level as your Zeta repo. It should look like this:
        .
        ├── yFiles-dev-key
        ├── yFiles-for-html
        │   ├── impl
        │   └── typings
        └── zeta
            ├── api
            ├── frontend
            └── mongodb
    • cd into the frontend directory.
    • Call yarn.
    • To start, call yarn serve.
  3. IntelliJ IDEA:
    • File | Open -> folder zeta/api
    • VCS | Enable Version Control Integration -> git
    • Navigate to build.sbt and enable sbt integration if asked.
    • View | Tool Windows | SBT -> press the "Reload all sbt projects" button.
    • Run | Edit Configurations... -> + -> Play 2 App
      • Play2 Module = zeta-api (Make sure it is plain zeta-api without a number. If there is not plain zeta-api, wait for indexing.)
      • Environment variables -> ...
        • name = ZETA_DEPLOYMENT value = development
    • Run the new configuration.

Error Handling

Run

  • Use Java SDK 11 (via File -> Project Structure -> Project -> Project SDK)
  • Exclude Target Sources in Project Structure (via File -> Project Structure -> Modules) Exclude Target Exclude Target Result
  • Use Scala SDK 2.12.12 (via File -> Project Structure -> Global Libraries)
  • Afterwards press: File | Invalidate Caches/ Restart .... Then try to run Play2 again. If you get the error message: Unrecognized option: -J-Xmx4G remove the -J- from the .sbtopts file.
  • View | Tool Windows | SBT -> press the "Reload all sbt projects" button.

Build

  • Use sbt compile in a terminal or compile in the sbt shell.

Start

To start Zeta in development mode, you need to start 3 things.

  1. MongoDB: Execute your script or call in command line: mongod(.exe) --dbpath "*full path to where I want my Docker files to be stored*".

  2. Frontend: In command line, navigate to zeta/frontend/. Now call: yarn serve.

  3. IntelliJ IDEA: Make sure that all sbt packages are loaded and indexing is complete. This may take some time. Feel free to grab a snack or coffee while waiting. Start the Play2 configuration you created. If you are getting an error in zeta/api/server/server.sbt file caused by ZetaBuild, try to delete the two folders:

    • zeta/api/project/project
    • zeta/api/project/target

    Afterwards press: File | Invalidate Caches/ Restart .... Then try to run Play2 again.

If you change something in the code you just need to press refresh and IntelliJ will recompile the project.