Skip to content

Homebrew habit tracker. Extremely primitive, but a good learning exercise.

License

Notifications You must be signed in to change notification settings

saintaardvark/habit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Habit

A very simple web application to track the habits I want to build.

Screenshot

(I shower regularly already, I promise...)

Usage

Currently I'm deploying this on a server in my home network using the debug server. That's not Suitable For Production(tm), of course, but my home network is sufficiently isolated for my purposes.

Just to make that clear: if you run this exposed to the internet, you're in for trouble.

So...start up the server like so:

$ make serve

Once it's running, navigate to the index page (http://localhost:5000 or whatever your machine's IP address is). From there:

  • You can add a new habit to track by typing the name into the box at the bottom and hitting "Submit".

  • You can log that you did a particular habit by clicking the "Log [habit name]" button.

  • You can admire the pretty calendar heat maps on the main page.

  • You can click on the habit name to see all the log entries for that habit, plus the same pretty calendar heat map. I suppose that might be useful.

Note: this uses (ie, hardcodes) use of an SQLite3 database file named habits.db in the server directory of the repo.

Shortfalls, accusations and TODOs

  • I really should be using a WSGI server.

  • TODO: Add authentication. Currently there's no authentication at all...zero.

  • TODO: Habits can be deleted, but the way I'm doing that is by deleting the whole row in habit, but not log...which means that the next time you add a row, you end up with the log from the last habit that had that ID.

  • TODO: Allow user to delete or update a log entry.

  • TODO: Consistify API, and probably settle on a RESTful design.

  • TODO: I show only a month when a mobile device is detected. I'd like a button to allow a manual toggle. I'm also sure this method could be refactored.

  • TODO: Properly format HTML, CSS and Javascript (or at least pick a style & make things consistent).

  • I'm sure there's much overall to improve in the code, the template and the ORM design, but for now this works.

Thanks

The fact that I can use the work of so many smart people to make pretty much exactly what I want never ceases to amaze me. Thank you to:

License

3-clause BSD. Have fun.

About

Homebrew habit tracker. Extremely primitive, but a good learning exercise.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published