Skip to content

Development Setup

Tools

You need the following tools to work on the STREAM platform:

  • homebrew - cool package manager for macOS
  • gvm - to install go [currently 1.25.x]
  • nvm - to install node.js [currently 22.x]
  • golangci-lint - go linter
  • just - task runner
  • docker

These tools are optional add-ons (you can use others if you prefer different tools)

IDE

We mainly use VS Code and a tiny project config is committed to the repository. Feel free to use any IDE you like, though.

Repository Layout

At the root of the repo is a justfile which contains most day-to-day commands. Run just in the root to get a list of all commands with an explanation of what they do and how to use them. just can be run from anywhere in the repository (it searches all parent directories until it finds a justfile). Since each recipe in just spawns a new shell, your terminal will also not get messed up.

backend/

This directory contains services written in Go. There is a single go.mod and individual apps are contained in the apps/ directory.

Backend apps can be run using just run <app>. To get a list of apps, run just apps.

web/

This directory is an Nx monorepo with Angular apps and libraries.

Web apps can be run using just web <app>. To get a list of apps, run just web-apps.

Initial setup

The first step is to start third-party containers (db, vault, etc.). Run just up to start the compose stack.

Also, install dependencies using just install.

Solaris

To get setup to run solaris, follow these steps:

  1. Create directory backend/config
  2. Create backend/config/solaris.yml
  3. Add the following to the config
    env: "local"
    log:
      level: -1
      path: "./logs"
    server:
      port: 8080
      grpc_port: 50051
    database:
      host: "localhost"
      port: 5432
      database: "solaris"
      vault_mount: "database"
      vault_role: "stream-app"
    mother_vault:
      address: "http://localhost:8200"
      role_id: "solaris-role-id"
      secret_id: "solaris-secret-id"
      kv_mount: "secret"
    cluster_vault:
      address: "http://localhost:8200"
    mail_pit:
      base_url: http://localhost:8025
    assume_org: <filled in later step>
    nats:
      url: nats://localhost:4222
      username: nats
      password: nats
      scope: local
      private_prefix: private
    
    These credentials are default credentials. All services in the compose stack are setup with these already.
  4. Start solaris using just run solaris
  5. Start Admin UI using just web admin-ui
  6. Sign into Admin UI using Authentik (user provided by Fabian)
  7. Create an Organization and copy the ID from the network tab in dev tools
  8. Paste the ID into assume_org in the solaris config
  9. Create a global user for yourself (can sign into any org)
  10. Restart solaris
  11. Start Customer UI using just web customer-ui
  12. Sign into Customer UI using your global user

Nexus

To get setup to run nexus, follow these steps:

  1. Create directory backend/config
  2. Create backend/config/nexus.yml
  3. Add the following to the config
    log:
      level: -1
    server:
      grpc:
        port: 50052
      http:
        port: 8081
    solaris:
      host: "localhost"
      port: 50051
    vault:
      address: "http://localhost:8200"
      role_id: "nexus-role-id"
      secret_id: "nexus-secret-id"
      kv_mount: "secret"
    nats:
      url: nats://localhost:4222
      username: nats
      password: nats
      scope: local
      private_prefix: private
    cache:
      identity:
        type: redis # or in-memory (default if not configured)
      nonce:
        type: redis # or in-memory (default if not configured)
      session:
        type: redis # or in-memory (default if not configured)
    
    These credentials are default credentials. All services in the compose stack are setup with these already.
  4. Start nexus using just run nexus