Server component of Social Cycling app.
Go to file
2020-08-23 15:03:46 -05: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 return centroid of offset locations where rides _will be_ 2020-08-20 13:16:32 -05:00
README.md imported from https://gitlab.com/rgarcia-herrera/social-cycling/-/tree/master/flock_server 2020-08-05 14:09:38 -05:00
requirements.txt refactoring to remove road-agent dependency 2020-08-18 17:33:12 -05:00
server.py return centroid of offset locations where rides _will be_ 2020-08-20 13:16:32 -05:00
test_model.py imported from https://gitlab.com/rgarcia-herrera/social-cycling/-/tree/master/flock_server 2020-08-05 14:09:38 -05:00
test_server.py actual tests with nice minimal framework 2020-08-23 15:03:46 -05: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)