davidwilemski / openrunlog Goto Github PK
View Code? Open in Web Editor NEW[Currently Unmaintained] An open source web application to record and display your workouts
Home Page: https://openrunlog.org
License: Other
[Currently Unmaintained] An open source web application to record and display your workouts
Home Page: https://openrunlog.org
License: Other
Currently the form client side tries to enforce a max distance of 250 miles - the server doesn't do the same validation.
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:
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.
Maybe using parsely.js?
The various processes should be named so that we don't have a bunch of processes all named python
.
For example the web server process could be named orl.app
or similar.
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 :)
There should probably be pages designed for 404s / 500s...
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.
Can have a 2nd page that isn't the main profile that lists past races and current PRs
Would love to enable content security policy for no in-line JS.
Gotta get javascript out of the html templates (specifically dashboard.html).
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.
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...
I found some bugs with run streaks. They're mostly centered around max streaks of 1 day.
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
Less IOLoop blocking?
https://github.com/heynemann/motorengine
... or could just make sure all mongoengine operations are done on a thread
Add a page to log races like the profile currently does for training runs.
Some possibilities for the first version:
for some reason the daily/monthly user query drops down to 0 around midnight each day. The data should actually be continuous.
On the settings post handler we need a check similar to that in the registration post handler.
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.
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
Currently, the server populates the default date value. This can lead to unexpected date entries depending on timezone relative to the server. A bit of javascript could fix this :)
A few people have mentioned tracking shoe mileage to me
This could be tricky since you call out to the library instead of editing markup. right now I'm just removing the dom elements and rebuilding them.
A potential hack for doing this could be something like this:
http://jsfiddle.net/davidwilemski/6kzM9/
It would be good to have more visibility into the error rate of the site
only allow alphanumerics and maybe '_' and '.'
As of this writing we are at 3.1
In testing the new worker queue (#56), I found a bug with the date output of streak calculation:
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
bug only manifests on the 1st and 2nd of the month
https://travis-ci.org/davidwilemski/openrunlog/builds/7713193
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.
Refactor the worker setup so that jobs cannot be lost if they fail / crash.
2 options:
int -> float
not much use for races <5k otherwise...
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..
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...
The server validates the date but the input form doesn't
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.
How many days in a row have I run and what was my best streak?
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
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!
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 ?
This will deal with any unexpected system restarts
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.