Bloomberry uses Supabase (PostgreSQL) as its primary database. This page documents the core tables, their fields, and their relationships.
All tables are scoped by user
Every table includes a user_id foreign key referencing the Clerk user ID. Row-level security (RLS) policies ensure users can only access their own data.
writer_sessions
Stores each Writer conversation session with its messages and generated outputs.
writer_sessions schema
"color:#ff7b72">interface WriterSession {
id: "color:#79c0ff">string "color:#6e7681">// UUID primary key
user_id: "color:#79c0ff">string "color:#6e7681">// Clerk user ID
title: "color:#79c0ff">string "color:#6e7681">// Auto-generated session title
concept: "color:#79c0ff">string "color:#6e7681">// Original user concept/prompt
formats: "color:#79c0ff">string[] "color:#6e7681">// Selected output formats
style: "color:#79c0ff">string "color:#6e7681">// Writing style (polished | natural | punchy)
messages: Message[] "color:#6e7681">// JSONB: chat message history
outputs: Record<"color:#79c0ff">string, GeneratedOutput> "color:#6e7681">// JSONB: generated content
created_at: "color:#79c0ff">string "color:#6e7681">// ISO timestamp
updated_at: "color:#79c0ff">string "color:#6e7681">// ISO timestamp
is_project: "color:#79c0ff">boolean "color:#6e7681">// Pinned as a project
}
writer_projects
Pinned sessions promoted to named projects. A project is a writer_session with is_project: true and additional metadata.