2018-01-16 15:55:05 +03:00
# Martin
2017-10-09 14:29:03 +03:00
2018-10-05 17:58:06 +03:00
![CircleCI ](https://img.shields.io/circleci/project/github/urbica/martin.svg?style=popout )
2017-10-15 14:48:23 +03:00
2018-08-25 15:45:04 +03:00
Martin is a PostGIS [Mapbox Vector Tiles ](https://github.com/mapbox/vector-tile-spec ) server written in Rust using [Actix ](https://github.com/actix/actix-web ) web framework.
2017-10-09 14:29:03 +03:00
## Installation
2018-10-10 16:32:24 +03:00
You can download Martin from the [Github releases page ](https://github.com/urbica/martin/releases ).
If you are running macOS and use [Homebrew ](https://brew.sh/ ), you can install Martin using Homebrew tap.
```shell
brew tap urbica/martin
brew install martin
```
2017-10-09 14:29:03 +03:00
## Usage
2018-10-10 16:32:24 +03:00
```shell
martin postgres://postgres@localhost/db
```
2017-10-09 14:29:03 +03:00
2018-03-27 14:40:33 +03:00
## Environment variables
2018-10-10 16:32:24 +03:00
You can configure martin with environment variables
| Environment variable | Example | Description |
|----------------------|----------------------------------|-------------------------------|
| DATABASE_URL | postgres://postgres@localhost/db | postgres database connection |
| DATABASE_POOL_SIZE | 20 | maximum connections pool size |
| WORKER_PROCESSES | 8 | number of web server workers |
| KEEP_ALIVE | 75 | connection keep alive timeout |
2018-03-27 14:40:33 +03:00
2017-10-09 14:29:03 +03:00
## Using with Docker
2018-10-10 16:32:24 +03:00
You can use official Docker image `urbica/martin`
```shell
docker run \
-p 3000:3000 \
-e DATABASE_URL=postgres://postgres@localhost/db \
urbica/martin
```
## Building from source
You can clone repository and build Martin using [cargo ](https://doc.rust-lang.org/cargo ) package manager.
```shell
git clone git@github.com:urbica/martin.git
cd martin
cargo build --release
```
The binary will be available at `./target/release/martin`
2018-10-01 20:10:33 +03:00
2018-10-10 16:32:24 +03:00
```shell
./target/release/martin postgres://postgres@localhost/db
```
2017-10-09 14:29:03 +03:00
## Development
2018-10-10 16:32:24 +03:00
Install project dependencies and check that all the tests run
2017-10-09 14:29:03 +03:00
2018-10-10 16:32:24 +03:00
```shell
cargo test
cargo run
```