Chouette2 is an open source web project in Ruby/Rails to edit and view transport offer. It's designed as an SaaS platform and can :
- Exchange transport data : Neptune, GTFS, NeTEx, CSV
- Edit transport data
- Validate transport data
- Offer a Restful API in read-only
- Import and Export Data asynchronously
- Use multi-tenancy database
It uses java library from another git project to import and export various transport data chouette
Feel free to test and access to the free SaaS web site at http://appli.chouette.mobi. Two types of access are granted :
- A demo organisation with a set of data
- login : demo@chouette.mobi
- password : chouette
- Create your own organisation : Must follow the link "Sign up" ("S'inscrire")
The release notes can be found in CHANGELOG file
This code has been run and tested on Travis with :
- Ruby 1.9.3
- Java 7
- Postgres 9.x
- Proj 4.8.0
If Linux distribution does't publish RVM package, install RVM from sources
Install ruby 1.9.3
rvm install ruby-1.9.3-p448
rvm --default use 1.9.3-p448
On Debian/Ubuntu/Kubuntu OS : assume depot contains the correct version
sudo apt-get install postgresql
sudo apt-get install libpq-dev
sudo apt-get install openjdk-7-jdk
sudo apt-get install git
sudo apt-get install unzip
sudo apt-get install proj-bin
sudo apt-get install libproj-dev
sudo apt-get install make
On debian, chouette can also be installed as a package : see debian packages
Install chouette-gui-command to import, export and validate transport offer, Assume Linux user is myuser and its group mygroup (that user is the one who starts Rails server)
sudo mkdir -p /usr/local/opt/chouette-command/
sudo chown -R myuser:mygroup /usr/local/opt/chouette-command/
cd /usr/local/opt/chouette-command/
wget http://maven.chouette.cityway.fr/fr/certu/chouette/chouette-gui-command/2.5.1/chouette-gui-command-2.5.1.zip
unzip chouette-gui-command-2.5.1.zip
cd chouette-cmd_2.5.1
sudo chmod a+w .
Install web application
Get git source code :
cd
git clone -b V2_5 git://github.com/afimb/chouette2
cd chouette2
Download gem librairies
gem install bundler
bundle install
Create [Postgres database user] (./doc/install/postgresql.md)
Create database and its schema
RAILS_ENV=production bundle exec rake db:create apartment:migrate
Prepare static resources (assets)
RAILS_ENV=production bundle exec rake assets:clean assets:precompile
The next step assume default path defined by following settings in file production.rb are unchanged
ImportTask.root
Export.root
Create directories
sudo mkdir -p /var/lib/chouette/imports
sudo mkdir -p /var/lib/chouette/exports
sudo chmod a+x /var/lib/chouette/imports /var/lib/chouette/exports
Configure for Generating URLs in Action Mailer Views.
- Edit production.rb and change
config.action_mailer.default_url_options
- see Action Mailer Configuration documentation
Configure SMTP settings.
- Edit production.rb and change
ActionMailer::Base.smtp_settings
- see Action Mailer Configuration documentation
Configure e-mail address shown on mail sent when user registers, re-initialises its password, ...
- Edit production.rb and change
config.mailer_sender
Configure IGN Géoportail Key.
- Edit production.rb and uncomment and set
config.geoportail_api_key
- see API Géoportail documentation
Configure Google Analytics Key.
- Edit production.rb and change
GA.tracker
- see Google Analytics
Launch the task to import and export asynchronously
RAILS_ENV=production bundle exec rake jobs:work
This task may be added in system start up configuration
Launch rails server with WEBrick ( default RoR web server, note: running on default port 3000)
RAILS_ENV=production bundle exec rails server
This task may be added in system start up configuration. Instead of using WEBrick, Rails application may be deployed on Pushion Passenger with an Apache or NGinx front-end, to make server faster and more robust.
Apache like NGinx can serve static resources
so, change parameter serve_static_assets
to false in production.rb
bundle exec rake db:create
bundle exec rake apartment:migrate
bundle exec rake spec
More information can be found on the project website on GitHub. There is extensive usage documentation available on the wiki.
The description of the restful API is described in :
This project is licensed under the CeCILL-B license, a copy of which can be found in the LICENSE file.
The release notes can be found in CHANGELOG file
Users looking for support should file an issue on the GitHub issue tracking page, or file a pull request if you have a fix available.
Thanks to Ingolf for his photo under CC BY-SA 2.0 license