Legislative is a channel of participation and seeks to bring information to the public what is happening to our Congress. Built using POPLUS environment.
Make sure you're using ruby 2.0 or above (we highly recommend using rvm), and that bundler is installed.
Legislative uses the following Poplus components: Pop-it, Write-it and Bill-it. You should create an instance of the services, or have your own installation in order for all features to be available.
The following system requirements are also needed, for image manipulation:
Red Hat / Fedora / CentOS
sudo dnf install sqlite-devel ImageMagick-devel
Debian / Ubuntu (for 13.04 and Wheezy also install libmagickwand-dev
)
sudo apt-get install imagemagick libmagickwand-dev
Ubuntu (14.04) need install sqlite3 and sqlite3-dev
sudo apt-get install sqlite3 sqlite3-dev
OS X
brew update
brew install ImageMagick
gem install rmagick
Clone the git repo - git clone https://github.com/ciudadanointeligente/legislative.git
- or download it
Go to your legislative folder and run install
sh setup.sh
Install the required ruby gems
bundle install
Create the config files
cp config/database.yml.example config/database.yml
Then run your server
rails s
Check at http://localhost:3000
You can try loggin in with [email protected] / benito
Legislative need you have an instances of Bill-it for store all yours bills, for more information visits Github Bill-it page
Legislative need you have an instance of Popit for store your congressmen personal data, for more information please visits Github Project Page or Popit website
in Chile, an Agenda is the roadmap of a congressman when works out of the congress, then, the agenda is a recopilation of what are they doing in is own District that represent. for default the config of display this section is disabled and if you wanna enable this one, only need add the following line on your private_legislative.yml with the url pointing to an API, like Morph.io, to consume this information if you dont use Morph.io just forget the line 'morph_io_api_key'
morph_io_api_key: ~
agendas_url: ~
agendas_enabled: ~
the API response need an Array of bills, here is an example
if you need adjust the crop size of the thumbnails, only need setup a few values on private_legislative.yml adding the following values
congressman_pic_x: '15'
congressman_pic_y: '15'
congressman_pic_w: '160'
congressman_pic_h: '150'
for default the values are: 15,15,160,150 wich represents x, y, width and heigth
This section will not be relevant to most people. It will however be relevant if you're deploying to a production server.
Create the follow config files, and edit them with your project's specific values.
cp config/newrelic.yml.example config/newrelic.yml
cp config/schedule.rb.example config/schedule.rb
cp config/private_legislative.yml.example config/private_legislative.yml
The private_legislative.yml is the file that holds all your private config values. While legislative.yml gets synced to your github repo, private_legislativeyml does not.
We recommend the follow commands in the job for automatic deploy and the use of phusion passenger as web server and application server with apache or nginx in production.
bundle install
rake db:migrate
rake tmp:cache:clear
rake assets:clean
rake assets:precompile
To run tasks like send notifications emails of changes in bills the project use whenever, this tool generate cron jobs from the config/schedule.rb
file.
Add the jobs to crontab:
bundle exec whenever --update-crontab legislative
Clear the jobs associated with a app name:
bundle exec whenever --clear-crontab legislative
For improve the performance in production is a good idea change the db engine from sqlite3 to mariaDB or postgreSQL. To use mariaDB you need edit config/database.yml
config file.
Red Hat / Fedora / CentOS
yum install mariadb-server mariadb-devel
Debian / Ubuntu
apt-get install mariadb-server libmariadbd-dev
OS X
brew install mariadb
- Security Authentication system
- Remember me
- Users CRUD
- SQLite (Default)
- MySQL / MariaDB
Change the cookie secret token at
config/initializers/secret_token.rb
# Be sure to restart your server when you modify this file. # Your secret key for verifying the integrity of signed cookies. # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. Legislative::Application.config.secret_token = 'YOUR-NEW-TOKEN-HERE'
To run the RSpec tests
rspec
- You can found this in the Issues page.
- jQuery: MIT/GPL license
- Modernizr: MIT/BSD license
- Normalize.css: Public Domain
- Twitter bootstrap: Apache License, Version 2.0 (the "License")
- Ruby on Rails: MIT license
- RailStrap scripts: Public Domain
Yes.
Legislative is made possible by the continued contributions and insights from kind-hearted developers everywhere. Just to name a few:
- @rezzo
- @maugsbur
- @jdgarrido
- @pdaire
- @lfalvarez
- @kathemalis
- @CamiloG
- @camargozzini
- @melizeche
- @martinszy
This project is licensed under the GNU Affero General Public License (AGPL). For more information you can access to the digital license edition here.
For more information about us, our site Fundación Ciudadano Inteligente. And if you want help with patches, report bugs or replicate our project check our repositories.