Skip to content

Commit

Permalink
Merge pull request #88 from codeforanchorage/fix_readme
Browse files Browse the repository at this point in the history
Fix readme
  • Loading branch information
mark-meyer authored Nov 14, 2018
2 parents 201ec9d + 7c0f176 commit 890f3dd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ The database also has tables *log_hits* and *log_runners*. These log activity of

## Running Locally

First, install [node](https://github.com/codeforamerica/howto/blob/master/Node.js.md) (atleast version 7.6), and [postgres](https://github.com/codeforamerica/howto/blob/master/PostgreSQL.md) (atleast version 9.5).
First, install [node](https://github.com/codeforamerica/howto/blob/master/Node.js.md) (atleast version 7.6), and [postgres](https://github.com/codeforamerica/howto/blob/master/PostgreSQL.md) (at least version 9.5).

Then clone the repository into a folder called courtbot:

```console
git clone [email protected]:codeforanchorage/courtbot.git courtbot
cd courtbot
```

Since the app uses twilio to send text messages, it requires a bit of configuration. Get a [twilio account](http://www.twilio.com/), create a .env file by running `cp .env.sample .env`, and add your twilio authentication information. While you're there, add a cookie secret and an encryption key (long random strings).
Expand All @@ -39,10 +40,10 @@ Install node dependencies
npm install
```

Define a new PostgreSQL user account.
Define a new PostgreSQL user account, give it a password. You might have to create a postgres account for yourself first with superuser permissions if you don't have one already, or use sudo -u postgres before these commands.

```
createuser courtbot
createuser courtbot --pwprompt
```

Create a new PostgreSQL database and a database to run tests.
Expand All @@ -52,6 +53,12 @@ createdb courtbotdb -O courtbot
createdb courtbotdb_test -O courtbot
```

Set up your environment variables. This may require some customization-- especially the DATABASE_TEST_URL.

```
cp .env.sample .env
```

Then, to create the tables and load in initial data:

```console
Expand Down Expand Up @@ -92,6 +99,7 @@ heroku config:set TEST_TOMORROW_DATES=<1 if you want all court dates to be tomor
heroku config:set ADMIN_LOGIN=<user name for access to admin api>
heroku config:set ADMIN_PASSWORD=<password for access to admin api>
heroku config:set JWT_SECRET=<random string to be used to create json web token when authenticating admin api>
heroku config:set TESTCASE=<case number for testing>
git push heroku master
heroku run node utils/createRequestsTable.js
heroku run node utils/createNotificationsTable.js
Expand Down Expand Up @@ -120,14 +128,6 @@ Finally, you'll want to set up the [scheduler](https://elements.heroku.com/addon

## Running Tests

Set up your environment variables. This may require some customization-- especially the DATABASE_TEST_URL.

```
cp .sample.env .env
```

Then run the tests:

```
npm test
```
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"name": "courtbot",
"version": "0.0.1",
"description": "Deliver simple court data via JSON or SMS.",
"repository": {
"type": "git",
"url": "git://github.com/codeforanchorage/courtbot.git"
},
"main": "web.js",
"scripts": {
"test": "NODE_ENV=test mocha --exit test",
Expand Down

0 comments on commit 890f3dd

Please sign in to comment.