Simple Ruby on Rails web application based in Foursquare. Includes rspec tests for MVC and routes.
Each location has visits, wherein one visit has one user. It is possible to have many visits in one location, but only one location and one user per visit.
Needs Ruby 2.1, Rails 4.1 and PostgreSQL.
$ git clone https://github.com/naoisegolden/Meet-me-app.git & cd Meet-me-app
$ bundle install
$ rake db:create
$ rake db:migrate
$ rake db:seed
If PostgreSQL needs to be installed:
$ brew install postgres
$ initdb /usr/local/var/postgres
To start the PostgreSQL server:
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
Note: do this before $ rake db:create
$ rails server
Go to http://0.0.0.0:3000/
# Install Heroku Toolbelt https://toolbelt.heroku.com/
$ heroku login
$ heroku create
$ git push heroku master
$ heroku run rake db:migrate
$ heroku run rake db:seed # if first time
$ heroku ps:scale web=1
$ heroku open
http://0.0.0.0:3000/locations.json
[
{
"name":"Beach",
"city":"Mallorca",
"country":"Spain",
"latitude":"39.695263",
"longitude":"3.017571",
}
…
]
http://0.0.0.0:3000/locations/1.json
{
"name":"Beach",
"city":"Mallorca",
"country":"Spain",
"latitude":"39.695263",
"longitude":"3.017571",
"user":
{
"name":"Jane",
"email":"[email protected]"
}
}