No description
  • TypeScript 96.5%
  • JavaScript 1.8%
  • Dockerfile 1%
  • CSS 0.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tim Hayes 2302f34ffd
All checks were successful
CI / check (push) Successful in 45s
Fix initial startup error
2026-07-31 13:19:25 -04:00
.forgejo/workflows Updated timeout 2026-07-31 13:09:14 -04:00
apps/web Initial commit 2026-07-30 20:03:52 -04:00
docs Updates for docker 2026-07-31 12:49:11 -04:00
packages/core Initial commit 2026-07-30 20:03:52 -04:00
scripts Fix initial startup error 2026-07-31 13:19:25 -04:00
.dockerignore Initial commit 2026-07-30 20:03:52 -04:00
.gitignore Initial commit 2026-07-30 20:03:52 -04:00
.npmrc more 2026-07-30 21:23:16 -04:00
docker-compose.yml Updates for docker 2026-07-31 12:49:11 -04:00
Dockerfile Initial commit 2026-07-30 20:03:52 -04:00
LICENSE Initial commit 2026-07-30 23:38:16 +00:00
package.json Fix initial startup error 2026-07-31 13:19:25 -04:00
pnpm-lock.yaml Initial commit 2026-07-30 20:03:52 -04:00
pnpm-workspace.yaml more 2026-07-30 21:23:16 -04:00
README.md Fix initial startup error 2026-07-31 13:19:25 -04:00
tsconfig.base.json Initial commit 2026-07-30 20:03:52 -04:00

HabitTracker

Beautiful, local-first habit tracker. Web-first (Next.js), shared domain core for future Expo iOS/Android.

See docs/DESIGN.md for the full product and architecture plan.

Stack

  • apps/web — Next.js 15 App Router, Tailwind CSS 4, Dexie (IndexedDB)
  • packages/core — pure TypeScript domain (schedules, streaks, progress, stats)

Setup (dev)

pnpm install
pnpm dev

pnpm dev waits until the server is accepting connections, then opens the browser. Next.js prints the Local URL before it is ready — if you open that link too early you get a connection error that goes away on refresh. Use BROWSER=none pnpm dev to skip auto-open, or pnpm dev:raw for plain next dev.

Docker (local server)

Production image serves the Next.js app on port 3000 inside the container.

# Build, wait until healthy, open browser (host port 3080)
pnpm docker:up

# Or manually:
docker compose up -d --build
# Wait for "Ready" in logs before opening the URL
docker compose logs -f

# Stop
docker compose down

Open http://localhost:3080 only after the container is up — the port is published as soon as Docker starts the container, a moment before Node is listening.

Without Compose:

docker build -t habit-tracker .
docker run --rm -p 3080:3000 habit-tracker

Note: Habit data is stored in the browser (IndexedDB), not in the container. Back up via Settings → Backup & sync → Export JSON if you clear site data.

Forgejo Actions (TrueNAS)

  • CI (.forgejo/workflows/ci.yml) — runs-on: docker (node:lts): test, typecheck, build.
  • Deploy (.forgejo/workflows/deploy.yml) — runs-on: docker-cli on push to main or manual dispatch: docker compose up on the NAS host Docker engine.

Runner must expose host Docker to job containers (DooD):

Setting Value
Label docker-cli:docker://docker:27-cli
Volume /var/run/docker.sock → runner
container.options -v /var/run/docker.sock:/var/run/docker.sock
Variable (optional) HOST_INTERNAL_URL — Forgejo URL reachable from job containers

App stack is owned by Actions/compose (name: habit-tracker, host port 3080). Do not also manage the same container as a separate TrueNAS Custom App.

Scripts

Command Description
pnpm dev Start web app; open browser when ready
pnpm dev:raw Start web app without wait/open helper
pnpm test Run all package tests
pnpm typecheck TypeScript check
pnpm build Production build
pnpm docker:up Build, run container, wait, open browser
docker compose up -d --build Build & run production container

Features (MVP)

  • Today dashboard with overall % ring and per-habit progress rings
  • Add habit from templates or custom
  • Edit habit (goals, frequency, circle click action, start date, lists)
  • History: Trends chart, per-habit bars, Archive
  • Settings: theme, streaks, vacation mode, start of week/day, export/import
  • Fully offline — data stays in the browser

License

Private / unlicensed.