Giter Site home page Giter Site logo

davidwilemski / openrunlog Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 5.0 859 KB

[Currently Unmaintained] An open source web application to record and display your workouts

Home Page: https://openrunlog.org

License: Other

Python 46.31% CSS 0.36% JavaScript 34.74% HTML 18.51% Shell 0.08%

openrunlog's Introduction

#Open Run Log

Build Status Requirements Status

What is Open Run Log?

I intend for Open Run Log (ORL) to be an open source platform that allows people to easily and quickly record their runs and additionally view information about past workouts easily in a visual manner.

I aim to do away with tedious spreadsheets and other solutions that end up being a huge hassle once you have any sort of volume.

Running ORL

If you'd like to your own copy of ORL either for development or just personal use you can follow these simple steps.

First, some dependencies:

  • MongoDB
  • redis
  • Python (I use 2.7 but 2.6 should work as well)

Steps:

  1. Install the required Python modules (virtualenv recommended)

pip install -r requirements.txt

  1. Configure via environment variables
export ORL_DB_NAME="openrunlog"
export ORL_DB_URI="mongodb://localhost/openrunlog"
export ORL_DEBUG="True"
export ORL_COOKIE_SECRET="insertyourrandomstringhere"
  1. Run ORL!

supervisord

openrunlog's People

Contributors

bkendall avatar davidwilemski avatar jackwink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

openrunlog's Issues

Client side run validation

Further validate add run form (a run's pace should never be less than say 3:20/mile or something) and if you're running 1000 miles at once, you're crazy.

Or something like that.

Backups broken due to mongoctl/pymongo incompatibility

Traceback (most recent call last):
  File "/home/david/orl_env/bin/mongoctl", line 48, in <module>
    from mongoctl import mongoctl
  File "/home/david/orl_env/local/lib/python2.7/site-packages/mongoctl/mongoctl.py", line 56, in <module>
    from pymongo import Connection
ImportError: cannot import name Connection

Remove models.Week

It has been used as an aggregation tool but I'm not convinced it is worth the trouble. We can query directly from model.Run + some aggregation methods.

Embedable Calendar/Log

Wouldn't it be something if we could provide an embedable calendar or log of some sort? Maybe to put on personal sites? Or maybe, a report page that could be shared on [insert social media here] to show progress? What do you think, @davidwilemski ?

Invalid Profile View

If you view an invalid profile, e.g. /u/asdf, it causes an internal error (500). This probably should be resolved into a 400 error--I tried to make this a quick fix into my other branch, but I couldn't figure it out cleanly...

Error Pages

There should probably be pages designed for 404s / 500s...

Shoe Tracking

A few people have mentioned tracking shoe mileage to me

Interface for viewing ALL THE RUNS

Either one huge page with a table or a paginated table view would be great.

A paginated table view allows for smaller (faster!) queries but I'm not sure if it matters just yet...

Enable CSP in HTTP headers

Would love to enable content security policy for no in-line JS.

Gotta get javascript out of the html templates (specifically dashboard.html).

  • remove all inline javascript
  • enable CSP headers to disable inline scripts

Reliable work queue / workers

Refactor the worker setup so that jobs cannot be lost if they fail / crash.

2 options:

run streaks

How many days in a row have I run and what was my best streak?

Modularize the top lefthand corner of the profile page

We're using the photo/display_name/yearly mileage combo on more pages now, it should be modularized in some way.

Either as a UIModule or make the dashboard and run.html templates extend something like baseprofile.html instead where baseprofile has the photo block

DB backup worker process

we should backup data in the service in a more rigorous way.

A worker process that uploads data to an external storage system (such as s3) periodically:

  • every 24 hours would be a great start
  • more often (within an hour) if there has been new data posted
  • keep backup state (probably in memory or in redis)
  • use backup state to prune backups (keep a handful of recent backups and a handful of weekly backups or something)

Similar Runs

It would be really cool to be able to do some sort of analysis on run data to find similar past runs and or workouts to the one you just posted or are currently viewing.

A basic version could look at just distance and pace data to say "here's some runs of similar distance, it's better/worse/about average"

A more advanced version would be able to look into run notes to note similar text to past ones. For instance, on a run that was 3x3200m show other workouts that contain "x3200m" in the notes so that you can more easily look back at workouts that are similar and see a progression.

Sessions

I'm a-gonna write up a little more clever session management. Going to put it in Redis and put the information in the cookie. To come soon!

fork_process breaks app when ORL_DEBUG=False

See stack trace:

{'debug': 'False', 'db_uri': 'mongodb://localhost/openrunlog', 'db_name': 'openrunlog', 'cookie_secret': 'insertyourrandomstringhere'}
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/Users/bkend/Documents/openrunlog/workspace/openrunlog/main.py", line 88, in <module>
    process.fork_processes(process.cpu_count()*2 + 1)
  File "/Users/bkend/Documents/openrunlog/lib/python2.7/site-packages/tornado/process.py", line 112, in fork_processes
    raise RuntimeError("Cannot run in multiple processes: IOLoop instance "
RuntimeError: Cannot run in multiple processes: IOLoop instance has already been initialized. You cannot call IOLoop.instance() before calling start_processes()

Simply assigning this to @davidwilemski since I have no idea what this actually does :)

Improve homepage/landing page

The homepage for non-logged in users is currently terrible.

It could be improved to include screenshots of the app and large sign up / log in buttons.

calendar exception on no data for calendar period

at least I think that's what this means:

[E 131226 21:00:12 web:1228] Uncaught exception GET /u/robrose/calendar (5.10.83.11)
    HTTPRequest(protocol='http', host='openrunlog.org:80', method='GET', uri='/u/robrose/calendar', version='HTTP/1.0', remote_ip='5.10.83.11', headers={'Connection': 'close', 'Accept-Encoding': 'deflate, gzip', 'X-Real-Ip': '5.10.83.11', 'X-Forwarded-For': '5.10.83.11', 'Host': 'openrunlog.org:80', 'Accept': '*/*', 'User-Agent': 'Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot/)'})
    Traceback (most recent call last):
      File "/home/david/orl_env/local/lib/python2.7/site-packages/tornado/web.py", line 1144, in _when_complete
        if result.result() is not None:
      File "/home/david/orl_env/local/lib/python2.7/site-packages/tornado/concurrent.py", line 129, in result
        raise_exc_info(self.__exc_info)
      File "/home/david/orl_env/local/lib/python2.7/site-packages/tornado/stack_context.py", line 302, in wrapped
        ret = fn(*args, **kwargs)
      File "/home/david/orl_env/local/lib/python2.7/site-packages/tornado/gen.py", line 550, in inner
        self.set_result(key, result)
      File "/home/david/orl_env/local/lib/python2.7/site-packages/tornado/gen.py", line 476, in set_result
        self.run()
      File "/home/david/orl_env/local/lib/python2.7/site-packages/tornado/gen.py", line 507, in run
        yielded = self.gen.send(next)
      File "/home/david/orl_env/local/lib/python2.7/site-packages/openrunlog/calendar.py", line 27, in get
        calendar_runs = models.Run.get_calendar_runs(profile)
      File "/home/david/orl_env/local/lib/python2.7/site-packages/openrunlog/models.py", line 429, in get_calendar_runs
        if runs[len(runs)-1].date != today:
      File "/home/david/orl_env/local/lib/python2.7/site-packages/mongoengine/queryset/base.py", line 150, in __getitem__
        return queryset._document._from_son(queryset._cursor[key],
      File "/home/david/orl_env/local/lib/python2.7/site-packages/pymongo/cursor.py", line 465, in __getitem__
        raise IndexError("Cursor instances do not support negative"
    IndexError: Cursor instances do not support negativeindices

Improve run calendar

  • A hover box or something would be great to display information about a day's runs (remember there can be more than 1)
  • It would be great to be able to link the calendar boxes/hoverboxes to the run pages - again, more than 1 run possible.
  • A way to scroll back through months would be great
  • Make days without running red!

racelog!

Add a page to log races like the profile currently does for training runs.

Some possibilities for the first version:

  • Allow entries for common race distances (1500m/1600m/1 mile/3k/5k/10k/marathon/half marathon/etc) - in the future we could allow for custom distances
  • Keep track of PRs for each distance

Streak worker exception: going over cursor/list bounds

Traceback (most recent call last):
  File "/home/david/orl_env/local/lib/python2.7/site-packages/rq/worker.py", line 429, in perform_job
    rv = job.perform()
  File "/home/david/orl_env/local/lib/python2.7/site-packages/rq/job.py", line 348, in perform
    self._result = self.func(*self.args, **self.kwargs)
  File "/home/david/orl_env/local/lib/python2.7/site-packages/openrunlog/rqworkers.py", line 22, in calculate_streaks
    user.calculate_streaks(r)
  File "/home/david/orl_env/local/lib/python2.7/site-packages/openrunlog/models.py", line 252, in calculate_streaks
    self.streaks = self._calculate_streaks(runs)
  File "/home/david/orl_env/local/lib/python2.7/site-packages/openrunlog/models.py", line 276, in _calculate_streaks
    delta = relativedelta(runs[i+1].date, runs[i].date)
  File "/home/david/orl_env/local/lib/python2.7/site-packages/mongoengine/queryset/base.py", line 150, in __getitem__
    return queryset._document._from_son(queryset._cursor[key],
  File "/home/david/orl_env/local/lib/python2.7/site-packages/pymongo/cursor.py", line 472, in __getitem__
    raise IndexError("no such item for Cursor instance")
IndexError: no such item for Cursor instance

Streak function issues

I found some bugs with run streaks. They're mostly centered around max streaks of 1 day.

  • Fix the bugs
  • Refactor streak code to be testable
  • Test it!

Make URL required for all accounts (remove the /dashboard endpoint)

I want to deduplicate handler code

This will also make it so that when /u/:username/racelog is done then there doesn't have to be duplicated handler code for private accounts.

All accounts will need URLs. This could break accounts that are private and don't currently have them. A workflow will be needed for that case.

Training analysis

This could build on similar run analysis but over a rolling range of time. We could color code graphs based on how a run compares in distance or pace to other runs that happened near the same time as it. Further, we could even do things like notice the potential for overtraining, injury, suggest days off if pace has been suffering. We could even come up with customized training plans based on future goals and current training..

Workout "type"

Jimmy:

So the user could put in the workout's attributes and times for each, then > you could add up total mileage and display that in the graph.
Maybe even have workouts be different colors.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.