Skip to main content

Database Overview

CommonPlace uses PostgreSQL via Supabase with Row Level Security (RLS) on all tables. Authentication is handled through Supabase Auth. The database contains 45 tables organized into 7 categories.

Core User Tables

TablePurpose
profilesUser identity, preferences, moderation status, privacy settings
postsUser-created content with intent context and audience scoping
commentsThreaded responses to posts
post_imagesMultiple image attachments per post
saved_postsUser-saved posts with personal notes
shelvesFolders for organizing saved posts
user_feed_statePer-user slow-feed pacing state
intent_stylesPer-user visual customization for each intent type
avatar_libraryUser avatar collection (max 24)
feedbackUser-submitted platform feedback

Social / Relationship Tables

TablePurpose
friendshipsMutual friend connections with request workflow
blocksUser blocking with complete disappearance
relationship_typesUser-defined relationship categories
relationship_edgesLabeled connections with optional encryption
invite_linksShareable invite codes with usage limits

Circle Tables

TablePurpose
circlesSmall group spaces for organizing friends
circle_membersCircle membership with roles
post_circlesJunction: posts targeted to circles
circle_feed_statePer-user per-circle feed pacing
charter_toggle_definitionsSystem-defined community norm toggles
circle_chartersPer-circle community norm toggle states

HomeRoom Tables

TablePurpose
home_room_settingsPer-user room configuration, theme, layout
home_room_modulesContent modules placed in rooms
room_stylesCSS customization for rooms
module_stylesCSS customization for individual modules
profile_photosPhoto gallery for rooms
profile_linksExternal links displayed in rooms
featured_postsPosts pinned to rooms
guestbook_entriesVisitor messages with moderation

MeBook Tables

TablePurpose
mebook_sectionsSystem-defined self-reflection sections
mebook_questionsQuestions with type and preference mapping
mebook_question_optionsAnswer options for multiple-choice questions
mebook_responsesUser answers to questions
mebook_user_progressSection completion tracking

Messaging Tables

TablePurpose
conversationsDM and group chat containers
conversation_participantsConversation membership with step-away tracking
messagesIndividual messages with reply threading and retention
message_reactionsCurated emoji reactions (6 types only)

Admin & Security Tables

TablePurpose
admin_rolesAdmin/moderator role assignments
reportsUser-submitted moderation reports
admin_audit_logAudit trail of admin actions
user_actionsAdministrative actions against users
rate_limitsPer-user per-action rate tracking
rate_limit_configRate limit rules per action type
security_audit_logSecurity event audit trail

Key Design Principles

  1. All tables use RLS -- No data is accessible without authentication and policy checks
  2. No public metrics -- No like counts, view counts, follower counts in the schema
  3. Privacy by default -- Saved posts, relationship edges, MeBook responses are private
  4. Pacing is structural -- Feed state tables enforce slow-feed at user and circle level
  5. Block = disappearance -- Blocked users see 404, not "blocked" message
  6. Curated reactions -- Only 6 reaction types, preventing performative behavior
  7. Client-side encryption -- Relationship edges support encrypted labels and notes

Security

All tables use Row Level Security (RLS) policies. See Database Security for details.


Last updated: 2026-02-07