Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (41 sloc) 1.4 KB

Geofence Server in Ruby (a simple example)

This is a simple example project to showcase geofencing with Ruby and Mongo. There is a full write-up that can be found on my blog.

I make no promises about this server. To be honest it probably has lots of issues, could be done better, and definitely won't scale. But it's fun to look at and should give you some ideas when it comes to your own implementation.

Getting Started

Pull from github

git clone git://

Install Gems

cd geofence-server-example

Start Server

bundle exec thin -p 4242 start

Make requests!

# Create a fence
curl -d '[[0, 0], [0, 4], [4, 0], [4, 4]]'

# Check that it was created 

# Query the fence
# Replace :id with the actual string-representation of a Mongo Document ID
# (You can find that by getting the fences with /fences)

Exploring with the Console

Once you've played around with the project's web server, you might want to take a look at the code. It's rather simple and could serve as a good starting point for you. If you really want to get hands one with the application you can start up the interactive console: