| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
 | # Chouette2 [](https://travis-ci.org/afimb/chouette2) [](https://gemnasium.com/afimb/chouette2) [](https://codeclimate.com/github/afimb/chouette2)
Chouette2 is an open source web project in Ruby/Rails to edit and view transport offer. It's designed as an [SaaS](http://en.wikipedia.org/wiki/Software_as_a_service) platform and can :
* Exchange transport data : [Neptune](http://www.chouette.mobi/spip.php?rubrique61), [GTFS](https://developers.google.com/transit/gtfs/reference?hl=fr), [NeTEx](http://www.kizoom.com/standards/netex/), CSV
* Edit transport data
* Offer a [Restful API](https://en.wikipedia.org/wiki/Representational_state_transfer) in read-only
* [Import, Export and Validate transport data asynchronously](http://github.com/afimb/chouette)
* Use [multi-tenancy database](http://en.wikipedia.org/wiki/Multitenancy)
It uses java library from another git project to import, export and validate various transport data [chouette](http://github.com/afimb/chouette)
Feel free to test and access to the free SaaS web site at [http://appli.chouette.mobi](http://appli.chouette.mobi/chouette2/users/sign_in). 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")
Release Notes
-------------
The release notes can be found in [CHANGELOG](./CHANGELOG.md) file
Requirements
------------
* [Chouette Web Service IEV](https://github.com/afimb/chouette) 3.X (that requires Postgres and Java)
* Ruby 1.9.3 or 2.1.6
* Bundler 1.10.3
* Proj 4.8.0
External Deps
-------------
Install Chouette Web Service IEV [see how to](https://github.com/afimb/chouette/readme.md) 3.X.
Next steps assumes that :
* a Chouette Web Service IEV is running (on localhot port 8080)
* a Postres database exists (chouette2 on localhot, port 5432) with a postgres user (chouette, with password chouette)
On Debian/Ubuntu/Kubuntu OS : assume depot contains the correct version
```sh
sudo apt-get install libpq-dev
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
```
If Linux distribution does't publish RVM package,
install [RVM from sources](./doc/install/rvm.md)
Install ruby 2.1.6
```sh
rvm  install ruby-2.1.6
rvm --default use 2.1.6
```
Install bundler 1.10.3
```sh
gem install bundler -v 1.10.3
```
Installation
------------
On debian, chouette can also be installed as a package : see [debian packages](http://packages.chouette.cityway.fr/debian/chouette)
Install web application
Get git source code :
```sh
cd
git clone -b V3_0 git://github.com/afimb/chouette2
cd chouette2
```
Download gem librairies
```sh
bundle install
```
Update database schema
```sh
RAILS_ENV=production bundle exec rake db:migrate
```
Prepare static resources (assets)
```sh
RAILS_ENV=production bundle exec rake assets:clobber assets:precompile
```
Configuration
-------------
Configure for Generating URLs in Action Mailer Views.
* Edit [production.rb](./config/environments/production.rb) and change ```config.action_mailer.default_url_options```
* see [Action Mailer Configuration documentation](http://guides.rubyonrails.org/action_mailer_basics.html)
Configure assets access (Must be true if you use Webrick or false if you use Apache or Nginx).
* Edit [production.rb](./config/environments/production.rb) and change ```config.serve_static_assets```
Configure SMTP settings.
* Edit [production.rb](./config/environments/production.rb) and change ```ActionMailer::Base.smtp_settings```
* see [Action Mailer Configuration documentation](http://guides.rubyonrails.org/action_mailer_basics.html)
Configure e-mail address shown on mail sent when user registers, re-initialises its password, ...
* Edit [production.rb](./config/environments/production.rb) and change ```config.mailer_sender```
Configure Rails secret key.
* Edit [secrets.yml](./config/secrets.yml) and uncomment and set```secret_key_base```
* see [Rails documentation](http://guides.rubyonrails.org/4_1_release_notes.html#config-secrets-yml)
Configure address to Chouette Web Service IEV.
* Edit [secrets.yml](./config/secrets.yml) and uncomment and set```api_endpoint```
Configure Google Analytics Key.
* Edit [secrets.yml](./config/secrets.yml) and change```google_analytic_tracker```
* see [Google Analytics](https://www.google.fr/intl/fr/analytics/)
Configure IGN Géoportail Key.
* Edit [secrets.yml](./config/secrets.yml) and uncomment and set```geoportail_api_key```
* see [API Géoportail documentation](http://api.ign.fr/accueil)
Configure the way that it sends email.
* Edit [devise_async.rb](./config/initializer/devise_async.rb) and uncomment and set```Devise::Async.enabled``` ( true if you want to use asynchronously and false otherwise )
* see [Devise Async specification](https://github.com/mhfs/devise-async)
Run
---
Launch the task if you want to send mail asynchronously (See previous chapter to desactivate it)
```sh
RAILS_ENV=production bundle exec rake jobs:work
```
This task may be added in system start up configuration
Launch rails server with [WEBrick](http://guides.rubyonrails.org/command_line.html#server-with-different-backends) ( default RoR web server, note: running on default port 3000)
```sh
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](https://www.phusionpassenger.com/) with an [Apache](http://httpd.apache.org/) or [NGinx](http://nginx.com/) 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](./config/environments/production.rb)
Test
----
```sh
bundle exec rake db:create
bundle exec rake db:migrate
bundle exec rake spec
```
More Information
----------------
More information can be found on the [project website on GitHub](.).
There is extensive usage documentation available [on the wiki](../../wiki).
API Documentation
-----------------
The description of the restful API is described in :
* [User manual file](./doc/interfaces/Chouette_API_REST_v1.2.pdf)
* [XSD file](./doc/interfaces/api_rest_v1.xsd)
* [Chouette Web Service IEV](https://github.com/afimb/chouette/blob/master/doc/interface/Chouette-API%20serveur%20IEV-1.0.pdf)
License
-------
This project is licensed under the CeCILL-B license, a copy of which can be found in the [LICENSE](./LICENSE.md) file.
Release Notes
-------------
The release notes can be found in [CHANGELOG](./CHANGELOG.md) file
Support
-------
Users looking for support should file an issue on the GitHub [issue tracking page](../../issues), or file a [pull request](../../pulls) if you have a fix available.
Credits
-------
Thanks to Ingolf for his [photo](https://www.flickr.com/photos/ingolfbln/7663851694) under CC BY-SA 2.0 license
 |