Server component of Social Cycling app.
Go to file
rgarcia-herrera 2ca8b2a306 testing stub
2021-11-01 14:35:26 -06:00
.gitignore refactoring to remove road-agent dependency 2020-08-18 17:33:12 -05:00
LICENSE this is free software 2020-08-05 14:11:58 -05:00
model.py use speed of agent to filter age of db records 2021-11-01 14:34:50 -06:00
non_test_model.py testing stub 2021-11-01 14:35:26 -06:00
README.md use speed of agent to filter age of db records 2021-11-01 14:34:50 -06:00
requirements.txt refactoring to remove road-agent dependency 2020-08-18 17:33:12 -05:00
server.py use speed of agent to filter age of db records 2021-11-01 14:34:50 -06:00
test_server.py testing stub 2021-11-01 14:35:26 -06:00

Flock Server

This program is the server component of the Social Cycling mobile app.

Installation and running

Clone or download this repo. Install Python libraries, like so:

$ pip install -r requirements.txt
[...]

MongoDB setup

MongoDB is used for data persistence. Geographical queries require the creation of indexes for the point and destination fields.

$ mongodb
[...]
> use test
switched to db test
> db.bike.createIndex({point:"2dsphere"});
[...]
> db.bike.createIndex({destination:"2dsphere"});
[...]

Development webserver

In a production environment Flask apps must be deployed with a dedicated webserver. Instructions for doing so are documented elsewhere.

For simplicity the app may be run with the included development server, using the following commands:

$ export FLASK_APP=server.py
$ flask run
* Serving Flask app "server.py"
[...]
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

Instance at LANCIS

We're hosting an instance of this server at

http://flock.apps.lancis.ecologia.unam.mx/