Skip to content

Commit

Permalink
docs: README and CLI documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
shoriwe committed May 7, 2023
1 parent f1edbb3 commit 316c4ed
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
51 changes: 50 additions & 1 deletion README.md
@@ -1,2 +1,51 @@
# message-api


[![Build](https://github.com/shoriwe/message-api/actions/workflows/build.yaml/badge.svg)](https://github.com/shoriwe/message-api/actions/workflows/build.yaml)
[![codecov](https://codecov.io/gh/shoriwe/message-api/branch/main/graph/badge.svg?token=RU4KKCQPUV)](https://codecov.io/gh/shoriwe/message-api)
[![Go Report Card](https://goreportcard.com/badge/github.com/shoriwe/message-api)](https://goreportcard.com/report/github.com/shoriwe/message-api)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/hidromatologia-v2/stations)

REST API for [message-app](https://github.com/shoriwe/message-app)

## Documentation

| File | Description |
| ------------------------------------------------ | ------------------------------------------ |
| [docs/spec.openapi.yaml](docs/spec.openapi.yaml) | OpenAPI documentation for the REST service |
| [docs/CLI.md](docs/CLI.md) | CLI documentation for the main binary |

## Running

### Docker

```shell
docker pull ghcr.io/shoriwe/message-api:latest
```

### Docker compose

Make sure to customize the [example.env](example.env) file. Then:

```shell
docker compose up -d
```

### Binary

You can find pre-compiled binaries at the [releases](https://github.com/shoriwe/message-api/releases) section.

```shell
export SECRET = "MY_SECRET"
export FIREBASE_PROJECT_ID = "MY_FIREBASE_PROJECT"
export FIREBASE_CONFIGURATION_FILE = "firebase-adminsdk.json"
export DATABASE_FILE = "database.db"

message-api :5000
```

#### Building from source

```shell
go install github.com/shoriwe/message-api@latest
```

19 changes: 19 additions & 0 deletions docs/CLI.md
@@ -0,0 +1,19 @@
# CLI

Documentation for the CLI

## Environment variables

| Variable | Description |
| ----------------------------- | ---------------------------------------------------- |
| `SECRET` | Secret for the JWT engine |
| `FIREBASE_PROJECT_ID` | Project ID of the Firebase APP |
| `FIREBASE_CONFIGURATION_FILE` | Firebase configuration file specific for the backend |
| `DATABASE_FILE` | SQLite file path to use |

## Command

```shell
message-api LISTEN_ADDR [LISTEN_ADDR [LISTEN_ADDR [...]]]
```

0 comments on commit 316c4ed

Please sign in to comment.