stevegrossi / habits

An Elixir/Phoenix app for tracking daily habits, ready to deploy to Heroku.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Achievements, e.g. 1000 total check-ins, 100 check-ins per habit, 7 days in a row, etc.

stevegrossi opened this issue · comments

I'm thinking at least two kinds of achievements, with some examples:

  • Account-level achievements
    • counts, e.g. 1000 Total Check-Ins
    • habit counts, e.g. add 5, 10 habits
    • great day: check into every habit (with a minimum, so not 1) in a single day
    • aggregate achievements, e.g. check into every habit 100 times
  • Habit-level achievements
    • counts, e.g. 1000 Check-Ins for a given habit
    • longest streak, e.g. streak of 100

Most of these (the count-based ones) can be calculated on the fly, but concepts like "check into every habit one day" will require storing achievements somewhere, so they persist once granted. Imagine checking into all 5 habits and unlocking "great day" only to see it disappear later on once you add a 6th habit.

And while I'm not too concerned about performance, the aggregate achievements could get quite slow if the individual habit-level achievements aren't cached/stored somewhere. We'll see.