Mobile-first Web-App fuer persoenliches Health-, Ernaehrungs-, Aktivitaets- und Einkaufs-Tracking im Home-Lab-Betrieb. Stack: pnpm Monorepo - Next.js 16 + React 19 + Tailwind (apps/admin) - Hono + tRPC + Better Auth mit 2FA und Passkeys (packages/api) - PostgreSQL + Drizzle ORM (packages/db) - Docker fuer Postgres und pgAdmin. Module: - Auth mit Login, 2FA (TOTP + Backup-Codes), Passkeys und Admin-Recovery - Tagesansicht mit Essen, Trinken, Gewicht, Aktivitaeten und Coach-Hinweisen - Lebensmittelkatalog mit Naehrwerten, Portionen, OCR/Barcode/Open Food Facts - Rezepte mit Live-Naehrwertberechnung und Community-Vorschlaegen - Essensplanung und Wochenbudget mit Sportbonus - Einkaufslisten mit Maerkten und Laufweg-Sortierung - Hellfireclub mit Aktivitaetspunkten und gemeinsamer Aktivitaetsplanung - Wearables-Vorbereitung (Fitbit / Google Fit / Health Connect) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
No EOL
1.1 KiB
SQL
22 lines
No EOL
1.1 KiB
SQL
CREATE TABLE "food_nutrition_sources" (
|
|
"id" text PRIMARY KEY NOT NULL,
|
|
"foodId" text NOT NULL,
|
|
"provider" text NOT NULL,
|
|
"providerFoodId" text,
|
|
"name" text NOT NULL,
|
|
"brand" text,
|
|
"url" text,
|
|
"kcalPer100g" numeric(8, 2) DEFAULT '0' NOT NULL,
|
|
"proteinPer100g" numeric(8, 2) DEFAULT '0' NOT NULL,
|
|
"carbsPer100g" numeric(8, 2) DEFAULT '0' NOT NULL,
|
|
"fatPer100g" numeric(8, 2) DEFAULT '0' NOT NULL,
|
|
"servingG" numeric(8, 2),
|
|
"confidence" integer DEFAULT 70 NOT NULL,
|
|
"raw" jsonb DEFAULT '{}'::jsonb NOT NULL,
|
|
"createdAt" timestamp DEFAULT now() NOT NULL,
|
|
"updatedAt" timestamp DEFAULT now() NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
ALTER TABLE "food_nutrition_sources" ADD CONSTRAINT "food_nutrition_sources_foodId_foods_id_fk" FOREIGN KEY ("foodId") REFERENCES "public"."foods"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
CREATE INDEX "food_nutrition_sources_food_idx" ON "food_nutrition_sources" USING btree ("foodId");--> statement-breakpoint
|
|
CREATE INDEX "food_nutrition_sources_provider_idx" ON "food_nutrition_sources" USING btree ("provider","providerFoodId"); |