Eight tables cover the full data lifecycle from seller onboarding through intelligence delivery. All competitor and intelligence data is scoped per seller via foreign keys. The sellers and scrape_configs tables are the foundation of the multi-tenant architecture - every other table references back to a seller.
idSERIALInternal seller identifierPK
shopee_handleTEXTShopee store username (e.g. samuelleongsekkin)IDX
store_nameTEXTDisplay name of the seller's store
emailTEXTContact email for report delivery
whatsapp_numberTEXTWhatsApp number for alerts and digest
shopee_api_tokenTEXTEncrypted Shopee Open Platform API token
planTEXTstarter / growth / pro - subscription tier
statusTEXTactive / paused / trial
joined_atTIMESTAMPTZWhen the seller joined the platform
idSERIALConfig identifierPK
seller_idINTEGERReferences sellers.idFK
keywordsTEXT[]Array of search keywords to scrape per run
category_idsTEXT[]Shopee category IDs to include in scraping
category_contextTEXTNatural language description of category fed to the AI for context-aware intelligence
price_bracketsJSONBCustom budget / mid / premium thresholds for this category
alert_thresholdsJSONBConfigurable thresholds for price drop, rank fall, and stock-out alerts
pages_per_runINTEGERSearch result pages to collect per keyword per run
activeBOOLEANWhether this config is included in the next scheduled run
idSERIALRun identifierPK
seller_idINTEGERReferences sellers.idFK
config_idINTEGERReferences scrape_configs.id used for this runFK
run_atTIMESTAMPTZWhen the run startedIDX
total_productsINTEGERProducts collected across all keywords
statusTEXTsuccess / partial / failed
error_logJSONBErrors encountered during the run
idSERIALRow identifierPK
seller_idINTEGEROwner seller - references sellers.idFK
scrape_run_idINTEGERReferences scrape_runs.idFK
item_idTEXTShopee's internal product identifierIDX
shop_idTEXTShopee's internal seller identifier
nameTEXTFull product listing title
brandTEXTExtracted brand name
price_sgdDECIMAL(10,2)Listed price in SGDIDX
price_max_sgdDECIMAL(10,2)Upper price if listing shows a range
price_bracketTEXTbudget / mid / premium - computed from seller's config thresholdsGEN
ratingDECIMAL(3,2)Product star rating
rating_countINTEGERTotal number of reviews
historical_soldINTEGERCumulative units sold
stockINTEGERCurrent stock count
is_official_storeBOOLEANShopee official store badge
is_preferred_plusBOOLEANPreferred Plus seller badge
shop_nameTEXTCompetitor seller display name
shop_locationTEXTSeller shipping origin
rank_positionINTEGERPosition in search results at scrape time
keywordTEXTSearch keyword this product appeared under
product_urlTEXTDirect Shopee product page URL
embeddingVECTOR(1536)OpenAI text embedding for semantic search via pgvectorIDX
scraped_atTIMESTAMPTZExact timestamp of collection
idSERIALRow identifierPK
seller_idINTEGERReferences sellers.idFK
item_idTEXTShopee product identifierIDX
recorded_atTIMESTAMPTZSnapshot timestampIDX
price_sgdDECIMAL(10,2)Price at this point in time
price_deltaDECIMAL(10,2)Change vs prior week
rank_positionINTEGERSearch rank at this snapshot
historical_soldINTEGERCumulative sold count at snapshot
ratingDECIMAL(3,2)Rating at this snapshot
idSERIALRow identifierPK
seller_idINTEGERReferences sellers.idFK
recorded_atTIMESTAMPTZSnapshot timestampIDX
total_orders_7dINTEGEROrders received in last 7 days
revenue_7d_sgdDECIMAL(12,2)Revenue in last 7 days (SGD)
ad_spend_7d_sgdDECIMAL(10,2)Shopee Ads spend in last 7 days
conversion_rateDECIMAL(5,4)Orders divided by product page views
shop_ratingDECIMAL(3,2)Store rating at snapshot
follower_countINTEGERStore follower count
idSERIALAlert identifierPK
seller_idINTEGERReferences sellers.idFK
alert_typeTEXTprice_drop / new_entrant / stock_out / rank_dropIDX
triggered_atTIMESTAMPTZWhen the condition was detected
item_idTEXTProduct that triggered the alert
messageTEXTAlert message sent to seller
delivered_viaTEXTwhatsapp / email / dashboard
delivered_atTIMESTAMPTZDelivery confirmation timestamp
idSERIALRecommendation identifierPK
seller_idINTEGERReferences sellers.idFK
scrape_run_idINTEGERThe weekly run this was generated fromFK
typeTEXTpricing / listing / promotion / positioning / keywordIDX
headlineTEXTOne-line summary of the recommendation
detailTEXTFull recommendation with data references
data_snapshotJSONBThe exact DB rows used to generate this recommendation
generated_atTIMESTAMPTZWhen the AI generated this
statusTEXTpending / actioned / dismissed