Files
zeekay 9c4fa265ae Team Roster — a searchable team directory on Hanzo
Vite + React 19 + @hanzo/gui + @hanzo/iam + @hanzo/base, forked from
hanzo-starter (identical provider stack, vite config, auth + deploy contract).

- one org-scoped people(name,role,team,email,avatar,bio) Base collection
- three views: directory grid (avatar cards + quick search) / person profile / edit
- friendly light surface built entirely from @hanzo/gui primitives
- PKCE sign-in via hanzo.id; useQuery/useMutation carry the IAM bearer token
2026-07-21 13:27:02 -07:00

25 lines
1.2 KiB
SQL

-- Hanzo Base schema for Roster — the `databaseSchema` DDL.
--
-- On publish, Hanzo Cloud translates each CREATE TABLE into a Hanzo Base
-- collection via `provisionBaseFromDDL` (additive + idempotent). Base manages
-- id/created/updated/owner/org itself, so they are never re-declared here.
-- Every row is stamped with the verified IAM owner+org and is org-scoped: Base
-- applies the list/view/create/update/delete rule `@request.auth.org_id = org`,
-- so a member of your org reads/writes the row and other orgs cannot see it.
--
-- Keep this in lockstep with what the app reads/writes
-- (src/lib/roster.ts + src/views/directory.tsx · profile.tsx · edit.tsx).
-- People — one row per teammate. `team` is free text; the directory derives its
-- filter set and each team's color from the distinct values. `avatar` is an
-- optional image URL — empty falls back to a colored initials avatar.
CREATE TABLE IF NOT EXISTS people (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
role TEXT NOT NULL DEFAULT '',
team TEXT NOT NULL DEFAULT '',
email TEXT NOT NULL DEFAULT '',
avatar TEXT NOT NULL DEFAULT '',
bio TEXT NOT NULL DEFAULT ''
);