Skip to content

05 Domain Model

Vicky Patel edited this page Sep 14, 2026 · 1 revision

05. Domain Model & Entity Relationships

Structural overview of PACT OS core domain entities and relational mappings.


🗺️ Entity Relationship Diagram

erDiagram
    PROFILES ||--o{ GOALS : owns
    PROFILES ||--o{ PROJECTS : owns
    PROFILES ||--o{ TASKS : owns
    PROFILES ||--o{ FINANCE_TRANSACTIONS : owns
    PROFILES ||--o{ HABITS : owns
    PROFILES ||--o{ FOCUS_SESSIONS : owns

    GOALS ||--o{ PROJECTS : contains
    PROJECTS ||--o{ TASKS : contains

    TASKS ||--o| COMMITMENTS : binds
    COMMITMENTS ||--o| CONSEQUENCES : seals
    COMMITMENTS ||--o{ EXTERNAL_PROOF_SUBMISSIONS : verifies

    HABITS ||--o{ HABIT_LOGS : records
Loading

🏛️ Core Domain Entities

1. Identity Subsystem

  • Profile (profiles): Represents a registered user. Holds timezone, focus areas, reflection schedule, and review day preferences. Tied 1:1 to Supabase auth.users.

2. Planning & Commitment Subsystem

  • Goal (goals): Strategic objective with progress percentage and target date.
  • Project (projects): Initiative grouping related tasks with a designated accent color (color_accent).
  • Task (tasks): Action item with priority (low, medium, high, urgent), status (pending, in_progress, completed, missed, archived), scheduled window, and deadline (deadline_at).
  • Commitment (commitments): Binding accountability wrapper for a task with a status (active, completed, breached, waived).
  • Consequence (consequences): Pre-configured penalty bound to a commitment. Stores encrypted payload and activation state (is_activated).
  • External Proof Submission (external_proof_submissions): Verifiable proof-of-work record submitted via GitHub, LeetCode, or Codeforces.

3. Financial Subsystem

  • Finance Transaction (finance_transactions): Individual cashflow entry. Stores integer cents (amount_cents), type (income, expense, transfer), date, and category.
  • Finance Category (finance_categories): Income or expense category with an HSL color tag.
  • Finance Budget (finance_budgets): Category envelope spending limit (limit_cents).

4. Habits & Routine Subsystem

  • Habit (habits): Recurring discipline target with target frequency and streak metrics.
  • Habit Log (habit_logs): Individual completion record for a habit on a specific date.
  • Daily Routine (daily_routines): Morning/evening routine container holding routine_items.

5. Focus & Review Subsystem

  • Focus Session (focus_sessions): Deep work session log recording target vs. actual seconds, timer state, and linked task.
  • Weekly Review (weekly_reviews): Guided 5-step reflection log capturing carryover decisions, priority commitments, and weekly score summary.

Clone this wiki locally