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. If you don't end up with version 2, tryeasy_install pip
andpip install ansible
.
- 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:up
to initialize the database model. - Run
vagrant ssh -- cat /mnt/vagrant/fixtures/*.sql \| psql -U postgres votetracker
to import the fixtures. - 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.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.