smooth-app
A collaborative, free and open database of ingredients, nutrition facts and information on food products from around the world
翻译准备中
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证正在加载完整 README。 以下为已保存的摘录。
Personal-first nutrition tracker with optional multiuser support — fast diary
logging, shared chain-store menus with verified items, custom store builds,
full nutrition panels, fasting history, voice and natural-language logging,
weekly analysis, and exportable reports. Installable as an iPhone Safari PWA.
Exercise lives in Iron Log, recipes in The Cookbook — MacroMap does food only.查看完整 README ↗Personal-first nutrition tracker with optional multiuser support — fast diary logging, shared chain-store menus with verified items, custom store builds, full nutrition panels, fasting history, voice and natural-language logging, weekly analysis, and exportable reports. Installable as an iPhone Safari PWA.
Exercise lives in Iron Log, recipes in The Cookbook — MacroMap does food only.
| Layer | Choice |
|---|---|
| Framework | Next.js 16 App Router + TypeScript |
| Styling | Tailwind CSS v4 + shadcn/ui (Radix) + Lucide |
| Database | Neon Postgres + Drizzle ORM (pg_trgm for fuzzy duplicate detection) |
| Auth | Clerk (proxy middleware, webhook user sync) |
| Rate limiting | Upstash Redis (no-op locally when unset) |
| AI | Gemini (@google/genai) text generation (natural-language/voice parse, day analysis with rule-based fallback) |
| Speech | Web Speech API (browser-native, zero cost) |
| Barcode scan | Native BarcodeDetector with manual-entry fallback |
| React-PDF rendered in a Node route | |
| Charts | Recharts (palette validated for CVD + contrast in both themes) |
| PWA | Serwist service worker, manifest, splash screens, safe-area CSS |
similarity > 0.4), every edit is logged per-field in
food_edit_history and shown on the food page.record_type discriminator), PDF export (streamed behind auth).pnpm install
cp .env.example .env.local # fill in Clerk + Neon at minimum
pnpm db:migrate # applies drizzle/migrations (enables pg_trgm)
pnpm db:seed # 11 stores, menus, ingredients, demo data
pnpm dev
Optional integrations degrade gracefully: without Upstash rate limits are
skipped; without GEMINI_API_KEY day-analysis falls back to rule-based
insights and natural-language logging returns 503; without BARCODE_API_KEY
(a free USDA FoodData Central key) the barcode pipeline stops after Open Food Facts.
Point a Clerk webhook (user.created / user.updated / user.deleted) at
/api/webhooks/clerk and set CLERK_WEBHOOK_SECRET. Write routes also upsert
the user row lazily, so local dev works without a tunnel.
| Command | Purpose |
|---|---|
pnpm dev | Dev server (Turbopack; service worker disabled) |
pnpm build | Production build (--webpack, required by Serwist on Next 16) |
pnpm test | Vitest suite (40 tests: nutrition math, Zod boundaries, CSV, weekly summary, insights, dates/theming) |
pnpm lint / pnpm typecheck | ESLint / tsc --noEmit |
pnpm db:generate / db:migrate / db:seed | Drizzle schema → SQL → apply → seed |
pnpm icons | Regenerate PWA icons + splash screens from the SVG mark |
diary_entries.nutrition_snapshot_json
stores label + scaled totals at log time; quantity edits rescale the stored
snapshot rather than re-reading the (possibly edited) shared food.src/lib/db/index.ts proxies Drizzle creation so
next build needs no DATABASE_URL. neon-http has no transactions;
multi-statement writes are sequential by design.name || ' ' || coalesce(brand_name, ''); POST /api/foods returns a
duplicate_warning payload unless forceCreate is set.--primary, --cta, --store-*) on a scoped wrapper, with
luminance-based text contrast and an optional per-store override.touch-action: manipulation
everywhere tappable, and 16px inputs on coarse pointers to kill focus zoom.Vercel + Neon + Clerk production instance: set the env vars from
.env.example, run pnpm db:migrate && pnpm db:seed against the production
branch, then verify the PWA checklist on a real iPhone (install from Share →
Add to Home Screen, standalone launch, no pinch zoom, store accent shift).