Setting Up Your Development Environment - sketch-city/texasvotes GitHub Wiki

Want to contribute to the code? This will get you going locally. You can either set up your own environment, or just use Vagrant to make it super easy. If you've already used Vagrant and/or Laravel before, you can skip ahead a bit.

This guide is for OSX or Linux for now. We can add Windows instructions if there's a need.

Meta Setup

  1. Don't have VirtualBox? Go install VirtualBox: virtualbox.org

  2. If you don't have Vagrant already installed, go get it here: vagrantup.com/docs/installation

Scary Terminal Commands

  1. Download the Homestead vagrant box.
vagrant box add laravel/homestead
  1. Change directories to wherever you want to download this project and run it from.

  2. Clone the project.

git clone [email protected]:ardouglass/texasvotes.git texasvotes

# The rest of the commands are run in the project directory
cd texasvotes/
  1. Install dependencies.
composer install
  1. Generate your Homestead.yaml file.
php vendor/bin/homestead make
  1. Create your .env file.
cp .env.example .env
php artisan key:generate
  1. Edit your /etc/hosts file to make this easy to work on. This will let you browse to texasvotes.dev in your browser to view the project.
sudo vi /etc/hosts

If you don't know what's going on, Type a capital G and then a lowercase o. This should move your cursor to the end of the file and then append a new line below the bottom line.

Look at your Homestead.yaml file, and grab the ip. By default, it will be 192.168.10.10 unless you changed it.

Create a line that looks like 192.168.10.10 texasvotes.dev and then hit esc. Now type :x and hit enter to save the file out.

  1. Boot up your virtual machine with Vagrant.
vagrant up
  1. A couple handy Vagrant commands to show you now. They all require you to be in the same directory you ran vagrant up in.
# SSH into the machine
vagrant ssh

# Shut down and delete the VM
vagrant destroy

# Just pause the VM, but don't delete data
vagrant halt
  1. You should be up and running now! Try texasvotes.dev in your web browser and see if it loads.