dev — data architecture

How Yemz is structured.

The complete entity model — every table, relationship, and data flow in the Yemz mobile app. Follow the thread from a single Item all the way to a shared Post.

11 tables 4 core entities 3 junction tables PostGIS spatial Supabase backend
Core entity
Junction / join
Social layer
Scoring / ratings
Foreign key
Implicit
entity relationship diagram
Item
restaurante · lugar
Gem Rating
0 – 5 gems
◆◆
Plan
2–5 ordered items
Plan Item
join + position
Experience
activated plan
👥
Participant
exp × user
📍
Check-in
exp × item × user
📸
Post
from completed exp
👤
User Profile
miner status
🔖
Save
item or plan
Follow
follower → following
the core thread — item → plan → experience → post
Item
The atomic unit — a place or restaurant
core entity
PK iduuid
nametext
ENUM subtyperestaurante | lugar
ENUM categorycuisine or place type
descriptiontext
addresstext
address_displaytext (readable)
coordinatesgeography(point)
cover_image_urltext
imagestext[] (gallery)
price_tier1–4
ENUM tagstext[] (option set)
opening_daytext
opening_timetime
closing_timetime
phonetext
websitetext
opentable_linktext
gem_avgnumeric(3,1) 0–5
internal_scoreinteger (yemz value)
rated byGem Rating
assembled intoPlan Item
checked-in viaCheck-in
◆◆
Plan
Ordered sequence of 2–5 items — timeless
core entity
PK iduuid
titletext
FK created_byuuid → users
ENUM sourcemanual | concierge | editorial
is_editorialboolean
gem_avgnumeric(3,1)
citytext → cdmx
items viaPlan Item
activated intoExperience
saved bySave
Experience
A Plan activated with date, time, people
core entity
PK iduuid
FK plan_iduuid → plans
FK created_byuuid → users
descriptiontext
cover_image_urltext
scheduled_datedate
scheduled_timetime
meeting_pointtext
budget_centsinteger
duration_minsinteger
FK host_iduuid → users
ENUM ownershipprivate | collaborative
ENUM transportwalking | biking | metro | car | uber
ENUM statusplanned | active | completed | cancelled
participants viaParticipant
tracked viaCheck-in
completed →Post
📸
Post
Shared content from a completed Experience
core entity
PK iduuid
FK experience_iduuid → experiences
FK created_byuuid → users
gem_ratingnumeric(3,1)
captiontext
imagestext[]
ENUM visibilityprivate | followers | public
created byUser Profile
junction & support tables
Plan Item
Connects Items to Plans with order
junction
FK plan_iduuid → plans
FK item_iduuid → items
PK positioninteger
notestext
👥
Participant
Users registered for an Experience
junction
FK experience_iduuid → experiences
FK user_iduuid → users
joined_attimestamptz
📍
Check-in
User arrives at Item during Experience
junction
PK iduuid
FK experience_iduuid → experiences
FK item_iduuid → items
FK user_iduuid → users
coordinatesgeography(point)
checked_in_attimestamptz
social & scoring layer
👤
User Profile
Identity + miner status
PK iduuid → auth.users
usernametext (unique)
display_nametext
biotext
avatar_urltext
is_minerboolean
miner_scoreinteger
gem_weightnumeric(3,2)
Gem Rating
User rates an Item — 0 to 5 gems
scoring
PK iduuid
FK user_iduuid → users
FK item_iduuid → items
gem_valuenumeric(3,1) 0–5
🔖
Save
Quick bookmark — Item or Plan
FK user_iduuid → users
FK item_iduuid → items (nullable)
FK plan_iduuid → plans (nullable)
saved_attimestamptz
Follow
User → User social graph
FK follower_iduuid → users
FK following_iduuid → users
created_attimestamptz
concierge ai flow — plan generation pipeline
1
📝
User fills form
8 steps: day, time, stops, budget, vibe, must-haves, food, hood, transport
2
Query Items DB
Supabase Edge Function filters items by neighborhood, budget, category, tags
3
🤖
Claude generates
Anthropic API receives items + preferences, returns 3 curated Plan alternatives
4
🃏
3 plan cards
Each with: Spanish title, stops, duration, distance, budget, editorial rationale
5
User selects
Chosen plan saved to Bucket List. Can be activated into an Experience with a date.
Edge Function supabase/functions/concierge AI Model Claude Opus Store Zustand concierge.store