Skip to content

brianhu72/OasisAI

Repository files navigation

OasisAI — An adaptive nutrition intelligence layer for constrained living conditions

"We aren't building a recipe app. We're building a bridge out of a nutritional desert."

OasisAI is a constraint-based meal planning engine for the over 19 million Americans living in resource-constrained zones. It solves a real logistical challenges — using the actual ingredients available in your neighborhood, at prices you can actually afford, with the kitchen equipment you actually have.


The Problem: The Poverty Premium

Most nutrition AI tools are built for people with access to a full grocery store. For someone in a low-access ZIP code, a recipe calling for fresh kale is unfeasable.

Additionally, corner stores charge 30–50% more for shelf-stable goods while offering limitied fresh produce. People in food deserts need a system that understands their reality a builds recipes based off dynamic pricing options, while still being nutritious.

OasisAI performs Constraint-Based Gastronomy: we feed the AI the truth of your neighborhood, not the ideal of a Whole Foods aisle.


Key Features

Bodega-Aware Engine

Filters the entire ingredient universe down to the 52 items in data/bodega_ingredients.json — beans, rice, peanut butter, canned tuna, eggs, and more. This list is treated as a living dataset, validated against real store inventories. It is the single most critical variable in the system.

Inflation Multiplier

Uses USDA Low Access ZIP flags (data/usda_desert_zips.json) as a starting point, then prompts users to confirm or override local pricing. The default multiplier is a starting point — not a verdict. User ground-truth always wins.

Pantry Persistence

Tracks pantry state week over week via Supabase upserts. Buy a 5lb bag of rice in Week 1 — OasisAI remembers the remaining volume for Week 2, dropping your next shopping bill significantly. Call /api/update-pantry with each week's pantry_forecast to persist state.

Waste-Zero Loop

Friday's dinner uses the specific leftovers from Tuesday's prep. Every cent is stretched.

Resource Navigator

When a budget is mathematically insufficient for adequate nutrition, OasisAI surfaces the nearest food bank, WIC office, and SNAP enrollment resource.


Technical Architecture

User Input (ZIP + Budget + Kitchen Audit)
            ↓
    Constraint Engine
    ├── USDA Geo-check (data/usda_desert_zips.json)
    ├── SPRM price multiplier (user-confirmed or ZIP-derived)
    ├── Bodega JSON filter (data/bodega_ingredients.json)
    └── Pantry state (Supabase — session-scoped)
            ↓
    Claude claude-sonnet-4-6 (Constraint-Injected Prompt)
            ↓
    MealPlanOutputSchema validation (lib/plan-validator.ts)
            ↓
    7-Day Meal Plan + Smart Shopping List + Week 2 Forecast

Stack

Layer Tool
Frontend Next.js 16.2.4 (App Router, Turbopack)
AI Brain Claude claude-sonnet-4-6 (Anthropic API)
Geospatial Data USDA Food Access Research Atlas (20 demo ZIPs)
Persistence Supabase (PostgreSQL) — pantry state + local price multipliers
Session Model oasis_session_id in localStorage

Supabase Client Split

Client File Use
Server (bypasses RLS) lib/supabase-server.ts API route mutations
Browser (safe) lib/supabase-client.ts Future read-only dashboards

The Logic Flow

1. Calibration ZIP input → USDA desert check → SPRM multiplier derived (or user-confirmed) → local price overrides applied.

2. Kitchen Audit 30-second checklist: what's in the cupboard? What cooking equipment do you have (microwave, hot plate, or stove)?

3. Constraint Injection Claude receives a structured prompt validated against MealPlanOutputSchema:

Act as a compassionate, expert nutritionist.
Your user is in a food desert with a budget of [BUDGET].

CRITICAL LIMITATION: You may ONLY use ingredients from the [BODEGA_LIST].
PRICING: Apply a [USER_CONFIRMED_MULTIPLIER] to all items.
PANTRY: User already owns [INVENTORY]. Use these first — $0 cost for those items.
EQUIPMENT: The user only has a [MICROWAVE].
GOAL: Design a 7-day plan. Prioritize protein-density and satiety.
FORMAT: End with a 'Next Week' forecast of which dry goods remain in their pantry.

4. Output 7-day meal plan (breakfast, lunch, dinner, snack) → smart shopping list → Week 2 pantry forecast.


Setup

1. Install dependencies

npm install
# or yarn / pnpm / bun

2. Configure environment variables

# .env.local
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=   # server-only
ANTHROPIC_API_KEY=            # server-only

3. Apply database migrations

Run the files in supabase/migrations/ in your Supabase SQL editor.

4. Run the dev server

npm run dev

Open http://localhost:3000.


Common Scripts

Command Action
npm run dev Start dev server (Turbopack)
npm run build Production build
npm run start Run production build
npm run lint ESLint
npx tsc --noEmit --skipLibCheck Type check

Project Structure

/oasis-ai
├── app/
│   └── api/
│       ├── generate-plan/     — Claude meal plan generation
│       └── update-pantry/     — Supabase pantry state upsert
├── data/
│   ├── bodega_ingredients.json — 52 corner store ingredients (load-bearing)
│   └── usda_desert_zips.json   — 20 demo food desert ZIPs
├── lib/
│   ├── plan-validator.ts       — MealPlanOutputSchema (Claude output contract)
│   ├── supabase-server.ts      — Server client (bypasses RLS)
│   └── supabase-client.ts      — Browser client (safe for frontend)
├── supabase/
│   └── migrations/             — Apply in Supabase SQL editor
└── CLAUDE.md                   — Next.js 16.2.4 version-specific guidance

Ethical Design

Dignity-First Language No budget shaming. The UI uses "household budget" and "community resources" — never stigmatizing terms. Claude is instructed to frame all outputs around strength and agency.

Utility Realism Users specify their kitchen equipment. No recipe ever requires an oven they don't have.

User Ground-Truth Over Assumptions ZIP codes are a signal, not a verdict. Users can override any default multiplier with what they actually see on shelves.

Resource Navigator as Core Feature When the math is impossible, surfacing food assistance is treated as a dignified outcome — not a failure state.


Impact Metric

Nutrition Gained per Dollar Spent — measured against the baseline of an unassisted shopper in the same ZIP code buying without constraint optimization.

OasisAI takes the reasoning power of Claude and applies it to the most granular level of economic survival. The goal isn't a better recipe app. It's economic agency for people the "AI Revolution" is currently leaving behind.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors