Skip to content

Claude/winebob explore analysis c i8d w#8

Open
cphrealestate wants to merge 205 commits intoAustin1serb:mainfrom
cphrealestate:claude/winebob-explore-analysis-cI8dW
Open

Claude/winebob explore analysis c i8d w#8
cphrealestate wants to merge 205 commits intoAustin1serb:mainfrom
cphrealestate:claude/winebob-explore-analysis-cI8dW

Conversation

@cphrealestate
Copy link
Copy Markdown

No description provided.

claude and others added 30 commits April 2, 2026 14:45
Winebob is a wine tasting social platform combining Kahoot (blind tastings),
Polymarket (wine predictions), Vivino (ratings/discovery), and Strava
(activity tracking) — designed iPhone-first with a warm, social aesthetic.

Phase 1 includes:
- Next.js 16 PWA with App Router, Tailwind CSS, iPhone-first design
- Neon serverless PostgreSQL via Prisma 7 ORM
- Full domain schema: User, Wine, Reviews, TasteProfile, BlindTasting,
  PredictionMarket, Activity, CellarItem, Badges, Social graph
- 5 tab pages: Blind Arena, Vine Futures, Wine Cellar, Wine Trail, Profile
- Taste Quiz onboarding (5-question flow generating taste profiles)
- SVG radar chart for taste profile visualization
- Scoring service for blind tasting (friendly & encouraging)
- Recommendation engine (content-based + collaborative filtering)
- Label scanning API via Claude Vision
- Reputation & gamification service (XP, levels, ranks, badges)
- i18n messages (English + Danish)
- Wine seed data (40+ curated wines across 15 countries)
- Warm wine color palette (burgundy, gold, cream, rosé, sage)

https://claude.ai/code/session_01VhhYdrAzTJwaWm29amwEhd
- vercel.json with CPH region, security headers, PWA cache config
- Vercel Analytics + Speed Insights in root layout
- Vercel Blob upload API route for wine labels/photos (10MB max, JPEG/PNG/WebP/HEIC)
- next.config.ts with Vercel Blob image domain whitelist
- Updated .env.example with BLOB_READ_WRITE_TOKEN

https://claude.ai/code/session_01VhhYdrAzTJwaWm29amwEhd
…an, check-in, wine detail

- Add NextAuth.js with Google/Apple providers, proxy auth gate, login page
- Add server actions for taste profile, wine search, reviews, CRUD
- Rewrite Cellar as Server Component with real DB queries + client search/filters
- Add wine detail page (/cellar/wine/[id]) with reviews
- Add check-in flow (/cellar/checkin) with search, rating, tasting notes
- Add label scan page (/cellar/scan) with camera/upload + Claude Vision
- Remove all dead links from Arena, Trail, Profile pages (less is more for MVP)
- Migrate middleware.ts to proxy.ts for Next.js 16 compatibility

https://claude.ai/code/session_01VhhYdrAzTJwaWm29amwEhd
…focus

Phase 2+ features removed (cellar ratings, futures/predictions, trail/activity,
taste profiles, recommendations, badges, social graph). Schema rebuilt with
only what matters for MVP:

- EventTemplate: flexible, curated tasting formats hosts pick from
- BlindTastingEvent: join code + QR, configurable guess fields + scoring
- GuestParticipant: zero-friction join (name, birth year, location, GDPR consent)
- BlindGuess: flexible per-field guessing, scored against actual wines
- Wine: curated database for hosts to build events from

New pages:
- / — Landing with join code input (primary) + host CTA
- /join/[code] — Guest registration (name, birth year, location, consent)
- /play/[eventId] — Live tasting experience (lobby → guess → reveal → scoreboard)
- /arena — Host dashboard with templates + event management
- /arena/create — Multi-step event creation from template or scratch
- /arena/event/[id] — Host control panel (open lobby, advance wines, reveal, score)

Strategy: blind tasting events as viral acquisition loop. Every event brings
5-10 new users with zero friction. Demographic data (age, location, taste
patterns) collected GDPR-compliantly for wine industry insights.

https://claude.ai/code/session_01VhhYdrAzTJwaWm29amwEhd
…m-plan-tCEdL

Winebob MVP — Blind tasting event platform
…m-plan-tCEdL

Fix seed script and prisma config
…m-plan-tCEdL

Claude/hybrid skills platform plan t c ed l
…m-plan-tCEdL

fix: add ws for Neon serverless driver in Node.js (needed for local s…
…animation

- New color system: butter yellow (#FFEEBC) main, cherry red (#74070E) accent,
  baby blue (#C0D8F0), warm leather brown (#6B3A2A)
- Landing animation: sky gradient background with drifting clouds, three wine
  bottles falling from sky and landing on antique wooden table, Winebob logo
  reveals after bottles settle, scene fades to main UI
- SVG wine bottle illustrations (no emoji)
- Move ws to dependencies (needed for local seed script)
- Old wine-burgundy/wine-cream color names kept as aliases for compatibility

https://claude.ai/code/session_01VhhYdrAzTJwaWm29amwEhd
…m-plan-tCEdL

fix: add ws for Neon serverless driver in Node.js (needed for local s…
…m-plan-tCEdL

fix: rewrite seed to use neon() HTTP function — bypasses WebSocket is…
claude added 30 commits April 7, 2026 18:08
- Track activeCity state for highlighted city pill
- Reset city/tour state on region change and back-to-world
- City pills now highlight cherry when active (matching explore page)
- Full feature parity: tour, satellite, city hopping, active highlight

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
Tour button and city hopping pills only appeared for regions with
sub-cities defined. Added sub-cities for all 18 missing regions:
Loire Valley, Rhone Valley, Alsace, Provence, Veneto, Sicily,
Ribera del Duero, Priorat, Alentejo, Rheingau, Sonoma,
Willamette Valley, Mendoza, Maipo Valley, Colchagua Valley,
Barossa Valley, Margaret River, Marlborough, Stellenbosch

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
…or all 27 regions

Expand TourStop type with tagline, grapes[], and notableWines[] fields.
Each sub-city across all 27 wine regions now has curated content for
cinematic tour stops.

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
- New TourInfoCard component: shows stop name, tagline, grape pills,
  notable wines, and "Explore wines" deep link during cinematic tours
- Tour pacing: 3.5s flight duration, 5.5s dwell at each stop (was 2.5s/1.5s)
- Card fades in after camera settles, clears before next flight
- onTourStop callback fires with TourStop data or null (in-flight)
- Wired up in both explore page and wines page (desktop + mobile)

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
Layer System:
- MapLayerDrawer: FAB + expandable panel with grouped layer toggles
- useMapLayers hook: state management with localStorage persistence
- Mutual exclusion for "heavy-overlay" layers (weather/flavor genome)
- 4 layers defined: Vintage Weather, Flavor Genome, Live Activity, Draw Flight

New Prisma Models:
- WineTasting: personal tasting log with ratings
- WineWishlist: wines to try next
- ProducerFollow: favorite producers
- TastingFlight: saved drawn flight paths
- WineCheckIn: live heatmap drinking sessions
- RegionFlavorProfile: 6-axis flavor data per region

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
- My Cellar: horizontal scroll of favorited wines with type color bars
- Taste Profile: wine type distribution bar + top grapes from favorites
- Tasting History: recent events with status badges and guest counts
- Wishlist: horizontal scroll (from new WineWishlist model, graceful fallback)
- Regions Explored: progress bar showing X/27 regions with region pills
- Settings: collapsible section to reduce default page length
- Fetch createdAt from User model for "Member since" display
- New model queries wrapped in try/catch for pre-migration safety

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
Both pages now show the floating layer FAB with toggle panel.
Layer state persists via localStorage across sessions.

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
- WineRegionMap: export REGION_CITIES, accept mapRef prop for layer
  components to access the Mapbox map instance directly
- /api/checkin: POST to create wine check-ins, GET to fetch active
  check-ins as GeoJSON for the live heatmap layer

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
User value: "Why does this vintage matter?" — see the actual weather
that shaped a wine, from bud break to harvest.

Features:
- Year picker (1990-2025) with horizontal scroll
- Open-Meteo Historical API integration with localStorage caching
- Timeline scrubber with play/pause, drag-to-scrub, month labels
- Temperature-driven map fill color (blue→green→yellow→red gradient)
- Growing Degree Day computation with milestone annotations
  (Bud Break, Flowering, Véraison, Harvest)
- Data card showing current date, temp, precipitation, GDD
- Rain day indicator overlay
- Loading/error states
- Clean restore of map defaults on deactivate

Also wires mapRef and both Weather + Flavor layers into explore page.

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
Fixes:
1. Layer panel no longer blocks map touch/pan/zoom — wrapper uses
   pointer-events-none, only panel and FAB capture clicks
2. Reduced panel width to 260px for better mobile fit
3. Changed from fixed to absolute positioning to stay within map bounds

Missing features:
4. Added VintageWeatherLayer to wines page (was only on explore page)
5. Both Weather and Flavor Genome layers now work on both pages

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
Work in progress from parallel feature agents:
- FlavorGenomeLayer: radar chart markers on regions with similarity search
- regionFlavors.ts: curated 6-axis flavor data for all 27 regions
- LiveHeatmapLayer: real-time check-in dots with clustering
- DrawFlightLayer: freehand drawing with region intersection detection
- /api/flights: save tasting flight route endpoint
- WineDetailClient: "I'm drinking this" check-in button

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
All layers now active on both pages:
- Vintage Weather Replay
- Flavor Genome Map
- Live Social Heatmap
- Draw Your Flight

Fixes Vercel build error: FlavorGenomeLayer import was present
before the file existed in the earlier commit.

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
DrawFlightLayer uses `export default` not `export function`.
Changed to default import in both explore and wines pages.

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
… readability

FlavorGenomeLayer:
- Brighter radar charts with dominant-trait color coding (tannin=red, fruit=pink, etc.)
- Darker background + border for contrast against map
- Zoom-responsive sizing (30px at world view, 50px zoomed in)
- Region name labels below each radar marker
- Drop shadow filter for map readability

VintageWeatherLayer:
- Bottom controls moved up (bottom-28) to clear tab bar
- Timeline scrubber + year picker made more compact
- Milestone labels abbreviated (Bud, Bloom, Vér., Harv.) to prevent overlap
- Temperature color legend added (left side, 5-35°C scale)
- Map fill opacity increased to 0.65 + region outline colored
- Year picker auto-scroll with 100ms delay for DOM readiness
- Rain threshold at 2mm

MapLayerDrawer:
- Panel widened to 280px
- Description text uses line-clamp-2 instead of truncate

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
Schema (11 new models):
- Wine model: barcode, lwin, externalIds, source, confidence, canonicalWineId,
  lastVerifiedAt, importBatchId fields for data provenance and dedup
- GrapeVariety: canonical grape reference with aliases, VIVC IDs, acreage
- Appellation: hierarchical wine appellations (AOC/DOC/AVA) with boundaries
- Producer: canonical producer entities with verification
- ImportBatch: tracks each data import run with counts and status
- WineMerge: deduplication audit log with confidence scores
- WineEvent: analytics event tracking (views, searches, favorites, etc.)
- UserConsent: GDPR-compliant consent tiers (analytics/enhanced/research)
- WinePopularity, RegionTrend, GrapeTrend, ProducerInsight: aggregation tables

Event tracking (src/lib/analytics.ts):
- Fire-and-forget pattern (never blocks user actions)
- Consent-aware (checks UserConsent before logging)
- Wired into searchWines, getWineById, toggleFavorite, addWine actions

Import pipelines:
- normalize.ts: shared normalization (wine names, producers, grapes, fingerprints)
- wikidata.ts: SPARQL import for wines, regions, grape varieties
- openfoodfacts.ts: paginated category search with barcode mapping

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
Aggregation (src/lib/aggregation.ts):
- Daily wine popularity rollups from WineEvent data
- Weekly region and grape trend computation
- Monthly producer insight aggregation
- runAllAggregations() for cron job triggering

Analytics API (src/app/api/analytics/):
- POST /aggregate: trigger aggregation (auth + secret key)
- GET /insights: query wine popularity, region trends, grape trends,
  producer insights, and trending data (public, anonymized)

Consent (src/lib/consent.ts):
- getUserConsent / updateConsent server actions
- hasConsent helper for analytics.ts integration
- GDPR exportUserData (right of access)
- GDPR deleteAnalyticsData (right to erasure)

Consent API (src/app/api/consent/):
- GET: read consent settings (authenticated)
- PUT: update consent tiers (authenticated)
- DELETE: erase analytics data (authenticated)

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
TTB importer (src/lib/importers/ttb.ts):
- Fetches US TTB COLA (Certificate of Label Approval) data
- Dual mode: API search endpoint + CSV fallback for bulk data
- Maps COLA fields to Wine schema (name, producer, vintage, grapes, abv)
- source="ttb", confidence=0.8, externalIds with COLA serial number
- Dedup via wine fingerprint, batch insert in groups of 100
- Rate limiting (500ms between API calls), retry with backoff

Admin import API (src/app/api/import/route.ts):
- POST: trigger import by source (wikidata/openfoodfacts/ttb)
- Returns ImportBatch ID immediately for status polling
- GET: check import batch status by batchId
- Protected by IMPORT_SECRET env variable

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
Covers all major wine classification systems:
- France (44): AOC — Bordeaux, Burgundy, Rhône, Loire, Alsace, Champagne, Provence
- Italy (13): DOCG/DOC/IGT — Barolo, Brunello, Chianti, Prosecco, Bolgheri, Etna
- Spain (10): DOCa/DO — Rioja, Ribera del Duero, Priorat, Cava, Jerez
- Portugal (7): DOC — Douro, Porto, Alentejo, Vinho Verde, Madeira
- Germany (6): Qualitätswein — Mosel, Rheingau, Pfalz, Baden
- USA (10): AVA — Napa, Sonoma, Willamette, Oakville, Stags Leap
- Southern Hemisphere (15): GI/WO/DOC — Barossa, Marlborough, Stellenbosch, Mendoza

Each with permitted grapes, establishment year, and description.
Runnable: npx tsx prisma/seedAppellations.ts

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
69 red grapes: from Cabernet Sauvignon (340K ha) to Raboso,
covering France, Italy, Spain, Portugal, Germany, Austria,
Hungary, Greece, Croatia, Georgia, South Africa, Argentina, USA

71 white grapes: from Chardonnay (210K ha) to Seyval Blanc,
including Georgian qvevri grapes, German crossings, and hybrids

Each with aliases, origin country, description, and planted acreage.
Runnable: npx tsx prisma/seedGrapes.ts

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
GDPR (consent.ts + consent/route.ts):
- exportUserData() now includes wishlist, producer follows, tasting flights
- deleteUserData() deletes ALL personal data (events, favorites, tastings,
  wishlist, check-ins, follows, flights, consent) — not just analytics
- Type nullability fixed for region/country/name/path fields
- Upsert race conditions replaced with findUnique + create/update

Import pipelines:
- wikidata.ts: fixed @/ import alias to relative path for CLI usage
- normalize.ts: added accent decomposition for dedup fingerprints
  ("Château" vs "Chateau" now match), abbreviation expansion (Ch.→Château)

Tracking (actions.ts):
- Added tracking to getWineLibrary, getBrowseWines
- toggleFavorite now tracks both adds AND removes
- All tracking calls use consistent .catch(() => {}) pattern

Seed files:
- seedGrapes.ts: added toPgArray() for proper PostgreSQL text[] serialization
- seedAppellations.ts: same array fix for grapeVarieties column
- seed.ts: same fix for wine grapes column
- package.json: added db:push, db:seed, db:generate scripts

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
…egory dedup

openfoodfacts.ts:
- Fixed API URL to use proper search_terms format
- Added cross-category barcode Set to prevent duplicate inserts
  when same wine appears in "wines" and "red wines" categories

wikidata.ts:
- Replaced load-all-wines dedup with batch name lookup
  (where: { name: { in: [...] } }) to avoid OOM on large DBs
- Removed skipDuplicates (unreliable with Neon HTTP adapter)

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
ttb.ts: Added clear documentation that API mode is experimental
and CSV fallback is the reliable import path.

openfoodfacts.ts: Minor category handling fix.

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
import/route.ts: Changed to create batch as "queued" instead of firing
import in background (serverless timeout risk). Documented that imports
should run via CLI, not the API endpoint.

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
tsx fails on Node v25 with ERR_MODULE_NOT_FOUND. The seed scripts only
use type annotations (no runtime TS features), so plain .mjs files work
on any Node version without tsx. db:seed now uses `node` directly.

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
Neon HTTP adapter doesn't support transactions, and Prisma's createMany
wraps inserts in a transaction. Switch to individual create() calls
for both wikidata and TTB importers.

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
- Wikidata importer: use empty string instead of "Unknown" for missing
  producer/region/country; filter out non-wine items (vinegar, juice, etc.)
  and entries with no country AND no producer
- OpenFoodFacts/TTB importers: same empty string fix
- All wine display components: use .filter(Boolean).join() so empty
  producer/region fields don't show "Unknown · Unknown, Country"

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
- Schema: Wine now has producerId FK linking to Producer model
- validate.mjs: rejects wines missing required fields or containing garbage
- cleanup.mjs: removes wikidata/openfoodfacts/ttb imported wines
- seed-all.mjs: master seeder that imports regional files, validates, inserts
- package.json: add db:seed:wines and db:cleanup scripts

Regional wine data files (france.mjs, italy.mjs, etc.) pending.

https://claude.ai/code/session_01D2q8p4zqEdfUWbBu5iMNrd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants