<commit_before># Setup

This guide explains how to install and setup the Link-SF application.

## Prerequisites

### Accounts

Link-SF is designed to be free to setup and free to run in perpetuity. Since hosting files is cheap, we've decided to go with building a static site. There's only one hard dependency as far as accounts go. Parse gives us data persistence, authentication for admins, and querying:

* [Parse](https://parse.com/#signup)

If you want to deploy the site publicly, S3 gives us free file hosting:

* [Amazon Web Services](http://aws.amazon.com/s3/?nc1=h_l2_sc)

The following accounts are optional:

* [Mailgun](http://www.mailgun.com/): For capturing feedback entered in the feedback form as an email to your account.
* [Google Analytics](http://www.google.com/analytics/): In addition to capturing useful things like user agent and traffic, we've added a couple custom events that help us keep track of how often a user connects to a service via external link (calling, visiting website, or getting directions).

Once you have the accounts necessary, we can look at running the site locally.

### Development

Download the source (via [git](git@github.com:zendesk/linksf.git) or [.zip file](https://github.com/zendesk/linksf/archive/master.zip)).

#### Secrets

In the project root, you'll find a `.env.example` file. Make a copy of that file called `.env` in the same directory. It will probably look like this:

```
PARSE_DEV_APP_ID=xxxxxxx
PARSE_DEV_JS_KEY=xxxxxxx
PARSE_DEV_MASTER_KEY=xxxxxxx
PARSE_PROD_APP_ID=xxxxxxx
PARSE_PROD_JS_KEY=xxxxxxx
PARSE_PROD_MASTER_KEY=xxxxxxx
...
```

There are placeholders for development and production Parse tokens because we don't want any breakage during development to affect the production site. Create a [new Parse app](https://parse.com/apps/new) and call it whatever you'd like. Replace the token placeholder values (`xxxx`) with those specific to your apps from [Parse](https://parse.com/account/keys). The Mailgun and Google Analytics tokens can be ignored for now, if you'd like.

Keep your `.env` file secret (out of source control, etc).

#### Building the site

#### Making changes to the site

Download

The development toolkit uses
* ruby
* node
* npm
* s3cmd
* parse

### Deployment<commit_msg>more SETUP docs<commit_after># Setup

This guide explains how to install and setup the Link-SF application.

## Prerequisites

### Accounts

Link-SF is designed to be free to setup and free to run in perpetuity. Since hosting files is cheap, we've decided to go with building a static site. There's only one hard dependency as far as accounts go. Parse gives us data persistence, authentication for admins, and querying:

* [Parse](https://parse.com/#signup)

If you want to deploy the site publicly, S3 gives us free file hosting:

* [Amazon Web Services](http://aws.amazon.com/s3/?nc1=h_l2_sc)

The following accounts are optional:

* [Mailgun](http://www.mailgun.com/): For capturing feedback entered in the feedback form as an email to your account.
* [Google Analytics](http://www.google.com/analytics/): In addition to capturing useful things like user agent and traffic, we've added a couple custom events that help us keep track of how often a user connects to a service via external link (calling, visiting website, or getting directions).

Once you have the accounts necessary, we can look at running the site locally.

### Development

Download the source (via [git](git@github.com:zendesk/linksf.git) or [.zip file](https://github.com/zendesk/linksf/archive/master.zip)).

#### Secrets

In the project root, you'll find a `.env.example` file. Make a copy of that file called `.env` in the same directory. It will probably look like this:

```
PARSE_DEV_APP_ID=xxxxxxx
PARSE_DEV_JS_KEY=xxxxxxx
PARSE_DEV_MASTER_KEY=xxxxxxx
PARSE_PROD_APP_ID=xxxxxxx
PARSE_PROD_JS_KEY=xxxxxxx
PARSE_PROD_MASTER_KEY=xxxxxxx
...
```

There are placeholders for development and production Parse tokens because we don't want any breakage during development to affect the production site. Create a [new Parse app](https://parse.com/apps/new) and call it whatever you'd like. Replace the token placeholder values (`xxxx`) with those specific to your apps from [Parse](https://parse.com/account/keys). The Mailgun and Google Analytics tokens can be ignored for now, if you'd like.

Keep your `.env` file secret (out of source control, etc).

#### Building the site

Link-SF is a static site. To build the site (turn a file tree into a monolithic html, js, and css file), you'll need some command line tools installed:

* [ruby](https://www.ruby-lang.org/)
* [rake](http://rake.rubyforge.org/)
* [node](http://nodejs.org/)
* [grunt](http://gruntjs.com/)
* [sass](http://sass-lang.com/)
* [parse](https://www.parse.com/docs/cloud_code_guide)

If you intend on deploying the site, you'll also need:

* [s3cmd](http://s3tools.org/s3cmd)

Once you have installed the tools above, follow these steps:

1. `npm install grunt`
1. `npm install -g grunt-cli`
1. `npm install`
1. `grunt`
1. `parse deploy`
1. `open index.html`

If everything was installed, you should have Link-SF open and running in your browser. You won't see any facilities listed in search, so you'll want to add one in the admin interface. First, create a new user in the Parse interface, then:

1. `open admin.html`

Login using the credentials for the user you just added, then add a facility. Once saved, you will be able to return to the enduser app and see the facility in search results.

#### Making changes to the site

### Deployment
{'fraction_non_alphanumeric': 0.09385113268608414, 'fraction_numerical': 0.0034160373966199207, 'mean_word_length': 4.557442557442558, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 12, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6007261', 'n_tokens_mistral': 1658, 'n_tokens_neox': 1585, 'n_words': 724}