README.md 1.77 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
# ThunderSnow

## Setup

### Install Nanobox CLI

Login to your [Nanobox.io](https://nanobox.io) account and download the client
from [here](https://dashboard.nanobox.io/download).

Install client and run `nanobox`, you will need to select how you wish to run
the containers. If you are on Linux, use docker native. OSX users should use the
lightweight vm.

If you use docker native, the docker daemon must be running and your current
user must be in the `docker` group **before** running nanobox.

Once setup is completed, run `nanobox` again, this time you should be prompted
to login, nanobox is now installed.

### Get application deps

Connecting to the application container and retrieving deps is the next step.

```bash

cd thunder_snow

nanobox run

# install phoenix
mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

# create database
cd /app && mix ecto.create

# fetch elixir deps
mix deps.get

exit
```

42 43 44 45 46 47 48 49 50 51 52 53
### Setup env.

The `API_KEY` environment variable must be set on all environments that will
be running the Thunder Snow server. The value must also match the value set
for the Lake Effect weather station.

You can use openssl to generate a random string.

```bash
openssl rand -base64 32
```

54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
### Start application

We want to access the app from
[http://thundersnow.local:4000](http://thundersnow.local:4000), this is configured
using local dns through nanobox. Make sure you are at the root of the repo before
running the commands below.

This DNS command only needs to be entered before the first time you launch the
app.

```bash
nanobox dns add local thundersnow.local
```

Use mix to start the server:

```bash
nanobox run mix phx.server
```

You can now use [http://thundersnow.local:4000](http://thundersnow.local:4000) to
access the application.