Git Product home page Git Product logo

opencongress's Introduction

OpenCongress - a Ruby on Rails application for displaying information about Congress


## Getting started with our code

A. Dependencies

Start by installing all the packages required by OpenCongress.

For Ubuntu:

sudo apt-get install postgresql postgresql-client postgresql-contrib libpq-dev ruby1.8 ruby1.8-dev rubygems libopenssl-ruby imagemagick libmagick9-dev gcj-4.4-jre

or Mac OS X, start by installing MacPorts, then run:

sudo port install postgresql84 postgresql84-doc postgresql84-server ImageMagick md5sha1sum wget

Follow the instructions from the port install for initializing your database


Then grab the gems you need:


sudo gem install rails bluecloth mediacloth hpricot htree jammit json pg RedCloth ruby-openid simple-rss rmagick htmlentities oauth

Note for OS X: You may need to specify additional compile options for the pg gem. Make sure pg_config is in PATH and run sudo env ARCHFLAGS="-arch x86_64" gem install pg

B. Database setup

Switch to the postgres user and setup a db user following prompts for password and superuser.

sudo su postgres
createuser opencongress -P

Create your database

createdb opencongress_development -O opencongress

Import the tsearch2 backwards compatibility lib from wherever your postgres contribs got installed.

psql opencongress_development < /your/install/share/postgresql/contrib/8.4/tsearch2.sql

exit postgres user

C. App Setup

Copy over example yml files in /config

cd config; for file in `ls *example*`; do cp $file `expr "$file" : '\([^-\.]*\)'`.yml; done

Edit database.yml:

development:
adapter: postgresql
database: opencongress_development
username: opencongress
password: (password from step B)
host: localhost

Now you can start the solr server and run the database migrations

cd ..;rake solr:start
rake db:structure:load
rake db:seed

D. Data

create some dirs for data

Make sure all your data paths are set and exist in your environment file then run rake update:all to fetch and parse all available data sources. This process will take a very long time. Take a look at /lib/tasks/daily.rake for all the rake tasks if you want to run them individually.

Now just a script/server and you should be running


Copyright (c) 2005-2010 Participatory Politics Foundation

OpenCongress is licensed, as a whole, under AGPLv3. Components added prior to OpenCongress version 3 (July 27, 2011) were and are licensed under GPLv3. All components added for or after OpenCongress version 3 are licensed AGPLv3. When you contribute a patch to OpenCongress, it will be licensed under AGPLv3. See LICENSE-AGPLv3 file for details.

opencongress's People

Contributors

opencongress avatar morganknutson avatar agp avatar davidmooreppf avatar d2d avatar

Stargazers

Gazzeh Wael avatar

Watchers

James Cloos avatar Gazzeh Wael avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.