Neohabit
A self-hosted habit-tracker with a new approach to heatmaps, and flexible habits that happen X times in Y days.
A highly customizable habit-tracker that is wired for systematic self-improvement The project is written primarily in JavaScript, distributed under the GNU Affero General Public License v3.0 license, first published in 2022. Key topics include: docker, go, habit-tracker, habit-tracking, habits.
Features
- Habits that happen any amount of times in any amount of days
- Intutive design for habits that happen more than once a day
- Ability to set targets, and change them on the go
- Tracking numeric values (up to 2 billion) and setting numeric targets
You can see the features explained with examples on the
landing. And you can also check out the demo version.
Custom heatmaps, with all the above features
Monochromatic (github/anki-style)
<p float="left"> <a href="frontend/src/assets/heatmap-monochromatic-default-srgb-dark.png" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="frontend/src/assets/heatmap-monochromatic-default-srgb-dark.png" /><img src="frontend/src/assets/heatmap-monochromatic-default-srgb-light.png" width="49%"/></picture></a> <a href="frontend/src/assets/heatmap-monochromatic-custom-srgb-dark.png" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="frontend/src/assets/heatmap-monochromatic-custom-srgb-dark.png" /> <img src="frontend/src/assets/heatmap-monochromatic-custom-srgb-light.png" width="49%"/> </picture> </a> </p>Numeric
<p float="left"> <a href="frontend/src/assets/heatmap-numeric-default-blue-dark.png" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="frontend/src/assets/heatmap-numeric-default-blue-dark.png" /><img src="frontend/src/assets/heatmap-numeric-default-blue-light.png" width="49%"/></picture></a> <a href="frontend/src/assets/heatmap-numeric-custom-deep-blue-dark.png" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="frontend/src/assets/heatmap-numeric-custom-deep-blue-dark.png" /> <img src="frontend/src/assets/heatmap-numeric-custom-deep-blue-light.png" width="49%"/> </picture> </a> </p>Fractured
Designed specifically to track habits that have to happen many times per period
(available up to 16, then defaults to numeric):
Or track habits that happen once in a blue moon:
<p float="left"> <a href="frontend/src/assets/heatmap-numeric-monthly-dark.png" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="frontend/src/assets/heatmap-numeric-monthly-dark.png" /><img src="frontend/src/assets/heatmap-numeric-monthly-light.png" width="49%"/></picture></a> <a href="frontend/src/assets/heatmap-45-days-dark.png" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="frontend/src/assets/heatmap-45-days-dark.png" /> <img src="frontend/src/assets/heatmap-45-days-light.png" width="49%"/> </picture> </a> </p>Combine habits into projects
All displayed in a 1-dimensional mode, which is more suitable for day-to-day tracking:
<p float="left"> <a href="frontend/src/assets/project-languages-dark.png" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="frontend/src/assets/project-languages-dark.png" /><img src="frontend/src/assets/project-languages-light.png" width="49%"/></picture></a> <a href="frontend/src/assets/project-fitness-dark.png" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="frontend/src/assets/project-fitness-dark.png" /> <img src="frontend/src/assets/project-fitness-light.png" width="49%"/> </picture> </a> </p> <p float="left"> <a href="frontend/src/assets/project-worklife-dark.png" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="frontend/src/assets/project-worklife-dark.png" /><img src="frontend/src/assets/project-worklife-light.png" width="49%"/></picture></a> <a href="frontend/src/assets/project-social-dark.png" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="frontend/src/assets/project-social-dark.png" /> <img src="frontend/src/assets/project-social-light.png" width="49%"/> </picture> </a> </p> <p float="left"> <a href="frontend/src/assets/project-cleaning-dark.png" target="_blank"><picture><source media="(prefers-color-scheme: dark)" srcset="frontend/src/assets/project-cleaning-dark.png" /><img src="frontend/src/assets/project-cleaning-light.png" width="49%"/></picture></a> <a href="frontend/src/assets/project-meds-dark.png" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="frontend/src/assets/project-meds-dark.png" /> <img src="frontend/src/assets/project-meds-light.png" width="49%"/> </picture> </a> </p>Skilltrees
Excellent for planning and tracking progressions:
<div align="center"> <a href="frontend/src/assets/skilltree-cyan-dark.png" target="_blank"> <picture> <source media="(prefers-color-scheme: dark)" srcset="frontend/src/assets/skilltree-cyan-dark.png" /> <img src="frontend/src/assets/skilltree-cyan-light.png" /> </picture> </a> </div>Other things you might find useful
- Keybindings for common actions
- Two themes available: light and dark
- Desktop-focused
- Polished mobile interface (browser-only, no app)
- Multiple accounts support
- Drag and drop projects or habits to rearrange their order
- Tooltips with the selected period's information (available when you hover on cells)
- Habit and project names are clickable and lead to their individual pages (all links
also available in the sidebar)
Installation
Currently, there are three methods available:
<details> <summary><strong>Docker compose with pre-built images (recommended)</strong></summary> <br>First, make a directory for docker-compose's configs, then copy
docker-compose.yaml, .env and Caddyfile from this repo:
bashwget -O docker-compose.yaml https://raw.githubusercontent.com/Vsein/Neohabit/refs/heads/main/docker-compose.yaml && wget -O .env https://raw.githubusercontent.com/Vsein/Neohabit/refs/heads/main/.env.example && wget -O Caddyfile https://raw.githubusercontent.com/Vsein/Neohabit/refs/heads/main/Caddyfile
Then, edit as desired:
.envto change the db/backend settings, and in-app settings like login behaviordocker-compose.yamlto configure the reverse proxy ports, volumes, and other docker stuffCaddyfileto adjust the host::80for LAN or localhost:443for LAN+HTTPS (also uncomment thetls internaland frontend's
reverse proxy)example.comfor web-hosting
When ready, run:
bashdocker compose up -d
In ~15 seconds, head to http://127.0.0.1:8080 (default) and check if
everything's up and running.
If you encounter any issues, you can check the logs by running:
<hr> </details> <details> <summary><strong>Docker compose and building images from source</strong></summary> <br>bashdocker compose logs
If you've chosen this step because I previously recommended to use it for
web-hosting in v1.0.0, that's no longer the case and you can use the first
method instead
Clone this repo and change to the cloned directory:
bashgit clone https://github.com/Vsein/Neohabit.git && cd Neohabit
Copy .env.example into .env
bashcp .env.example .env
After that, edit the following files as desired:
.envto change the db/backend settings, and in-app settings like login behaviordocker-compose.yamlto configure the reverse proxy ports, volumes, and to
uncomment lines for building manuallyCaddyfileto adjust the host::80for LAN or localhost:443for LAN+HTTPS (also uncomment thetls internaland frontend's
reverse proxy)example.comfor web-hosting
When ready, run:
bashdocker compose up -d
In ~30 seconds, head to http://127.0.0.1:8080 (default) and check if
everything's up and running.
If you encounter any issues, you can check the logs by running:
bashdocker compose logs
Also, alternatively to simple docker compose up -d, you can force to rebuild everything:
docker compose up --build --force-recreate
<hr>
</details>
<details>
<summary><strong>Build and serve everything manually</strong></summary>
<br>
Requirements:
- go
- postgresql
- npm
- python or nginx (for serving the static files)
Setting up frontend
Change into the frontend directory and install dependencies:
bashcd frontend && npm ci
-
Build static files:
bashnpm run buildServe the static files in
/dist, for example with python:bashpython -m http.server 8080 -
Or, run in development mode:
bashnpm start
Setting up backend
Change into the backend directory and install go packages
bashgo mod download
Create a new Postgres database:
bashcreatedb neohabit_database
And modify the env vars before finally running:
<hr> </details> <br>bashJWT_SECRET="SuperSecretInformation" \ PG_DSN="postgres://user:password@localhost:5432/neohabit_database?sslmode=disable" \ go run core/cmd/main.go -config core/config/config.yaml
By default, reverse proxies are set up with Caddy. If you prefer a different web
server, here's a sample nginx.conf
that was used previously. If you've set up the reverse proxy through Traefik,
HAProxy or anything else - feel free to propose a sample snippet, so that it can
be copy-pasted by others in the future for ease of use.
Upgrading
Ultimate vision
My ultimate vision for Neohabit is to have a public, community-driven archive of
habits that may be imported into your database/account, with all the needed
progressions. Somewhat similar to the Anki's shared decks, except for habits.
I've implemented the core feature - the habit-tracking part, but the rest of it
still needs some time to come together.
For example:
- There's the tasklist section that I want to integrate with habits, so you can
see which habits are due today (currently the tasks are dangling in their own
section, and weren't my development focus) - The skilltrees are implemented, but right now there's no way to start habits
directly based on the skills listed in the skilltree. I may even take
skilltrees as the base for importing new habits, I guess it'll be more clear
in the future. - "The blocks" page is dangling as a section in the side menu, but I think it'll
just be a link to a website with all the archived skilltrees/habits. - Contribution guides and community support/groups
License
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
The AGPL-3.0 applies to the entire repository, including all historical commits.
Any modified versions - especially when offered as a network service or SaaS -
must comply with its copyleft terms.
This license is chosen specifically so that Neohabit remains open-source
forever.
Donations
BTC: bc1qkt9xge2a8h3zt65ju7qkyvh6z6qjn6kdz8tm4a
XMR: 48F86e1vigUU8jUSf3kBYNJhMGp38dKxqBhga9sLz1Lr5qM8QqXrY3g4X8uQyqh7wQKhm7MpxSsSpdp1PGvY96jh1MGwyx8
To anyone who's kind enough to donate, thank you! Neohabit's development has
cost me more than I'm comfortable admitting, if not financially then just in time
alone. Spreading the word and mentioning this project to your friends is also
welcome and much appreciated.
Contributors
Showing top 1 contributor by commit count.
