A lightweight, single-page habit dashboard that lets you track daily habits in a monthly grid, visualize progress with charts, and optionally sync across devices using Firebase (served via a Netlify Function).
- Tracks habits per day (monthly table)
- Shows progress charts (daily flow line chart, weekly totals bar chart, weekly rhythm radar chart, completion donut)
- Calculates totals + streaks per habit
- Supports dark/light theme toggle
- Imports/exports your data as JSON
- Optional cloud sync across devices (Firebase Auth anonymous + Firestore)
- Fast to run: no build step; open in any modern browser via a simple local server.
- Data ownership: data is stored locally in
localStorageby default; export a backup anytime. - Visual feedback: charts and streaks make trends obvious.
- Cross-device option: enable cloud sync when you want it, keep it off when you don’t.
This app should be served over http://… (not opened via file://…) so features like Cloud Sync can work when enabled.
From the project folder:
Option A: Python
py -m http.server 5173Then open:
Option B: Node (serve)
npx serve .- Add a habit: type a name → “+ Add Habit”
- Mark a day: click a cell in the monthly grid
- Switch month/year: use the dropdowns in the header
- Backup: “⬇ Export” downloads a JSON file
- Restore: “⬆ Import” loads a previously exported JSON file
- Theme: click the theme toggle (sun/moon)
Cloud Sync is optional and off by default. When enabled, the app syncs habits and appData to a Firestore document keyed by a “Sync Code”. Anyone with the Sync Code can read/write that shared dataset.
- A Firebase project
- Firestore enabled
- Anonymous Auth enabled (the app uses
signInAnonymously())
This repo includes a Netlify Function that serves Firebase config at:
/.netlify/functions/firebase-config
It reads these environment variables:
FIREBASE_API_KEYFIREBASE_AUTH_DOMAINFIREBASE_PROJECT_IDFIREBASE_APP_ID
Steps:
-
Install the Netlify CLI:
npm i -g netlify-cli
-
Create a local
.envfile (this repo ignores.envvia.gitignore):FIREBASE_API_KEY=... FIREBASE_AUTH_DOMAIN=... FIREBASE_PROJECT_ID=... FIREBASE_APP_ID=...
-
Start the dev server with functions enabled:
netlify dev
-
Open the local URL printed by Netlify CLI, then click ☁️ Sync.
- Set the same
FIREBASE_*variables in Netlify: Site settings → Environment variables. - The function lives in
netlify/functionsand is wired up vianetlify.toml.
index.html– UI layout and CDN scripts (Chart.js + Firebase compat)style.css– styling, theme tokens, layoutscript.js– app logic (storage, rendering, charts, import/export, cloud sync)netlify/functions/firebase-config.js– returns Firebase config from env varsnetlify.toml– Netlify Functions directory config
Exported backups look like:
{
"habits": [{"id":"h1","name":"Read 30 Mins","color":"#a0e7e5"}],
"appData": {"h1": ["2025-12-15", "2025-12-16"]},
"exportDate": "2025-12-15T10:20:30.000Z"
}- Check the code comments in
script.js(Cloud Sync section at the top explains configuration). - If this is in a GitHub repo: open an Issue with repro steps, browser, and screenshots.
Contributions are welcome.
- Fork the repo and create a branch:
git checkout -b feature/my-change - Test locally (see “Getting started” above)
- Open a Pull Request with a short description and screenshots if UI changes
If you discover a vulnerability, avoid filing a public issue with sensitive details. Prefer a GitHub Security Advisory (if enabled) or contact the maintainer.
Cloud Sync notes:
- Treat the Sync Code like a shared secret (anyone with it can potentially access the synced dataset)
- Don’t paste Sync Codes into issues, screenshots, or recordings
- If a Sync Code is leaked, create a new one and stop using the old one
Secrets:
- Don’t commit
.envfiles - Configure Firebase via
FIREBASE_*environment variables (local.envfornetlify dev, and Netlify environment variables for deploys)
- Maintained by the repository owner(s). (The UI/footer references “FX at Dev”. If you’re publishing this repo, update this section with your preferred contact.)