Go to file
2018-07-13 16:25:21 +02:00
build Drop useless moment locales from built file 2018-07-12 16:47:19 +02:00
config Drop useless moment locales from built file 2018-07-12 16:47:19 +02:00
server Better handling of expiration of GCUM and accidents report types. 2018-07-10 15:55:45 +02:00
src Restore true geolocation 2018-07-13 16:25:21 +02:00
static Fix OpenGraph icon, OG does not support SVG 2018-07-11 16:54:02 +02:00
support Add basic configuration files for nginx and uwsgi 2018-07-11 16:58:50 +02:00
.babelrc Initial commit 2018-06-25 18:29:57 +02:00
.editorconfig Display reports on the map 2018-06-26 11:04:23 +02:00
.eslintignore Initial commit 2018-06-25 18:29:57 +02:00
.eslintrc.js Initial commit 2018-06-25 18:29:57 +02:00
.gitignore Initial commit 2018-06-25 18:29:57 +02:00
.postcssrc.js Initial commit 2018-06-25 18:29:57 +02:00
humans.txt Use font-display CSS property and add OpenGraph meta tags 2018-07-11 01:51:26 +02:00
index.html Display an error message when JS is disabled. 2018-07-11 20:34:46 +02:00
LICENSE.md Add some doc 2018-06-26 15:36:45 +02:00
package.json Drop useless moment locales from built file 2018-07-12 16:47:19 +02:00
README.md Better description of geolocation sharing in About section 2018-07-13 16:09:27 +02:00
requirements.txt Initial commit 2018-06-25 18:29:57 +02:00
robots.txt Add robots.txt and humans.txt files 2018-07-10 19:23:32 +02:00
wsgi.py Add a WSGI file 2018-06-26 15:55:52 +02:00
yarn.lock Drop useless moment locales from built file 2018-07-12 16:47:19 +02:00

Cyclassist

Track and share issues (work, interruption in routes, parked cars) in realtime on bike lanes!

This app is made of two parts: a client webapp and a server part to store and serve the issues. This code is the code running behind https://cyclo.phyks.me/.

As of current version, only the client side part (code running on your local device) handles your geolocation. Your precise geolocation is never sent to the server or any external resource. However, the map background is downloaded on demand from Thunderforest so they could know the location of the displayed map.

OpenData

The data collected by https://cyclo.phyks.me/ is available under an ODbL license. You can get the most up to date JSON dump of available reports at https://cyclo.phyks.me/api/v1/reports.

Hosting your own

Client part

Build setup

# Install JS dependencies
yarn install

# Serve with hot reload at localhost:8080
yarn dev

# Build for production with minification
yarn build

# Build for production and view the bundle analyzer report
yarn build --report

Useful environment variables

You can pass a few environment variables to the yarn build|dev commands to adapt the behavior to your needs.

  • PUBLIC_PATH=https://.../foobar to serve the app from a subdirectory.
  • API_BASE_URL=https://... to specify the location of the server (defaults to /). The value should end with a trailing slash.
  • TILE_SERVER= to pass a specific tile server to use rather than the default one.

You should also have a look at the build variables under the config/ subdirectory.

Server part

Build setup

# Install Python dependencies
pip install -r requirements.txt

# Start the server
python -m server

It is better to use a dedicated virtualenv if you can :)

Useful environment variables

You can pass a few environment variables to the python -m server command to adapt its behavior:

  • HOST= to specify the host to listen to (defaults to 127.0.0.1 which means localhost only).
  • PORT= to specify the port to listen on (defaults to 8081).
  • DATABASE= to specify a database URL to connect to (defaults to sqlite:///reports.db which means a SQLite database named reports.db in the current working directory).

Serving in production

You can use the wsgi.py script at the root of the git repository to serve the server side part. You can find some uwsgi and nginx base config files under the support folder.

Contributing

The quickest way to get started is to simply run

API_BASE_URL=http://127.0.0.1:8081/ yarn dev

to spawn the client-side webapp, listening on localhost:8080 and

python -m server

to spawn the server-side part, listening on localhost:8081.

License

This software is licensed under an MIT license, unless explicitly mentionned otherwise.

Icons are made from the original works: