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.
Track what you eat and how your digestion responds β over time, identify which ingredients are correlated with digestive issues.
- AI-powered meal logging β describe your meal in plain text, and GPT-4o-mini automatically extracts individual ingredients (powered by Val Town's built-in OpenAI integration β no API key needed!)
- Bristol Stool Scale β track bowel movements using the medically-recognized 7-type scale (Type 1 = hard lumps/constipation β Type 7 = watery/diarrhea), with visual color indicators and category labels
- Digestion symptom tracking β log bloating, gas, and pain/cramps on a 0β5 scale with color-coded severity buttons
- Date & time backfilling β pick any date/time when logging a meal or symptom, so you can add entries retroactively. On iOS, this uses the native wheel picker.
- Smart correlation β ingredients are automatically linked to symptoms logged within 24 hours, or you can manually link a symptom to a specific meal
- Insights dashboard β see which ingredients correlate with worse-than-average or better-than-average digestion, ranked by deviation from your baseline
Built to look and feel like a native iOS app:
- SF Pro font stack via
-apple-system - iOS system colors (
#007AFFblue,#34C759green,#F2F2F7grouped background) - Frosted glass tab bar with
backdrop-filter: blur() - Large title navigation pattern
- Inset grouped table views with 12px rounded corners
- Safe area insets for notch/Dynamic Island devices
- PWA meta tags for "Add to Home Screen"
Rendering mermaid diagram...
index.ts β Hono server (API routes + frontend serving)
lib/
db.ts β SQLite schema, queries, correlation analysis
ai.ts β OpenAI ingredient extraction via std/openai
frontend/
index.html β HTML shell (iOS fonts, Twind, safe areas)
index.tsx β React entrypoint
favicon.svg β App icon
components/
App.tsx β Root layout + iOS frosted tab bar
LogMeal.tsx β Meal entry + AI extraction + date picker
LogSymptom.tsx β Symptom ratings + Bristol Stool Scale + date picker
History.tsx β iOS grouped list with date section headers
Insights.tsx β Ingredient correlation cards with delta bars
- Frontend: React 18 + Twind (Tailwind at runtime, no build step)
- Backend: Hono on Val Town
- Database: Val Town built-in SQLite (
std/sqlite) - AI: Val Town's built-in OpenAI proxy (
std/openai) β free tier coversgpt-4o-mini, no API key required
- Open the app on your phone (it's mobile-first!)
- Meal tab β type what you ate β tap "Extract Ingredients with AI" β review/edit the ingredient chips β pick a date if backfilling β save
- Symptoms tab β rate bloating/gas/pain β select Bristol Stool Scale type β optionally link to a meal β pick a date if backfilling β save
- History tab β see all entries grouped by date with Bristol color indicators
- Insights tab β see which ingredients correlate with bad digestion
The more meals and symptoms you log, the more reliable the correlations become. At least 2 meals per ingredient are needed before it appears in insights.