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
entity relationship diagram
◆
Item
restaurante · lugar
◆◆
Plan
2–5 ordered items
↔
Plan Item
join + position
★
Experience
activated plan
📍
Check-in
exp × item × user
📸
Post
from completed exp
👤
User Profile
miner status
➡
Follow
follower → following
the core thread — item → plan → experience → post
◆
Item
The atomic unit — a place or restaurant
core entity
PK iduuid
name text
ENUM subtyperestaurante | lugar
ENUM categorycuisine or place type
description text
address text
address_display text (readable)
coordinates geography(point)
cover_image_url text
images text[] (gallery)
price_tier 1–4
ENUM tagstext[] (option set)
opening_day text
opening_time time
closing_time time
phone text
website text
opentable_link text
gem_avg numeric(3,1) 0–5
internal_score integer (yemz value)
← rated by Gem Rating
← assembled into Plan Item
← checked-in via Check-in
→
◆◆
Plan
Ordered sequence of 2–5 items — timeless
core entity
PK iduuid
title text
FK created_byuuid → users
ENUM sourcemanual | concierge | editorial
is_editorial boolean
gem_avg numeric(3,1)
city text → cdmx
← items via Plan Item
→ activated into Experience
← saved by Save
→
★
Experience
A Plan activated with date, time, people
core entity
PK iduuid
FK plan_iduuid → plans
FK created_byuuid → users
description text
cover_image_url text
scheduled_date date
scheduled_time time
meeting_point text
budget_cents integer
duration_mins integer
FK host_iduuid → users
ENUM ownershipprivate | collaborative
ENUM transportwalking | biking | metro | car | uber
ENUM statusplanned | active | completed | cancelled
← participants via Participant
← tracked via Check-in
→ completed → Post
→
📸
Post
Shared content from a completed Experience
core entity
PK iduuid
FK experience_iduuid → experiences
FK created_byuuid → users
gem_rating numeric(3,1)
caption text
images text[]
ENUM visibilityprivate | followers | public
junction & support tables
↔
Plan Item
Connects Items to Plans with order
junction
FK plan_iduuid → plans
FK item_iduuid → items
PK positioninteger
notes text
👥
Participant
Users registered for an Experience
junction
FK experience_iduuid → experiences
FK user_iduuid → users
joined_at timestamptz
📍
Check-in
User arrives at Item during Experience
junction
PK iduuid
FK experience_iduuid → experiences
FK item_iduuid → items
FK user_iduuid → users
coordinates geography(point)
checked_in_at timestamptz
social & scoring layer
👤
User Profile
Identity + miner status
social
PK iduuid → auth.users
username text (unique)
display_name text
bio text
avatar_url text
is_miner boolean
miner_score integer
gem_weight numeric(3,2)
✦
Gem Rating
User rates an Item — 0 to 5 gems
scoring
PK iduuid
FK user_iduuid → users
FK item_iduuid → items
gem_value numeric(3,1) 0–5
🔖
Save
Quick bookmark — Item or Plan
social
FK user_iduuid → users
FK item_iduuid → items (nullable)
FK plan_iduuid → plans (nullable)
saved_at timestamptz
➡
Follow
User → User social graph
social
FK follower_iduuid → users
FK following_iduuid → users
created_at timestamptz
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