The Big Picture
Trending Society is built on a single-database architecture that powers four distinct business units. Every product shares the same Supabase PostgreSQL database, enabling cross-product queries, unified user identity, and compounding data intelligence.Why Single Database?
What You Can’t Do with Separate Databases
| Problem | Impact |
|---|---|
| Join across products | Requires ETL pipelines, sync jobs, stale data |
| Unified user identity | Users need separate accounts per product |
| AI context | Models can’t see full picture |
| Maintenance | N databases = N times the work |
What You CAN Do with Single Database
- One query spans all business units - Join Publisher analytics with Store orders
- User signs up once - Accesses everything based on role
- Jarvis has full context - “Your travel posts generated $2,400 in Viator commissions”
- Every new table benefits all products - Add it once, query everywhere
Database Structure
Project:trendingsociety-production
Project Ref: ymdccxqzmhxgbjbppywf
Total Tables: 127 custom + 37 Supabase-managed = 164 total
| Schema | Tables | Purpose |
|---|---|---|
public | 111 | Product data (RLS required) |
system | 14 | Infrastructure (service_role only) |
events | 1 | Immutable audit logs |
| Prefix | Domain | Example Tables |
|---|---|---|
| (none) | Shared | users, tenants, platforms |
aiv_ | AI Visibility | aiv_bot_activity, aiv_citations |
system_ | Infrastructure | system_checkpoints, system_circuit_breakers |
publisher_ | Blog Network | publisher_posts, publisher_ig_sources |
creator_ | Platform | creator_profiles, creator_licenses |
agency_ | Client Services | agency_clients, agency_projects |
shopify_ | Store | shopify_products, shopify_orders |
jarvis_ | Voice Assistant | jarvis_conversations, jarvis_messages |
Full Table Reference
See all 127 tables with schemas and relationships
The Leverage
Content Example
One blog post in Publisher can:- Generate affiliate revenue (tracked in
viator_click_tracking) - Drive Store sales (join with
shopify_orders) - Become licensed content on Platform (tracked in
creator_licenses) - Train AI models (stored in
content_analysis)
User Journey Example
Tech Stack
| Layer | Technology |
|---|---|
| Database | Supabase PostgreSQL |
| Backend | Next.js API Routes, Supabase Edge Functions |
| Frontend | Next.js 14, React, Tailwind |
| Deployment | Vercel (apps), Cloudflare Workers (MCP Gateway) |
| Monorepo | Turborepo, pnpm workspaces |
| AI | OpenAI, Anthropic, Gemini (routed via ai_model_config) |