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
ansiblevia apt (Ubuntu), yum (Fedora), homebrew (OS X), etc. See the Ansible installation instructions for detailed, platform-specific information. If you don't end up with version 2, tryeasy_install pipandpip install ansible.
- Install
- VirtualBox
- Download (All platforms)
- Install
virtualboxvia homebrew cask (OS X)
- Vagrant
- Download (All platforms)
- Install
vagrantvia homebrew cask (OS X)
- vagrant-hostsupdater
- Install with
vagrant plugin install vagrant-hostsupdater(All platforms)
- Install with
- Run
npm installto install local dependencies. - Run
vagrant upto set up postgresql database. - Run
npm run migrate:upto initialize the database model. - Run
vagrant ssh -- cat /mnt/vagrant/fixtures/*.sql \| psql -U postgres votetrackerto import the fixtures. - Run
npm startto 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/clientto see things update automatically. - Edit files in
src/serverand the server will automatically restart.
In production, the server component is mounted at: http://votetracker.berniesanders.com/api
If you see this error, it's possible you've already got postgres (the database) already running on your machine. If you're on a 'nix system, try entering sudo service --status-all at the command line. If you see something that looks like this [ + ] postgresql in the output, stop the service by entering sudo service postgresql stop and attempt to bring up vagrant again.