A linear-programming sketch of vegan protein. The site frames daily nutrition as an LP — minimize cost, subject to the nine essential amino acids — and then lets you solve your own pantry against it.
Live: https://chasevarga.com/optimize_amino/
| Page | What it is |
|---|---|
index.html |
Essay: model, scenarios, 2D LP graph, embedded mini-tool |
solver.html |
Full solver — every option (patterns, balanced mode, supplements) |
simple.html |
High-contrast, semantic-HTML solver (WCAG-friendly) |
grains.html |
Pantry guide: grains in the AA-LP |
legumes.html |
Pantry guide: legumes |
protein-powder.html |
Pantry guide: isolates |
milk.html |
Pantry guide: plant milks |
seitan.html |
Pantry guide: wheat gluten |
Every page links to every other page via the shared SiteFooter.
Static. React 18 + Babel standalone are loaded from unpkg; JSX is transpiled in
the browser. The LP is a Big-M simplex written from scratch
(data.jsx::lpSolveMeal). Food records ship as a static JS file
(foods-usda.js) generated once from USDA FoodData Central.
data.jsx # LP, targets, FOODS, supplements
foods-usda.js # eager USDA food table (regenerated by build_foods.py)
v2-ui.jsx # shared visual primitives (theme, stickers, bars)
v2-nav.jsx # TopNav (sticky)
v2-footer.jsx # SiteFooter (shared across all pages)
v2-graph.jsx # 2D LP feasibility-polygon diagram
v2-tool.jsx # MiniTool (sticker-themed solver UI + receipt)
v2-page.jsx # V2Intro essay layout
v2-category.jsx # CategoryPage template
v2-category-data.jsx # CATEGORY_CONFIGS
v2-solver-page.jsx # SolverPage wrapper
simple.jsx # Accessible/semantic SimplePage
build_foods.py # One-shot USDA fetcher (USDA_API_KEY env var)
No build step. From the repo root:
python3 -m http.server 8000
# → http://localhost:8000/
export USDA_API_KEY=... # FoodData Central key
python3 build_foods.py > foods-usda.js
Variables are grams of each food in the pantry plus a pseudo-food for every essential amino acid (and a BCAA blend). Constraints require each AA to clear its FAO/NAM/NNR requirement scaled by body weight and meal fraction. The objective is total cost. Supplements have their real retail cost multiplied by a tunable factor (default 10×) so the solver only reaches for them when nothing in the pantry can cover the shortfall — which keeps the LP always feasible, while letting gaps stay visible on the receipt.