view docs/DEVELOPMENT.md @ 5095:e21cbb9768a2

Prevent duplicate fairway areas In principal, there can be only one or no fairway area at each point on the map. Since polygons from real data will often be topologically inexact, just disallow equal geometries. This will also help to avoid importing duplicates with concurrent imports, once the history of fairway dimensions will be preserved.
author Tom Gottfried <tom@intevation.de>
date Wed, 25 Mar 2020 18:10:02 +0100
parents 70444dce0b31
children
line wrap: on
line source

# Development

Main development is done on GNU/Linux systems, mainly Debian (stretch)
or Ubuntu (18.04 LTS "Bionic Beaver"). First try packages from these
distributions.

`Makefile` requires GNU Make for building. And `.sh` files refer to Bash.
(Both are standard in GNU/Linux setups.)


# View source code history

If you want to see the source code structure and history
on our local machine (instead of online):
  `hg serve`
from Mercurial SCM will start a local server. Install the
[HighlightExtension](https://www.mercurial-scm.org/wiki/HighlightExtension)
to enable syntax highlighting.


## Backend

You need a working [Go](https://golang.org/dl) build environment (1.13+).

* Install dependencies

    `sh 3rdpartylibs`

* Build

    Prerequesite: compile server
    ```
    cd cmd/gemma/
    go build
    cd ../../
    ```

* Run
    Run server with  `./cmd/gemma/gemma`


### View source code documentation interactively

Use https://godoc.org/golang.org/x/tools/cmd/godoc
(coming with package `golang-golang-x-tools` on Ubuntu.)
to see the formatted documentation.

Started in the top level directory like
 `godoc  -http=:6060`
you can access the documentation at
`http://localhost:6060/pkg/gemma.intevation.de/?m=all`

Hints:
 * A parameter like `-goroot /usr/lib/go-1.13` may avoid warnings, if
   the goroot is somewhere else.
 * Clicking on a function declaration header will take you to the source
   code. (Or changing `?m=all` to `?m=src?`).


## Client

See [client/README](../client/README.md) for details.