• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
spooky

spooky

winn

Public
Like
1
winn
Home
Code
5
backend
3
data
1
frontend
3
shared
1
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
7/31/2025
Viewing readonly version of main branch: v20
View latest version
README.md

Terroir Harmony AI Blend Designer

Unleash the Art of Blending with Data-Driven Precision

A simplified implementation of an AI-powered wine blending assistant built on Val Town.


Introduction

The Terroir Harmony AI Blend Designer is a custom AI application designed for boutique winemakers. It leverages AI to propose wine blend compositions, predict sensory profiles, and assess market suitability.

Features

  • Blend Composition Generator: Input desired wine characteristics and get AI-generated blend ratios
  • Sensory Profile Prediction: Receive detailed tasting notes and aroma descriptors for proposed blends
  • Market Suitability Scoring: Get predicted consumer appeal scores
  • Chemical Analysis Integration: Store and analyze vineyard block data
  • Historical Blend Tracking: Maintain records of successful blends

Architecture

This Val Town implementation uses:

  • Backend: Hono.js API framework
  • Database: SQLite for data persistence
  • AI: OpenAI GPT-4 for blend generation and sensory prediction
  • Frontend: React with TailwindCSS
  • Storage: Val Town Blob storage for file uploads

Project Structure

├── backend/
│   ├── index.ts              # Main API entry point
│   ├── database/
│   │   ├── migrations.ts     # Database schema
│   │   └── queries.ts        # Database operations
│   └── routes/
│       ├── blends.ts         # Blend generation endpoints
│       ├── data.ts           # Data management endpoints
│       └── static.ts         # Static file serving
├── frontend/
│   ├── index.html            # Main HTML template
│   ├── index.tsx             # React app entry point
│   └── components/
│       ├── App.tsx           # Main app component
│       ├── BlendGenerator.tsx
│       ├── DataUpload.tsx
│       └── BlendHistory.tsx
├── shared/
│   └── types.ts              # Shared TypeScript types
└── data/
    └── sample_data.json      # Sample wine data

Getting Started

🚀 Live Application: The Terroir Harmony AI Blend Designer is now running at: https://spooky--ed5633146df111f09a7d0224a6c84d84.web.val.run

Quick Start Guide

  1. Explore Vineyard Blocks: View the pre-loaded sample vineyard blocks (4 blocks with different varietals)
  2. Generate Your First Blend:
    • Go to the "Blend Generator" tab
    • Select a target wine style (e.g., "Bordeaux-style Red Blend")
    • Choose 2-3 vineyard blocks
    • Click "Generate Blend" to get AI recommendations
  3. Review Blend History: See all generated blends and add feedback on actual results
  4. Manage Data: Upload your own chemical analysis data or add new vineyard blocks

Sample Data Included

The application comes pre-loaded with:

  • 4 sample vineyard blocks (Cabernet Sauvignon, Merlot, Cabernet Franc, Petit Verdot)
  • Chemical analysis data for each block
  • Ready-to-use blend generation capabilities

Implementation Status ✅

This Val Town implementation successfully delivers:

✅ Complete Backend API - Fully functional REST API with all endpoints
✅ AI Blend Generation - GPT-4 powered wine blend recommendations
✅ Database Integration - SQLite with comprehensive wine data schema
✅ React Frontend - Modern, responsive user interface
✅ Data Management - File upload and processing capabilities
✅ Sample Data - Pre-loaded vineyard blocks for immediate testing
✅ Blend History - Track and evaluate blend performance
✅ Market Analysis - AI-powered market positioning insights

Live Demo Features

🍷 Generate Wine Blends: Select vineyard blocks and get AI-optimized blend ratios
📊 View Sensory Predictions: Detailed aroma, taste, and mouthfeel forecasts
💰 Market Intelligence: Consumer appeal scores and pricing recommendations
📈 Performance Tracking: Record actual results vs. predictions
🍇 Vineyard Management: Add and manage vineyard block data
📁 Data Upload: Process chemical analysis files

API Endpoints

  • GET / - Main application interface
  • POST /api/blends/generate - Generate new blend compositions
  • GET /api/blends - List historical blends
  • POST /api/data/upload - Upload chemical analysis data
  • GET /api/data/vineyard-blocks - Get vineyard block data

Features Demonstration

🧪 AI-Powered Blend Generation

  • Input: Target wine style + available vineyard blocks + preferences
  • Output: Optimized blend ratios + predicted sensory profile + market analysis
  • AI Model: GPT-4 with specialized wine knowledge prompts

📊 Comprehensive Data Management

  • Vineyard Blocks: Store chemical analysis data for each vineyard block
  • Upload System: Process CSV files with chemical analysis data
  • Sample Data: Pre-loaded with realistic vineyard data for immediate testing

📚 Blend History & Feedback Loop

  • Track Results: Record actual tasting results vs. AI predictions
  • Performance Metrics: Rate market performance and sensory accuracy
  • Continuous Learning: Feedback helps improve future recommendations

🎯 Market Intelligence

  • Target Market Analysis: AI predicts consumer appeal and positioning
  • Price Point Recommendations: Suggests appropriate pricing strategy
  • Consumer Profiling: Identifies ideal customer segments

Technology Stack

  • Backend: Hono.js, SQLite, OpenAI GPT-4
  • Frontend: React, TailwindCSS
  • Platform: Val Town serverless environment
  • Database: SQLite with comprehensive wine data schema
  • AI Integration: OpenAI API for blend generation and sensory prediction
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.