GTD MVP: Expo app (iOS/Android/web) + Bun API + Postgres schema

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-07 16:36:06 -07:00
commit df4068bb3b
8 changed files with 262 additions and 0 deletions

33
server/schema.sql Normal file
View File

@@ -0,0 +1,33 @@
-- GTD schema. Applied idempotently by migrate step in entrypoint.
create table if not exists projects (
id uuid primary key default gen_random_uuid(),
name text not null,
status text not null default 'active'
check (status in ('active', 'someday', 'completed', 'dropped')),
notes text not null default '',
sort_order double precision not null default 0,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now()
);
create table if not exists tasks (
id uuid primary key default gen_random_uuid(),
title text not null,
notes text not null default '',
-- The GTD lists. 'scheduled' = calendar/tickler items surfaced by defer_date.
status text not null default 'inbox'
check (status in ('inbox', 'next', 'waiting', 'scheduled', 'someday', 'done', 'trashed')),
project_id uuid references projects(id) on delete set null,
context text, -- '@home', '@computer', '@errands', '@calls', ...
waiting_for text, -- who/what is being waited on when status = 'waiting'
due_date date,
defer_date date, -- hide from lists until this date
completed_at timestamptz,
sort_order double precision not null default 0,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now()
);
create index if not exists tasks_status_idx on tasks (status);
create index if not exists tasks_project_idx on tasks (project_id);