Skip to content

About

Appetight: Top 10 at the Claude Builder Hackathon. SwiftUI nutrition app; log meals by photo or voice with Claude.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

20 Commits

Folders and files

Repository files navigation

Appetight

An iOS nutrition tracker that uses Claude to log meals from a photo or a sentence and to find food that fits your day.

Top 10 at the Claude Builder Hackathon (Anthropic).

Appetight is a SwiftUI app built over one day in April 2026. You set a goal once. The app works out your daily calories and macros. After that, you log food with the camera, your voice, or a quick form, and Claude fills in the nutrition numbers.

What it does

Logging

  • Photo logging. Take a photo or pick one from your library. The app sends it to Claude's vision model, which returns a food name, calories, protein, carbs, fat, and a serving size. You review the result and tap Log It. On the simulator the camera falls back to the photo picker.
  • Voice logging. Say what you ate. Apple's Speech framework transcribes it on the device. Claude turns the transcript into calories and macros, using standard portions when you don't give one.
  • Quick add. Type a name and calories, with optional macros.
  • Today view. A calorie ring and macro bars track progress against your targets. Today's meals are listed with their source (camera, voice, restaurant, manual) and can be deleted.

Planning

  • Calorie and macro targets. Onboarding asks for age, weight (lbs), height (ft/in), sex, activity level, and goal. TDEE.swift uses the Mifflin-St Jeor formula for BMR and multiplies it by an activity factor from 1.2 to 1.9. The goal adjusts the result by -500, 0, or +300 kcal, with a floor of 1200. Macros split 30% fat, with protein at 35% when losing weight and 25% otherwise. Carbs take the rest.
  • Hungry tab. Finds up to 8 restaurants within 1.5 km using Google Places. Claude suggests three menu items per restaurant that fit your goal and remaining calories, with estimated macros and prices. You can log an item, call the restaurant (phone number from Place Details), or open it in Apple Maps.
  • Plan tab (route meal planner). Reads the rest of today's calendar events with EventKit. If an event title has @ place, such as Study group @ Main Library, the app geocodes that place. For each gap between two events it searches for restaurants within 800 m of the midpoint, then asks Claude for menu picks. Each pick can be logged or added to your calendar as a 30-minute meal event.
  • Gym tab. Lists up to 5 gyms within 5 km from Google Places. Claude estimates hourly busyness from 5 AM to 11 PM for today and suggests a time to go. These numbers are model estimates. The app has no live crowd data.

Coaching

  • AI coach. A chat tab backed by Claude. It greets you by name with a tip, then answers in two or three sentences. The full conversation is sent on each turn.
  • Eating profile. AppState summarizes your logged meals: average daily calories, average macros per meal, dominant macro, most logged food, and usual meal hour. That summary goes into the system prompt for photo logging, voice logging, and the coach, so answers reflect your history.
  • Meal reminders. Local notifications at 8 AM, 12 PM, and 6 PM. Settings has a button to send a test notification.

Social

  • FriendsView.swift holds an accountability circle: a streak leaderboard with calorie progress bars and an invite field. It runs on three seeded demo friends stored locally. A later commit removed it from the tab bar, so it is not reachable in the current build.

Written but unused

  • HonchoService.swift is a REST client for Honcho peer memory (create a peer, log messages, post eating profile snapshots, ask its chat endpoint). An earlier version of the coach used it. The current coach calls Claude directly, and no view calls this service.
  • AnthropicService.generateMealPlan builds a 3 to 5 meal plan around calendar events. The Plan tab uses the route planner instead.
  • PersonaView.swift shows the stored eating profile. No screen links to it.

How it's built

flowchart LR
    subgraph Views[SwiftUI views]
        Today[Dashboard / Today]
        Log[Camera, Voice, Quick Add]
        Hungry[Hungry]
        Plan[Plan]
        Gym[Gym]
        Coach[Coach]
    end

    State[AppState<br/>profile, meals, eating profile<br/>UserDefaults]

    subgraph Services
        Anthropic[AnthropicService]
        Places[PlacesService]
        Apple[Calendar, Speech,<br/>Location, Notifications]
    end

    Views --> State
    Log --> Anthropic
    Hungry --> Places
    Hungry --> Anthropic
    Plan --> Apple
    Plan --> Places
    Plan --> Anthropic
    Gym --> Places
    Gym --> Anthropic
    Coach --> Anthropic
    Log --> Apple

    Anthropic --> Claude[(Claude Messages API<br/>claude-haiku-4-5)]
    Places --> Google[(Google Places<br/>and Geocoding)]
Loading
  • UI. SwiftUI with a five-tab TabView: Today, Hungry, Gym, Plan, Coach. RootView shows onboarding until a profile exists. Logging screens open as sheets from the Today tab.
  • State. AppState is an ObservableObject passed down as an environment object. It holds the profile and meal log and saves both as JSON in UserDefaults. PersonaEngine keeps a running UserPersona (totals, favorite foods, a keyword guess at cuisine) in UserDefaults as well.
  • Services. Network clients are Swift actors with a shared instance: AnthropicService, PlacesService, HonchoService. Apple framework wrappers (CalendarService, SpeechService, LocationService, NotificationService) are main-actor ObservableObjects. Everything uses async/await.
  • Claude. AnthropicService posts to https://api.anthropic.com/v1/messages with URLSession and anthropic-version: 2023-06-01. Every call uses claude-haiku-4-5-20251001. Prompts ask for raw JSON in a fixed schema. The parser strips code fences, slices from the first brace or bracket to the last, and decodes with Codable.
  • Google. PlacesService calls the Places Nearby Search, Place Details, and Geocoding web APIs.
  • Dependencies. None outside Apple's SDK: SwiftUI, EventKit, Speech, AVFoundation, CoreLocation, PhotosUI, UserNotifications.
  • Keys. API keys live in Appetight/Keys.swift, which is gitignored. Config.swift reads them into APIKeyStore. The keys are compiled into the app, which is fine for a demo. A shipped app should route calls through a server.

Run it

You need Xcode 26.2 or later. The project was created with Xcode 26.2 and targets iOS 26.2.

  1. Clone the repo and create your keys file:

    git clone https://github.com/Alex-Epstein/claude_hackathon.git
    cd claude_hackathon
    cp Keys.template Appetight/Keys.swift
  2. Fill in Appetight/Keys.swift:

    Key Needed for Where to get it
    anthropic Photo and voice logging, menu picks, gym estimates, coach console.anthropic.com
    googleMaps Hungry, Gym, and Plan tabs. Enable the Places API and the Geocoding API. console.cloud.google.com
    honcho Optional. Only used by the unwired HonchoService. Leave it empty. honcho.dev
  3. Open Appetight.xcodeproj. Under Signing & Capabilities, pick your own team and change the bundle identifier if needed.

  4. Build and run. Camera logging needs a real device. Everything else runs on the simulator.

The app asks for camera, photo library, microphone, speech recognition, location, calendar, and notification access when you first use each feature.

Keys.swift is listed in .gitignore. Keep it out of commits.

Repo layout

Path What's there
Appetight/AppetightApp.swift App entry, brand colors, RootView routing
Appetight/AppState.swift Profile, meals, eating profile summary, persistence
Appetight/Models.swift Profile, meal, restaurant, gym, and meal plan types
Appetight/TDEE.swift BMR, TDEE, calorie goal, macro split
Appetight/PersonaEngine.swift, UserPersona.swift Running eating profile built from logged meals
Appetight/AnthropicService.swift All Claude calls and JSON parsing
Appetight/PlacesService.swift Google Places and Geocoding
Appetight/HonchoService.swift Honcho memory client (not called yet)
Appetight/CalendarService.swift, SpeechService.swift, LocationService.swift, NotificationService.swift Wrappers for EventKit, Speech, CoreLocation, UserNotifications
Appetight/OnboardingView.swift Profile setup and target calculation
Appetight/DashboardView.swift, CalorieRingView.swift Tab bar, Today screen, ring and macro bars
Appetight/CameraLoggerView.swift, VoiceLoggerView.swift, QuickAddView.swift Meal logging sheets
Appetight/HungryView.swift Nearby restaurants with menu picks
Appetight/MealPlanView.swift Route meal planner over calendar events
Appetight/GymView.swift Nearby gyms with busy-time estimates
Appetight/CoachView.swift Coach chat
Appetight/FriendsView.swift, PersonaView.swift Screens not linked in the current build
Appetight/SettingsView.swift Profile, reminders, reset
Appetight/Config.swift Reads keys from Keys.swift
Keys.template Template for Appetight/Keys.swift
CLAUDE.md Notes for Claude Code (written earlier, partly out of date)

Team

Built at the Claude Builder Hackathon by Alex Epstein, with Lalit J, kach0w, and Dev Arora.

  • Alex Epstein: app structure, logging, Hungry, Gym, Plan, and coach.
  • Lalit J: the first coach and Honcho integration, camera demo setup, prompt work.
  • kach0w: the eating profile engine and profile screen.
  • Dev Arora: repo setup.

About

Appetight: Top 10 at the Claude Builder Hackathon. SwiftUI nutrition app; log meals by photo or voice with Claude.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages