Setup Developer Environment

Requirements

  • Go 1.12+
  • Node 11.x
  • Yarn 9+
  • Docker (optional)

Clone sources

Clone traggo/server source from git:

$ git clone https://github.com/traggo/server.git && cd server

Env Variables

If you are in GOPATH, enable go modules explicitly:

$ export GO111MODULE=on

Download tools

This contains tools for formatting and linting.

$ make download-tools

Install dependencies

Install Go and Yarn dependencies.

# make install

Code Generation

The server and ui depends heavily on graphql, for this we use code generators which generate models and resolvers from our schema.graphql. The following command shoud be executed after any change to the file.

$ make generate

Formatting Code

Both the server and the ui uses tooling for formatting the code. You can format all files with:

$ make format

Linting

We use multiple linters for our code. You can run them all with

$ make lint

Starting the server

$ go run main.go

This starts the traggo server on localhost3030.

Node

When traggo is started in dev mode (which is by default enabled) then it will load additional config files.

The .env.development.local-file should be used for local changes as it is git ignored.

Starting the React-UI

Commands must be executed inside the ui directory.

$ yarn start
The ui development server will be started on localhost:3000.