Domains model (work, marriage, homelab, finances, etc.) #37

Closed
opened 2026-01-29 18:21:31 +00:00 by jason.woltje · 0 comments
Owner

Overview

Add a Domains model to organize entities by life area.

Background

From r0 (jarvis-brain), domains categorize tasks, events, projects, and ideas by life area:

  • work — USC day job (highest volume)
  • marriage — 2026 Priority Project scaffold (monorepo, NestJS, Next.js 16) (#1)
  • software-dev — Jarvis, personal projects
  • homelab — Self-hosted infrastructure
  • finances — Income, budgeting, investments
  • family — Kids, extended family
  • consulting — DDK client work
  • personal — Health, fitness, personal development

Requirements

Prisma Schema

model Domain {
  id          String   @id @default(uuid()) @db.Uuid
  workspaceId String   @map("workspace_id") @db.Uuid
  
  name        String
  slug        String
  description String?
  color       String?  // Hex color for UI
  icon        String?  // Icon name
  sortOrder   Int      @default(0) @map("sort_order")
  
  metadata    Json     @default("{}")
  
  createdAt   DateTime @default(now()) @map("created_at") @db.Timestamptz
  updatedAt   DateTime @updatedAt @map("updated_at") @db.Timestamptz
  
  // Relations
  workspace   Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade)
  tasks       Task[]
  events      Event[]
  projects    Project[]
  ideas       Idea[]
  
  @@unique([workspaceId, slug])
  @@map("domains")
}

API Endpoints

  • GET /api/domains — List domains for workspace
  • POST /api/domains — Create domain
  • PATCH /api/domains/:id — Update domain
  • DELETE /api/domains/:id — Delete domain

UI

  • Domain selector/filter in navigation
  • Color-coded domain badges on tasks/events
  • Domain management in settings

Acceptance Criteria

  • Prisma schema added with migration
  • API endpoints with tests
  • Tasks, Events, Projects have optional domainId foreign key
  • Domain filter in task/event list views
  • Seed data includes default domains
## Overview Add a **Domains** model to organize entities by life area. ## Background From r0 (jarvis-brain), domains categorize tasks, events, projects, and ideas by life area: - **work** — USC day job (highest volume) - **marriage** — 2026 Priority #1 - **software-dev** — Jarvis, personal projects - **homelab** — Self-hosted infrastructure - **finances** — Income, budgeting, investments - **family** — Kids, extended family - **consulting** — DDK client work - **personal** — Health, fitness, personal development ## Requirements ### Prisma Schema ```prisma model Domain { id String @id @default(uuid()) @db.Uuid workspaceId String @map("workspace_id") @db.Uuid name String slug String description String? color String? // Hex color for UI icon String? // Icon name sortOrder Int @default(0) @map("sort_order") metadata Json @default("{}") createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz // Relations workspace Workspace @relation(fields: [workspaceId], references: [id], onDelete: Cascade) tasks Task[] events Event[] projects Project[] ideas Idea[] @@unique([workspaceId, slug]) @@map("domains") } ``` ### API Endpoints - `GET /api/domains` — List domains for workspace - `POST /api/domains` — Create domain - `PATCH /api/domains/:id` — Update domain - `DELETE /api/domains/:id` — Delete domain ### UI - Domain selector/filter in navigation - Color-coded domain badges on tasks/events - Domain management in settings ## Acceptance Criteria - [ ] Prisma schema added with migration - [ ] API endpoints with tests - [ ] Tasks, Events, Projects have optional `domainId` foreign key - [ ] Domain filter in task/event list views - [ ] Seed data includes default domains
jason.woltje added this to the M3-Features (0.0.3) milestone 2026-01-29 18:25:31 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaic/stack#37