Skip to content

Instantly share code, notes, and snippets.

@mocon
Last active February 3, 2020 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mocon/13b50b4d665901450dc57ab055703b4b to your computer and use it in GitHub Desktop.
Save mocon/13b50b4d665901450dc57ab055703b4b to your computer and use it in GitHub Desktop.

Habit Tracker 0.0.1

Keep track of your recurring habits, and view your completion percentages over time.

Views

These are the four required views within the app:

Login/Signup, Code view

  • Enter email and password, then enter SMS code
  • user
    • email! String myles.oconnor@gmail.com
    • password! String ***********
    • pronoun Enum ['female', 'male', 'neutral'] Optional
    • firstName String Myles Optional
    • lastName String O'Connor Optional

Stats view

  • List of habits, show % completion rate for 'this week', 'this month', 'this quarter', 'this year'
  • Link to add new habit

Habits view

  • Enter new habit
    • name! String 'Meditate'
    • length Number 10 Optional (enter as hours, minutes, convert to minutes to save in db)
    • days! Array ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday']
    • repeatEveryUnit! Enum 'week', 'month', 'year'
    • repeatEveryCount! Number 1
    • startingDate! String '2020-02-01'
    • record! Array [{ date: '2020-02-01', completed: true }] completed is Boolean with default false
    • active! Boolean true
  • Steps in form:
    • 'What will I do?' 'Meditate for 10 minutes'
    • 'Will it take a certain amount of time?' Optional, 1 hours, 30 minutes saved as 90
    • 'Which day or days of the week?' ['monday', 'wednesday', 'friday']
    • 'Repeat every...' 1 'week'
  • Edit existing habit
  • Delete habit (toggle active, doesn't actually delete)

Log view

  • Receive push notification on all days with >0 habit events, linking you to Log view
  • List of last week's worth of possible habit occurrances, with most recent at top
  • Check off completed habits, as many as you want
  • Be able to scroll into future, all future habit occurrances are disabled, cannot be checked off

Design inspiration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment