L-GEVITY
L-GEVITY is het platform waar jij jouw huidige en toekomstige gezondheid kunt meten en verbeteren met gerichte leefstijlaanpassingen op basis van bloedwaarden, fitnesstests, biomarkers en slimme algor
翻译准备中
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Strength gain and weight loss coaching app built with Next.js and Supabase
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
Private performance coaching dashboard for fat loss, strength, and running.
This README was originally written for Phase 1A, and several of its
sections (file tree, RLS policy summary, deferred features, and the
Phase 1A testing checklist) still describe the app as it stood then.
The app has since progressed through Phase 1V and is live for
controlled buddy testing — see Live deployment below.查看完整 README ↗Private performance coaching dashboard for fat loss, strength, and running.
This README was originally written for Phase 1A, and several of its sections (file tree, RLS policy summary, deferred features, and the Phase 1A testing checklist) still describe the app as it stood then. The app has since progressed through Phase 1V and is live for controlled buddy testing — see Live deployment below. Those older sections haven't been rewritten yet; treat them as historical context rather than current documentation until a full docs refresh happens (see Watch list before wider testing near the end of this file).
Root / redirects to /dashboard (signed in) or /login (signed out).
Copy .env.example to .env.local and fill in:
cp .env.example .env.local
NEXT_PUBLIC_SUPABASE_URL=https://your-ref.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_APP_NAME=ShredOS
Get your Supabase URL and anon key from: supabase.com → your project → Settings → API
NEXT_PUBLIC_APP_URL must match the real deployed URL
(https://shredos-pi.vercel.app), not localhost. This value feeds
directly into the magic-link and sign-up email redirect
(emailRedirectTo) — if it's left at the .env.example default,
confirmation emails sent to remote testers will redirect back to
localhost and silently fail.
supabase/migrations/001_phase1a_schema.sqlhttp://localhost:3000http://localhost:3000/auth/callback# Install Supabase CLI
npm install -g supabase
# Init (if not already done)
supabase init
# Start local Postgres + Auth
supabase start
# Apply the migration
supabase db push
# The CLI will print your local URL + anon key — put these in .env.local
npx supabase gen types typescript \
--project-id your-project-ref \
> src/types/database.ts
# 1. Install dependencies
npm install
# 2. Install shadcn/ui + add required components
npx shadcn@latest init
npx shadcn@latest add button card input label select badge separator toast switch
# 3. Run the dev server
npm run dev
# → Open http://localhost:3000
shredos/
├── .env.example
├── .gitignore
├── components.json # shadcn/ui config
├── next.config.ts
├── package.json
├── postcss.config.js
├── tailwind.config.ts
├── tsconfig.json
│
├── supabase/
│ └── migrations/
│ └── 001_phase1a_schema.sql
│
└── src/
├── middleware.ts # session refresh + protected route guard
│
├── app/
│ ├── globals.css
│ ├── layout.tsx # root layout, dark mode
│ ├── (auth)/
│ │ ├── login/page.tsx
│ │ └── auth/callback/route.ts
│ ├── (app)/
│ │ ├── layout.tsx # app shell (sidebar + topbar)
│ │ ├── dashboard/page.tsx
│ │ ├── onboarding/page.tsx
│ │ ├── profile/page.tsx
│ │ ├── weigh-in/page.tsx
│ │ ├── nutrition/page.tsx
│ │ ├── fasting/page.tsx
│ │ └── decisions/page.tsx
│ └── api/
│ ├── auth/signout/route.ts
│ └── decisions/route.ts
│
├── components/
│ ├── layout/
│ │ ├── Sidebar.tsx
│ │ └── TopBar.tsx
│ ├── dashboard/
│ │ ├── WeightCard.tsx
│ │ ├── NutritionCard.tsx
│ │ ├── FastingCard.tsx ← client component (live timer)
│ │ ├── StepsCard.tsx
│ │ ├── WorkoutCard.tsx
│ │ ├── CoachAlertsCard.tsx
│ │ └── DecisionLogCard.tsx
│ ├── onboarding/
│ │ ├── OnboardingWizard.tsx
│ │ ├── Step1Bio.tsx
│ │ ├── Step2Goals.tsx
│ │ ├── Step3Schedule.tsx
│ │ └── Step4Nutrition.tsx
│ ├── weigh-in/
│ │ ├── WeighInForm.tsx
│ │ └── WeighInHistory.tsx
│ ├── fasting/
│ │ ├── FastingTimer.tsx
│ │ ├── FastingControls.tsx
│ │ ├── FastingHistory.tsx
│ │ └── FastingStats.tsx
│ └── decisions/
│ ├── DecisionCard.tsx
│ └── DecisionList.tsx
│
├── lib/
│ ├── constants.ts # PROTECTED_ROUTES, isProtectedRoute(), app constants
│ ├── utils.ts # cn() for shadcn
│ ├── units.ts # lbsToKg, kgToLbs, feetInchesToCm, calculateBMI
│ ├── nutrition.ts # calculateNutritionTargets() — sex-aware + carb guardrail
│ ├── weighIn.ts # getTrendConfidence(), getNextWeighInDate()
│ ├── fasting.ts # getFastingDuration(), milestones, weekStats
│ ├── dates.ts # formatDate helpers
│ └── supabase/
│ ├── client.ts
│ ├── server.ts # + convenience fetch helpers
│ └── middleware.ts # updateSession()
│
├── types/
│ ├── database.ts # TypeScript types matching schema
│ └── app.ts # App-level types
│
└── hooks/
├── useProfile.ts
├── useWeighIns.ts
├── useFasting.ts
├── useNutritionTargets.ts
└── useDecisions.ts
All five user-owned tables have Row Level Security enabled. Every policy uses auth.uid().
| Table | Policy strategy |
|---|---|
user_profiles | Explicit SELECT / INSERT / UPDATE / DELETE — one policy per operation |
body_metrics | FOR ALL — same user_id check covers all operations |
nutrition_targets | FOR ALL |
fasting_logs | FOR ALL |
decision_logs | FOR ALL |
Unauthenticated requests return empty arrays (not errors). The anon key is safe to expose because RLS prevents any cross-user data access.
All weights stored in kg, heights in cm. Displayed as lbs / ft-in via units.ts. This prevents rounding drift from repeated conversions.
Not a generated column. Height is in user_profiles; weight is in body_metrics. Call calculateBMI(weightKg, heightCm) from units.ts. A Postgres view can be added later for analytics.
calculateNutritionTargets() in lib/nutrition.ts warns if carbs fall below 75g/day after protein and fat allocation. Returns a warnings array and a low_carb_warning boolean. Does not block save.
duration_minutes is not in the database. Calculated in lib/fasting.ts from started_at / ended_at. The live timer in FastingTimer.tsx uses setInterval to tick every second client-side.
CREATE UNIQUE INDEX fasting_logs_one_active_fast_per_user
ON fasting_logs (user_id) WHERE ended_at IS NULL;
The app also checks before starting, but the DB is the final guard. Error code 23505 is caught and surfaces "You already have an active fast."
Every target change (calorie edit, step goal change, fasting goal change, weigh-in cadence change) creates a decision_logs row. Status lifecycle: suggested → accepted / dismissed → applied / reversed.
Default cadence: weekly / Friday / morning. Dashboard shows trend confidence (none → low → medium → high). No recommendations below medium. Strong recommendations only at high (4+ weigh-ins for weekly cadence).
| Feature | Phase |
|---|---|
| Food logging (manual macro entry) | 1B |
| Food label photo import | 2C |
| Natural-language food math | 2C |
| Workout planner + lift log | 1C |
| Exercise library | 1C |
| Running plans + sessions | 2B |
| Claude API coaching | 2A |
| Progress charts | 2A |
| Wearable sync | 3 |
| Push notifications | 3 |
| Barcode scanner | 3 |
Work through this list before starting Phase 1B.
/dashboard → redirects to /login/weigh-in, /nutrition, /fasting, /decisions, /profile, /onboarding → all redirect to /login/onboarding/dashboard/loginonboarding_complete = true written to user_profiles on confirmnutrition_targets row written with today's effective_datedecision_logs entry created for onboarding completion (decision_type = nutrition_targets_set, status = applied)WeightCard shows latest weigh-in in lbsWeightCard shows next weigh-in date for weekly/Friday cadenceWeightCard shows trend confidence badgenone with 0 entries, low with 1, medium with 2–3, high with 4+calculateNutritionTargets() for sedentary 185lb user:
/nutrition pagenutrition_targets row with today's effective_datedecision_log entry (nutrition_targets_updated, status = applied)NutritionCard shows correct current targetslow_carb_warning = true shown as amber warning on NutritionCardfasting_logs row with started_at = now, ended_at = nullFastingCard shows live elapsed time (updating every second)FastingTimer shows current milestone note at ≥12h, ≥16h, ≥18h, ≥24hended_at = null directly in Supabase SQL editor → receives error (unique index)23505 and shows: "You already have an active fast."ended_at = now, calculates completed_goal correctlyduration_minutes is NOT a column in fasting_logs (check schema)/fasting/decisions page shows all entries, newest firstsuggested) entries have Accept/Dismiss buttonsstatus = accepted, applied_at = nowstatus = dismissedCoachAlertsCard shows pending decisionsDecisionLogCard shows the most recent entryfasting_logs has no duration_minutes column (confirm in schema)food_items, food_logs, etc.)food_item_id FK to a future food log tablenutrition_targets notes field has no assumptions about food logging formatQueryClientProvider. The dashboard and most pages use server components with server.ts fetches instead. To use hooks in client components, wrap src/app/layout.tsx with a QueryClientProvider.NutritionCard shows targets only. Progress bars are static placeholders.StepsCard shows goal only. Manual entry and wearable sync are deferred.CoachAlertsCard shows any suggested decisions but the system does not yet auto-generate recommendations from trend data. Decisions are generated manually on profile changes.For testers on the live deployment. Work through in order.
/loginDo these in addition to the Buddy tester script above before relying on buddy feedback. Use one browser session for your real account and a separate private/incognito window for a fresh test account, so neither session affects the other.
/ → confirm redirect to /login/ → confirm redirect to /dashboard/login directly → confirm it bounces to
/dashboard rather than showing the login formfood_logs,
workout_sessions, saved_meals, and daily_activity_logs —
not just the Phase 1A tables/dashboard colliding with Safari's stricter
history.replaceState rate limit after auth/onboarding state
changes — not a missing onboarding check. Fixed by switching both
the onboarding-completion and password-sign-in success navigations
to window.location.assign('/dashboard') (a full document
navigation), in OnboardingWizard.tsx and login/page.tsx. See
phase1v-auth-onboarding-navigation-stable.food_logs,
saved_meals, workout_sessions, workout_exercises,
workout_sets, workout_routines, and daily_activity_logs have no
documented RLS status in this README. Needs a direct check in the
Supabase dashboard.Status: planned, not started. Build only after buddy testing confirms core flows work. This is a full design-system phase (components, layout rules, spacing, tokens, mobile-first behavior) — not a cosmetic CSS-only patch.