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。 以下为已保存的摘录。
A shared, real-time baby-tracking app (feeds, pees, poops) built with Next.js, TypeScript, Tailwind CSS, and Supabase.
2. Create a Supabase project at supabase.com, then copy .env.local.example to .env.local and fill in your project's URL and anon key (found under Project Settings → API):
3. Apply the database schema: open your Supabase project's SQL Editor and run each file in supabase/migrations/ in filename order (they're timestamped). (If you have the Supabase CLI linked to this project, supabase db push works too.)查看完整 README ↗A shared, real-time baby-tracking app (feeds, pees, poops) built with Next.js, TypeScript, Tailwind CSS, and Supabase.
Install dependencies:
npm install
Create a Supabase project at supabase.com, then copy .env.local.example to .env.local and fill in your project's URL and anon key (found under Project Settings → API):
cp .env.local.example .env.local
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
Apply the database schema: open your Supabase project's SQL Editor and run each file in supabase/migrations/ in filename order (they're timestamped). (If you have the Supabase CLI linked to this project, supabase db push works too.)
Optional but recommended for a two-person household: under Authentication → Providers → Email in the Supabase dashboard, turn off "Confirm email" so signup doesn't require clicking an email link first.
Optional — enable "Continue with Google":
https://<your-project-ref>.supabase.co/auth/v1/callback.http://localhost:3000/auth/callback (and your production URL + /auth/callback once deployed) to the Redirect URLs allowlist./onboarding to finish household setup, with the name field prefilled from the Google profile when available.Run the dev server:
npm run dev
Open http://localhost:3000. Signup collects your name, email, password, and household choice (create or join, via invite code) all on one screen; on success you land straight on the Log tab. (If your Supabase project has email confirmation on, you'll finish household setup at /onboarding after confirming instead.) Then add your baby.
src/app — Next.js App Router pages: /login, /signup, /onboarding (fallback household setup for the email-confirmation case), / (Log), /timeline, /reportssrc/components — React components, grouped by feature (auth, onboarding, baby, log, timeline, reports, layout)src/lib/supabase — Supabase client helpers (browser, server, and proxy clients, using @supabase/ssr) and generated Database typessrc/lib/entries.ts — grouping/sorting/formatting helpers shared by the Log and Timeline screenssrc/lib/reports.ts — client-side stat/daily-aggregate computation for the Reports screenproxy.ts — refreshes the Supabase auth session on each request (this Next.js version renamed middleware.ts to proxy.ts)supabase/migrations — SQL schema migrations, applied in orderFour tables, matching the paper log this app replaces:
households — a household using the app, with a unique invite_code for onboardingusers — one row per household member, mirrors auth.usersbabies — one row per baby, belongs to a householdentries — one row per logged event: type (feed / pee / poop), timestamp, notes, amount_ml (feed only), logged_byRow Level Security is enabled on all four tables, scoped so a signed-in user can only see/edit their own household's data (via a current_household_id() helper function). New users attach to a household through the create_household/join_household Postgres functions (called from the onboarding screen), not by inserting rows directly.
The matrix UI clusters same-instant entries (e.g. a feed logged alongside a pee) back into a single row for display, since the paper log this replaces often has multiple things happening at once — see groupEntriesIntoMoments in src/lib/entries.ts.
Realtime is enabled on entries (see the enable_realtime migration), so when one household member logs something, the other sees it appear live without refreshing — this is delivered subject to the same RLS policies, so only household members receive it.
Both Home and Timeline sort moments chronologically by timestamp (the event's actual time), most recent first — groupEntriesIntoMoments in src/lib/entries.ts handles both the clustering and the sort.
Reports (/reports) computes stat cards (total entries/feeds, avg mL per feed, avg gap between feeds), two per-day bar charts, and a daily summary table — all client-side from the fetched entries, no SQL aggregation views. Fine at household scale; revisit if this becomes commercial and datasets grow.
The "paper" visual language (warm off-white surfaces, ruled-line table dividers, amber/sage/terracotta/brand-blue accents) is defined as Tailwind v4 theme tokens directly in src/app/globals.css via @theme — this Tailwind version doesn't use a tailwind.config.js, so tokens like --color-sage live in CSS and generate bg-sage/text-sage/etc utilities automatically. Shared primitives live in src/components/ui (Field, TextInput, PrimaryButton) and src/components/brand (BrandMark). Per-person identity colors (avatars, "logged by" pills) cycle through a fixed sage/terracotta/brand-blue palette by household join order — see src/lib/person-colors.ts. There is no dark mode; the design spec is light-only by intent.
Login/signup succeeds but bounces back to /login, or server-side Supabase calls fail with UNABLE_TO_GET_ISSUER_CERT_LOCALLY: some local setups (antivirus/VPN software doing HTTPS inspection) install a certificate your browser trusts but Node.js doesn't, so the server can't verify your session with Supabase even though the browser signed in fine. Workaround for local dev only — never for production:
NODE_TLS_REJECT_UNAUTHORIZED=0 npm run dev