-
Notifications
You must be signed in to change notification settings - Fork 38
Setup
This guide explains how to install and setup the Link-SF application.
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:
If you want to deploy the site publicly, S3 gives us free file hosting:
The following accounts are optional:
- Mailgun: For capturing feedback entered in the feedback form as an email to your account.
- Google 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).
To build the site (turn a file tree into a monolithic html, js, and css file), you'll need some command line tools installed:
If you intend on deploying the site, you'll also need:
Download the source (via git or .zip file).
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 and call it whatever you'd like. Replace the token placeholder values (xxxx
) with those specific to your apps from Parse. 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).
From the project root (and with the command line tools outlined above installed):
npm install
npm install -g grunt-cli
grunt
parse deploy
open index.html
If everything worked, 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:
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 is pretty simple. grunt
will build the site once, then you want to invoke grunt watch
which will rebuild the site once the watched set of files change. The flow should be:
grunt
grunt watch
- edit a watched file, then save
- see the site rebuild in your terminal
- reload the page and see updated build