/citygram

Subscribe to your city.

Primary LanguageRubyMIT LicenseMIT

Citygram Build Status Dependency Status Code Climate

Citygram is a geographic notification platform designed to work with open government data. It allows residents to designate area(s) of a city they are interested in and subscribe to one or more topics. When an event for a desired topic occurs in the subscriber's area of interest, a notification (email, SMS, or webhook) is delivered. Citygram is a Code for America project by the Charlotte and Lexington teams for the 2014 fellowship.

Why are we doing this?

We believe that there is an opportunity to help residents better understand what’s going on in their area, when it’s going to happen, and why. By providing timely information to residents in areas that are relevant to them, the city can be proactive instead of reactive, build trust through transparency, and increase civic engagement across the board.

Who is this made by?

See the contributors list.

Technical Overview

Citygram is a web application written in Ruby.

Setup

In the command line, run the following:

Install Dependencies

git clone https://github.com/codeforamerica/citygram.git
cd citygram
rbenv install local
brew install postgresql postgis
gem install bundler
bundle install

Configure Environment

cp .env.sample .env
rake db:create db:migrate
rake db:create db:migrate DATABASE_URL=postgres://localhost/citygram_test

Developing

To boot up the complete application and run background jobs in development:

bundle exec foreman start
open http://localhost:5000/
Single City Installation

If you only need to support a single city you can specify the ROOT_CITY_TAG to bypass the index and load one city.

For example, https://www.citygram.nyc/ is a single city installation with the following environment variable

ROOT_CITY_TAG=new-york
Sending a Digest
rake digests:send
Sending a Weekly Digest

For Heroku Scheduler users, there is a task that can be executed multiple times, but will only deliver mail on the environment's DIGEST_DAY.

ENV['DIGEST_DAY'] = 'wednesday'
rake digests:send_if_digest_day

Heroku Scheduler

Testing

Run all tests in the spec/ directory.

rake