Problem Statement
Goals are hierarchical and social, but most goal apps are flat checklists. A real goal ("ship the product") has sub-goals, which have their own sub-goals; progress should roll up automatically; some goals recur; and you often want to set a goal for someone else (a sibling, a mentee) and watch their progress, or co-own a goal with a collaborator. Off-the-shelf to-do apps don't model any of that.
Proposed Solution
Goalst lets you create a goal with a title, description, and start/end dates, then nest sub-goals to any depth; completion percentage rolls up from the sub-goals. You can mark goals done, see deadline countdowns, share a goal via a protected link (like a private GitHub gist that the recipient can update), and add collaborators — e.g. create a goal for your sister, send it to her, and track her progress.
Full Solution Details
- Infinite nesting — goals reference a parent goal; sub-goals can have sub-goals, recursively.
- Auto rollup progress — a goal's percentage derives from its sub-goals' completion (with a manual-progress override available).
- Recurring goals —
is_recurringwith daily/weekly cadence. - Priority / story points — each goal has a priority (≥1) that contributes to a score on completion (gamification).
- Custom statuses — beyond not-started/done, users define their own status labels.
- Dates & countdowns — start/end dates with a validity constraint and deadline countdowns.
- Sharing & collaboration — protected share links (recipient can update) and named collaborators on a goal.
- Auth — simple email + password (no email confirmation), green newsletter-themed UI.
Technical Documentation
React + TypeScript SPA (TanStack Query, react-router, Lucide, meemaw, clsx) on Supabase (Postgres + Auth + Row-Level Security) — no custom backend. The schema is the interesting part: goalst_goals is self-referencing (parent_goal_id references goalst_goals(id) on delete cascade) to model the tree, with manual_progress (0–100 check), priority (story-point score contribution), is_recurring + recurrence_cadence, color_tag, and a valid_date_range check constraint (start ≤ end). All tables are prefixed goalst_ so the project can share a single Supabase instance with other apps, and RLS policies enforce per-user / shared access. Cascading deletes clean up entire sub-trees automatically.
Tech Stack
React, TypeScript, TanStack Query, React Router, meemaw, Lucide (frontend); Supabase — PostgreSQL, Auth, Row-Level Security (backend-as-a-service). No custom server.
System Design
React SPA (TanStack Query) ──@supabase/supabase-js──► Supabase
├── Auth (email+password)
├── Postgres
│ goalst_goals (self-ref tree)
│ parent_goal_id → goalst_goals.id (cascade)
│ manual_progress · priority · recurrence
│ goalst_custom_statuses · collaborators · shares
└── Row-Level Security (per-user + shared access)
progress rolls up sub-goals → parent · cascade delete cleans subtrees
Smart Architectural Decisions
- Self-referencing schema with cascade. Modeling the goal tree as one self-referencing table (with
on delete cascade) is the clean, correct way to support infinite nesting and automatic subtree cleanup — the structural heart of the product. - RLS instead of a backend. Leaning on Supabase Row-Level Security to enforce ownership and sharing means no custom API server to write/secure — the database itself is the authorization layer. Pragmatic and secure when done right.
- Table prefixing for a shared Supabase project.
goalst_*prefixes let multiple apps share one Supabase instance — a cost/ops-savvy multi-tenant-of-one choice (also used by his other Supabase apps). - Check constraints in the DB.
valid_date_range,manual_progress between 0 and 100,priority >= 1push invariants into the schema rather than trusting the client — defense in depth. - Score-on-completion (priority as story points) bakes in lightweight gamification without extra tables.
Impacts
A hierarchical, collaborative goal tracker that models goals the way people actually think about them (nested, rolling-up, shareable), shipped serverlessly on Supabase with the data model and authorization done correctly (self-referencing tree, RLS, DB-level constraints).
Demonstrated Skills
Relational data modeling (self-referencing trees, cascade deletes, check constraints); Supabase / Postgres + Row-Level Security as an auth/authorization layer (BaaS, no custom server); recursive progress computation; React + TanStack Query; multi-tenant-of-one schema design (table prefixing); product modeling of hierarchical + collaborative domains.