You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Harden the app for production by adding deterministic generation contracts, request rate-limits, and structured logging for observability.
Make generated meal/workout content and date handling robust by validating inputs and using browser-local date keys to avoid UTC drift.
Add CI and Playwright E2E coverage (public and optional authenticated/mock-AI flows) and an environment validation step to prevent secret leakage in logs.
Reconcile and document the Supabase schema and deployment/runbook to enable safe migrations and rollbacks.
Description
Introduces typed domain libraries and validators: app/lib/date.ts, app/lib/generated-plans.ts, app/lib/profile.ts, app/lib/profile-options.ts, and app/lib/auth.ts, plus a generated-compatible app/lib/database.types.ts contract.
Adds observability and safety primitives: structured app/lib/logger.ts, a fixed-window limiter in app/lib/rate-limit.ts, generation guard app/lib/generation-rate-limit.ts, and defensive middleware/error-logging in middleware.ts and Supabase helpers in utils/supabase/*.
Reworks generation and persistence flows to be validated and non-destructive: app/lib/workout-generator.ts and app/protected/profile/meal-plan/action.ts now parse/validate model JSON, support deterministic E2E fixtures, and use upsert semantics; client helpers in app/lib/client-database.ts were updated to use local date keys.
Adds user flows and UX improvements: password recovery and reset pages/actions, auth/confirm improvements, profile form and meal/workout UI changes, NavBar image loading, and global layout fixes.
Adds infra and quality automation: scripts/check-env.mjs, playwright.config.ts, Playwright tests under e2e/, unit tests under tests/, package.json scripts for test, check, and test:e2e, CI workflow .github/workflows/quality.yml, vercel.json security headers, and Supabase migration and preflight SQL under supabase/ with docs/release.md.
Misc: .env.example, .gitignore updates, tsconfig.test.json, ESLint ignores, and package lock updates to include Playwright.
Testing
Ran the local quality gate including npm run env:check, lint and type checking via npm run check, and unit tests via npm test, which completed successfully in the validation run.
Added comprehensive unit tests under tests/ that exercise date handling, schema/validation, generation parsing, rate-limiter behavior, Supabase migration contract, and observability helpers and these test suites passed in the CI-quality workflow.
Configured Playwright E2E runs via npm run test:e2e and the CI workflow (.github/workflows/quality.yml) to run public journeys plus optional authenticated and mocked-AI flows, and the CI job was validated to execute npm run build and npm run test:e2e with failure artifact upload enabled.
When E2E_AUTH_EMAIL and E2E_AUTH_PASSWORD secrets are configured, playwright.config.ts adds the authenticated and mocked-generation projects, and e2e/auth.setup.ts tries to log that user in. In this workflow those tests still run against https://example.supabase.co with test-anon-key, so CI will fail as soon as the optional E2E secrets are added rather than exercising the intended test Supabase project; wire these values from matching Supabase secrets or avoid setting the E2E credentials in this job.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
app/lib/date.ts,app/lib/generated-plans.ts,app/lib/profile.ts,app/lib/profile-options.ts, andapp/lib/auth.ts, plus a generated-compatibleapp/lib/database.types.tscontract.app/lib/logger.ts, a fixed-window limiter inapp/lib/rate-limit.ts, generation guardapp/lib/generation-rate-limit.ts, and defensive middleware/error-logging inmiddleware.tsand Supabase helpers inutils/supabase/*.app/lib/workout-generator.tsandapp/protected/profile/meal-plan/action.tsnow parse/validate model JSON, support deterministic E2E fixtures, and useupsertsemantics; client helpers inapp/lib/client-database.tswere updated to use local date keys.auth/confirmimprovements, profile form and meal/workout UI changes,NavBarimage loading, and global layout fixes.scripts/check-env.mjs,playwright.config.ts, Playwright tests undere2e/, unit tests undertests/,package.jsonscripts fortest,check, andtest:e2e, CI workflow.github/workflows/quality.yml,vercel.jsonsecurity headers, and Supabase migration and preflight SQL undersupabase/withdocs/release.md..env.example,.gitignoreupdates,tsconfig.test.json, ESLint ignores, and package lock updates to include Playwright.Testing
npm run env:check, lint and type checking vianpm run check, and unit tests vianpm test, which completed successfully in the validation run.tests/that exercise date handling, schema/validation, generation parsing, rate-limiter behavior, Supabase migration contract, and observability helpers and these test suites passed in the CI-quality workflow.npm run test:e2eand the CI workflow (.github/workflows/quality.yml) to run public journeys plus optional authenticated and mocked-AI flows, and the CI job was validated to executenpm run buildandnpm run test:e2ewith failure artifact upload enabled.Codex Task