• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
tanishqkancharla

tanishqkancharla

food-tracker

Public
Like
food-tracker
Home
Code
5
AGENTS.md
README.md
deno.json
H
main.http.ts
main.ts
Environment variables
5
Branches
1
Pull requests
Remixes
History
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
9/11/2025
Viewing readonly version of main branch: v5
View latest version
README.md

Food Calorie Tracker - Val Town Version

A web-based food calorie tracker that estimates calories using AI and logs them to Notion.

Features

  • 🍎 Web interface for entering food descriptions
  • πŸ€– AI-powered calorie estimation using OpenAI GPT-4o
  • πŸ“Š Automatic logging to Notion database
  • 🎨 Clean, responsive UI with TailwindCSS

Setup

Environment Variables

Set these environment variables in your Val Town account:

  • NOTION_OAUTH_TOKEN - Your Notion OAuth token
  • OPENAI_API_KEY - Your OpenAI API key (handled by Val Town's OpenAI integration)

Notion Database

Your Notion database should have these properties:

  • Name (Title) - Food name
  • Calories (Number) - Calorie count
  • Date (Date) - Entry date (auto-populated)

Update the notionFoodDbId in notion.ts with your database ID.

Usage

  1. Visit the HTTP endpoint URL for your Val Town
  2. Enter a food description (e.g., "RT Rotisserie bowl with chicken and beet tahini sauce")
  3. Click "Estimate Calories & Log"
  4. View the AI's calorie estimate and confirmation of Notion logging

Architecture

  • main.http.ts - HTTP trigger with web interface and AI integration
  • notion.ts - Notion API integration for logging food entries
  • Uses Val Town's OpenAI integration for GPT-4o access
  • Responsive web UI built with TailwindCSS

Migration from Original

This version has been migrated from a Bun CLI script to a Val Town HTTP trigger:

  • βœ… Uses Val Town's OpenAI integration instead of direct OpenAI SDK
  • βœ… Environment variables use Deno.env.get() instead of process.env
  • βœ… ESM imports from https://esm.sh for compatibility
  • βœ… Web interface instead of CLI
  • βœ… HTTP trigger following Val Town conventions
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2026 Val Town, Inc.