Database Schema
Garmint uses Supabase (PostgreSQL) with a structured schema for auth, billing, projects, and production.Migrations
Migrations live insupabase/migrations/. Apply them with:
Core Tables
profiles
User profiles, created automatically on signup:projects
Workspace containers for threads and generations:threads
Chat conversation containers:generations
AI-generated design images:Billing Tables
billing_plans
Available subscription tiers:subscriptions
User subscription records:token_grants
Token allocations from subscriptions or purchases:usage_ledgers
Token consumption records:Token Balance View
Calculates remaining tokens per user:Production Tables
production_orders
Orders for physical garment production:production_line_items
Order line items (size/quantity):fulfillment_events
Order status history:Row Level Security
All tables have RLS enabled. Key policies:Indexes
Key indexes for performance:Seeding
Initial billing plans are seeded viasupabase/seed.sql: