Public
Firewood Cafe menu with SquareMenu ordering flow
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.

Firewood Cafe Menu System

A modern, AI-powered menu management system for Firewood Cafe with real-time updates and PIN-protected editing.

Features

๐ŸŽฏ Customer-Facing Menu (/)

  • Beautiful responsive menu with categories: Breakfast, Burgers, Lunch, Drinks
  • Tap any dish to see full details, ingredients, and multilingual descriptions
  • AI-generated descriptions in English, Tagalog, and Chinese
  • Smooth cart management with checkout flow
  • Buzzer system for order pickup
  • Live data: Always displays the latest menu from blob storage

โœ๏ธ PIN-Protected Menu Editor (/edit)

  • PIN Security: Enter last 4 digits of phone number to unlock
  • Real-time editing: Edit dish names, descriptions, prices
  • Hide/show dishes: Toggle visibility without deleting
  • Add new dishes: Quick button to add menu items
  • Delete dishes: Remove items with confirmation
  • Instant save: Changes go live immediately in blob storage

๐Ÿค– AI-Assisted Dish Creation

  • Smart generation: Type a few words about a new dish (e.g., "spicy chicken curry with rice")
  • AI handles everything: Claude generates:
    • Professional dish name
    • Appetizing 1-2 sentence description
    • Relevant emoji
    • Ingredient list
    • Menu tags (Spicy, Vegetarian, etc.)
  • One-click add: Add generated dishes directly to any category

Architecture

Files

  • index.html - Customer-facing menu (loads data from API)
  • edit.tsx - PIN-protected editor with AI integration
  • api.ts - Backend API with three endpoints:
    • GET /api/menu - Fetch current menu
    • POST /api/menu - Save menu (PIN required)
    • POST /api/generate-dish - AI dish generation

Data Storage

  • Blob Storage: Menu data persists in Val Town blob storage (key: firewood_cafe_menu_data)
  • Fallback: Default menu loads if no blob data exists
  • No reload needed: Changes save to blob and appear instantly on customer menu

Environment Variables

CLAUDE_API_KEY        - Anthropic API key for AI dish generation
MENU_EDIT_PIN         - 4-digit PIN for menu editor (default: 3456)

Setting Up

  1. Get your Claude API key from https://console.anthropic.com
  2. Update the env vars in Val Town dashboard:
    • CLAUDE_API_KEY: Your actual key
    • MENU_EDIT_PIN: Last 4 digits of Tara's phone number

Usage

For Customers

Visit the main menu and:

  • Browse categories (swipe left to scroll)
  • Tap dish names to learn more
  • Tap ingredients to see details
  • Add items to cart
  • Proceed to checkout (buzzer number on completion)

For Tara (Menu Manager)

  1. Click the ๐Ÿ”ง Edit link in the menu header
  2. Enter your 4-digit PIN
  3. Edit existing dishes or use AI Assist to create new ones
  4. Click ๐Ÿ’พ Save when done
  5. Changes go live immediately โœจ

AI Assist Workflow

  1. In the editor, type a description (e.g., "crispy tofu spring rolls with sweet chilli")
  2. Click Generate Dish
  3. Review the AI output
  4. Click Add to Menu and select a category
  5. Saved instantly!

Customization

Default Menu

The default menu structure is in api.ts. Edit the getDefaultMenu() function to change it.

Styling

Both menus use the same color scheme:

  • Gold: #D4841B (primary)
  • Dark brown: #1a1410 (background)
  • See CSS variables in HTML for full customization

Categories

Currently supports: Breakfast, Burgers, Lunch, Drinks To add more, update:

  1. api.ts - getDefaultMenu() structure
  2. index.html - Category buttons and sections
  3. edit.tsx - Rendering logic

How It Works

  1. Tara edits menu โ†’ PIN verified โ†’ Changes sent to /api/menu (POST)
  2. API saves to blob โ†’ Menu persists
  3. Customers load menu โ†’ /api/menu (GET) fetches latest blob data
  4. No page reload needed โ†’ Changes visible immediately

AI Generation

  1. Tara types prompt โ†’ Sent to /api/generate-dish
  2. Claude processes โ†’ Returns structured dish data (JSON)
  3. Preview shown โ†’ Tara confirms and selects category
  4. Saved instantly โ†’ Added to menu in blob

Tips

  • PIN Security: Use your phone's last 4 digits so only you remember it
  • Bulk edits: Edit all dishes at once; save them all together
  • AI prompts: Be specific for better results (ingredients work great!)
  • Testing: Use PIN 3456 for testing (change it in env vars)

Built with โค๏ธ for Firewood Cafe