Adjust README for UI config/building

This commit is contained in:
Jannis Mattheis 2018-03-16 18:13:20 +01:00 committed by Jannis Mattheis
parent 98b9d058da
commit 328a2b1b72
1 changed files with 43 additions and 6 deletions

View File

@ -10,7 +10,12 @@
* [File](#file) * [File](#file)
* [Environment](#environment) * [Environment](#environment)
* [Database](#database) * [Database](#database)
* [Setup Dev Environment](#setup-dev-environment)
* [Server](#setup-server)
* [UI](#setup-ui)
* [Building](#building) * [Building](#building)
* [Server](#build-server)
* [UI](#build-ui)
* [Cross-Platform](#cross-platform) * [Cross-Platform](#cross-platform)
* [Tests](#tests) * [Tests](#tests)
* [Versioning](#versioning) * [Versioning](#versioning)
@ -34,11 +39,11 @@ We wanted a simple server for sending and receiving messages (in real time per w
The docker image is available on docker hub at [gotify/server](https://hub.docker.com/r/gotify/server/). The docker image is available on docker hub at [gotify/server](https://hub.docker.com/r/gotify/server/).
``` bash ``` bash
docker run -p 80:80 gotify/server $ docker run -p 80:80 gotify/server
``` ```
Also there is a specific docker image for arm-7 processors (raspberry pi), named [gotify/server-arm7](https://hub.docker.com/r/gotify/server-arm7/). Also there is a specific docker image for arm-7 processors (raspberry pi), named [gotify/server-arm7](https://hub.docker.com/r/gotify/server-arm7/).
``` bash ``` bash
docker run -p 80:80 gotify/server-arm7 $ docker run -p 80:80 gotify/server-arm7
``` ```
### Binary ### Binary
@ -98,11 +103,43 @@ GOTIFY_PASSSTRENGTH=10
| mysql | `gotify:secret@/gotifydb?charset=utf8&parseTime=True&loc=Local ` | | mysql | `gotify:secret@/gotifydb?charset=utf8&parseTime=True&loc=Local ` |
| postgres | `host=localhost port=3306 user=gotify dbname=gotify password=secret` | | postgres | `host=localhost port=3306 user=gotify dbname=gotify password=secret` |
## Setup Dev Environment
### Setup Server
Download go dependencies with [golang/dep](https://github.com/golang/dep).
```
$ dep ensure
```
Run golang server.
```
$ go run app.go
```
### Setup UI
*Commands must be executed inside the ui directory.*
Download dependencies with [npm](https://github.com/npm/npm).
``` bash
$ npm install
```
Star the UI development server.
``` bash
$ npm start
```
Open `http://localhost:3030` inside your favorite browser.
The UI requires a Gotify server running on `localhost:80` this can be adjusted inside the [ui/src/index.js](ui/src/index.js).
## Building ## Building
The app can be built with the default golang build command. ### Build Server
``` bash ``` bash
go build app.go $ go build app.go
```
### Build UI
``` bash
$ npm run build
``` ```
### Cross-Platform ### Cross-Platform
@ -111,9 +148,9 @@ The project has a CGO reference (because of sqlite3), therefore a GCO cross comp
## Tests ## Tests
The tests can be executed with: The tests can be executed with:
``` bash ``` bash
make test $ make test
# or # or
go test ./... $ go test ./...
``` ```
## Versioning ## Versioning