Giter Club home page Giter Club logo

hswtrack's Introduction

hswtrack - fitness app

A web application for tracking your weight and keeping track of your exercises. I found this to be the best way to combine exercising and programming.

Here's a screenshot taken on a Nexus 5:

Running unit tests

  1. Start the hswtrack server in test config with: cabal run -- -e test
  2. In another shell, run: cabal test

JSX building

npm install react-tools
./node_modules/.bin/jsx --watch static/app/jsx static/jsx-build

Building minified Javascript

npm install -g requirejs
cd <project_root>
r.js  -o app.build.js

Building custom jquery with only AJAX features

From http://stackoverflow.com/questions/15853584/extract-ajax-part-from-jquery-library:

./node_modules/.bin/grunt custom:-css,-deprecated,-dimensions,-effects,-event-alias,-offset,-sizzle

For more details, see: https://github.com/jquery/jquery#how-to-build-your-own-jquery

Tech details

Written in Haskell using the Snap Framework using Sqlite3 for persistence.

Departs from typical Snap apps in that it doesn't use Heist templating. Rather all HTML templating is done in JavaScript on the client using ReactJS.

hswtrack's People

Contributors

nurpax avatar jannehellsten avatar

Stargazers

hong avatar Kristoffer Josefsson avatar  avatar brandon flowers avatar Rehno Lindeque avatar

Watchers

James Cloos avatar  avatar

Forkers

rharink

hswtrack's Issues

/rest entry point shouldn't serve static HTML on mismatch

Currently the routes are defined such that if you do e.g.

GET /rest/note

(currently unknown entry point), the server will return static HTML (e.g. default to serveDirectory or similar). It'd be better if this case would just return an error.

allow making workouts public

Add a button that can be used to mark a specific workout public.

When a post is marked public, it should be viewable without a login.

The UI needs to be slightly different for non-logged in users - e.g. the button for marking the post public should only be enabled for logged in user that owns the post.

add exercise types for (required) weighted and BW exercises

Chin-ups are bodyweight. When adding a new exercise for "chin-ups", this information should be recorded so that when add chin-up sets, the UI would know that the weight part of the input form is not mandatory and it could default to zero or null.

get rid of snap-extras dependency

I added snap-extras back into deps recently, but I think this was a mistake. It pulls in a whole bunch of libraries that I don't need just so that I can use getJSON and writeJSON.

REST API clean up

/rest/note
/rest/notes

should be just one entry point where

GET /rest/note

will return a list of notes.

Currently GET /rest/note serves static HTML.

Need to review all of the entry points for the same principle.

round weights

E.g., if you type in 92.2 for today's weight, you should see 92.2 in the UI, not 92.19999..

improvements to fito importer

  • retain original exercise order in a workout (e.g., if squat was first in a day's workout, it should show up first in hswtrack too)
  • retain fito comments (at least some of them)
  • allow setting userId & database name on the command line

check for duplicate exercise names when creating new ones

See

+-- TODO need to check for dupes by lower case name here, and return
+-- error if already exists
+restNewExerciseType :: H ()
+restNewExerciseType = jsonResponse put
+  where
+    put _user = do
+      name <- getTextParam "name"
+      lift $ withDb $ \conn -> do
+        Model.addExercise conn name
+        Model.queryExercises conn
+

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.