Analytics and data visualization site for Strava
Bringing machine learning analytics, data visualization and weather data to cycling activities and segments.
First, install the dependencies. Ensure you have Node.js installed and npm:
npm install
Now setup the configuration file in the root folder as follows (saved as config.js
):
const clientID = 0;
const clientSecret = "0";
const callbackURL = "http://localhost:3000/login/callback";
const weatherKey = "YourDarkSkyWeatherKey";
const port = 3000;
const accessToken = "0";
const mlEndpoint = "YourMLEndPoint";
const defaultExpirationTime = 7200; // Redis cache expiration time
const mongoDBUrl = ''; // MongoDB url
const dailyDarkSkyLimit = 500; // Hard limit on API calls per day
const elasticsearchendpoint = 'YourElasticsearchEndpoint';
exports.clientID = clientID;
exports.clientSecret = clientSecret;
exports.callbackURL = callbackURL;
exports.port = port;
exports.weatherKey = weatherKey;
exports.accessToken = accessToken;
exports.mlEndpoint = mlEndpoint;
exports.defaultExpirationTime = defaultExpirationTime;
exports.mongoDBUrl = mongoDBUrl;
exports.dailyDarkSkyLimit = dailyDarkSkyLimit;
exports.elasticsearchendpoint = elasticsearchendpoint;
Now setup a Redis instance and direct it to localhost
with port 6379
(default configuration).
Install and run the machine learning server with Flask:
FLASK_APP=app.py flask run
To start the server use:
npm start
You can run tests using Mocha and Chai:
npm test
Feel free to submit a pull request. The coding conventions of this app follow the Airbnb base style guide.