Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix readme #88

Merged
merged 8 commits into from
Nov 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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