The following will need to be installed on your local development machine before you can use this workflow. All versions should be the latest available, as some required features may not be available in older versions.
- node.js 4.3.x
- Ansible 2.x
- Install
ansible
via apt (Ubuntu), yum (Fedora), homebrew (OS X), etc. See the Ansible installation instructions for detailed, platform-specific information.
- Install
- VirtualBox
- Download (All platforms)
- Install
virtualbox
via homebrew cask (OS X)
- Vagrant
- Download (All platforms)
- Install
vagrant
via homebrew cask (OS X)
- vagrant-hostsupdater
- Install with
vagrant plugin install vagrant-hostsupdater
(All platforms)
- Install with
- Run
npm install
to install local dependencies. - Run
vagrant up
to set up postgresql database. - Run
npm run migrate
to initialize the database model. - Run
vagrant ssh
- On the Vagrant box, run
cat /mnt/vagrant/fixture/*.sql | psql -U postgres votetracker
to import the fixtures. exit
from the vagrant ssh.- Run
npm start
to start the file-watcher, api and live-reload process. - Browse to http://localhost:8080/ for the client.
- Browse to http://localhost:8000/ or http://localhost:8080/api/ for the server.
- Edit files in
src/client
to see things update automatically. - Edit files in
src/server
and the server will automatically restart.
In production, the server component is mounted at: http://votetracker.gnarf.net/api