SANITY CHALLENGE — PATH 2
Niche Collector
Collection Tracker + Price Intelligence for niche hobbies. Track Hot Wheels, Gundam, Mechanical Keyboards — auto valuation from Tokopedia/Shopee prices via Sanity structured content.
🏎️
Structured Schema
5 types: hobbyCategory, collectibleItem, collection, priceHistory, wishlist. Relations + GROQ for median valuation.
📈
Price Intelligence
priceHistory per item → GROQ query calculates median, detects outliers, 30-day trend.
🎯
Wishlist Alerts
Target price vs market price → trigger alert when price drops to your budget.
GROQ Example — Portfolio Valuation
*[_type == "collectibleItem" && status == "owned"]{
title, purchasePrice, currentValue,
"trend": *[_type=="priceHistory" && item._ref==^._id] | order(recordedAt desc)[0..9]{price, recordedAt}
} | { "totalPurchase": sum([].purchasePrice), "totalMarket": sum([].currentValue), "gain": sum([].currentValue) - sum([].purchasePrice) }This query only works because content is structured — keyword search cannot calculate gain/loss.
Setup Project ID: Create a project at
sanity.io/manage → copy Project ID → set in .env.local as NEXT_PUBLIC_SANITY_PROJECT_ID. Dataset: production.