There is a Vagrantfile provided that should get you to a runnable state:
vagrant upOtherwise:
Doing this should take care of everything for you, but YMMV:
bundle install
bundle exec rake setupIf your local database gets into a funky state, it can be reset like so:
bundle exec rake resetThe following env vars are required for the application to work.
There are some defaults available in
.example.env, which may be copied into .env
for use within the vagrant box:
cp -v .example.env .envDATABASE_URL- the postgresql database URLSALT- the salt used for server-side password hashingSMTP_HOST- smtp host (e.g. "smtp.gmail.com")SMTP_PORT- smtp port (e.g. 587)SMTP_TLS- should we use tls? ("true"/"false")SMTP_USERNAME- smtp username (e.g. "whatever.username")SMTP_PASSWORD- smtp passwordSMTP_AUTH- smtp auth type (e.g. "plain")SMTP_DOMAIN- smtp domain (e.g. "localhost.localdomain")
You'll have to ensure there is a postgresql database available for
local development. The server requires that DATABASE_URL is set.
# Set the DATABASE_URL var in your local environment file.
echo DATABASE_URL='postgres://globallinks:globallinks@localhost:5432/globallinks' >> .env
# Or, export the DATABASE_URL var to your current shell environment.
export DATABASE_URL='postgres://globallinks:globallinks@localhost:5432/globallinks'
# e.g.:
createdb globallinks
# To load volunteer data from the CSV file
./server
^C
psql globallinks < load_volunteers.sql
There are two web servers. One for frontend development, and one
for serving the sinatra app. The sinatra app is served via the
./server executable, which is the same executable used on heroku.
# run the thing locally
./serverFor client development, npm install once to get all dev
dependencies, then npm start to run the server. It will
print a banner with current host name and port. While running,
any changes to files in src/client/ will be compiled
immediately.
When ready to release a static client built, run
grunt writeClient (might need to have grunt-cli installed
globally). This will write a half-dozen static assets to www/.
