Geo-data backed Ruby on Rails social network app Vienna.
- PostgreSQL >= 9.4 with PostGIS extension for spatial data
- ImageMagick
- Ruby >= 2.3.0 is what we run in production
- GEOS and Proj for some spatial calculations
- PhantomJS for a headless browser
Assuming you are on the correct Ruby version
# install dependencies with homebrew
$ brew install geos proj postgres postgis phantomjs imagemagick
# make sure postgres is running
$ brew services start postgresql
# create postgres user (if not existing)
$ createuser postgres
# install gems
$ bundle install
# setup database
$ rake db:setup
# populate database with sample data
$ rake db:populate
Adapt your Procfile.dev based on your local database settings (see Procfile.dev.example) and you can start the development server with auto-reloading using:
bundle exec foreman -f Procfile.dev
- Install the latest version of VirtualBox for your OS
- Install the latest version of Vagrant for your OS
In the project directory, run:
$ vagrant up
This will spin up a new VM and install all required dependencies.
Once the VM is ready, in the project directory run:
# ssh into the VM and change to the mounted project directory
$ vagrant ssh
$ cd /vagrant
# set up the database
$ rails db:setup
# populate the database with sample data
$ rails db:populate
#### Run the application
To run the server:
```sh
$ rails server -b 0.0.0.0 # this makes the application available on http://localhost:3000
Use CTRL
+ c
to shut down the server again.
To run the tests:
$ rspec spec
To exit your ssh session in the VM, simply run:
$ exit
To shut down the VM, run:
$ vagrant halt # $ vagrant up will continue at the state you left the VM
The app is hosted on Amazon Elastic Beanstalk (single instance type running Ruby 2.3, Puma, Nginx). Config in .ebextensions folder. Files are executed in alphabetical order:
- 01options.config - Set Rails specific Elastic Beanstalk variables
- 02packages.config - Install yum packages
- 03nginx.config - Configure webserver
- 04cron.config - Load automated tasks in crontab
- 05eb_housekeeping.config - Remove old application versions
- 06permissions.config - Set file permissions
- 07sitemap.config - Refresh sitemap
See the wiki for further instructions and tutorials.