Commit Graph
12 Commits
Author SHA1 Message Date
CatoandClaude Opus 5.5 5ea4dab4fa fix(copy): every public claim matches the code — contact, legal, pricing, pros, 9 locales (#106)
* fix(copy): contact mail goes to a mailbox that exists

hello@ and support@petvity.com sat on the footer, every legal page, the
structured data and every email template. petvity.com is not ours (it is a
Netlify site with Zoho MX; lib/config/email.ts already lists it as "not
ours"), so privacy and support mail went to a stranger. APP.email is now
cato@orangecat.ch, the one address on the receiving apex, and supportEmail
is folded into it. lib/config/app.test.ts fails if it leaves the apex.

The pet-edit form also showed "petvity.com/pets/" as the share prefix; it
now derives the host from APP_URL.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(copy): privacy and cookie policies describe the running system

Privacy: Neon was decommissioned in 2026-06 (the database is PostgreSQL on
the same Hetzner box, listening on 127.0.0.1 only), Google sign-in is not
configured in production while OrangeCat sign-in is, groomers and guest
checkout were missing, and "database connections use TLS" did not hold for
a localhost connection.

Cookies: Auth.js v5 sets authjs.* cookies, not next-auth.*, plus PKCE/state
cookies during OrangeCat sign-in; NEXT_LOCALE is a session cookie set on any
locale page, not a one-year cookie set only by the switcher.

Effective dates moved to October 2, 2026.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(copy): marketing pages say only what the product does, in all 9 languages

- pricing: Pro and Clinic cards cut. Their buttons were href="#", neither
  plan is on ROADMAP.md, yet the FAQ called them "next".
- pros: cut vets reading clients' health history and sitters logging health
  during stays (records are owner-scoped; "Vet-facing records" is 0% on the
  roadmap), the unmeasured "growing community" card, and a sitter card that
  repeated its heading. Reviews tie to completed bookings, not confirmed ones.
- features: no refill tracking exists; charts span 30 days, not months; the
  twin is not built from 30 days on the dashboard (7); unverified pros are
  listed; cross-border adoption and "any language" were not true; handle host
  is the live one; groomers added.
- about: the "Behind the project" section was empty in 4 locales and claimed
  "a team of software engineers" in 5; cut.
- ar/ja/ko/tr/zh: the features, pricing, pros and about pages carried an
  older, differently ordered copy (stats swapped, "data export coming soon",
  "VitaReba"); retranslated from the current English.
- CHANGELOG: removed "health metrics that matter per species" (the
  observations config is not wired into any screen) and the Stripe claim;
  added 2026-10-02. ROADMAP: OrangeCat sign-in shipped, Google item dropped.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(copy): close the gaps the verifier found, in all 9 languages

- Cookie policy names both ways NEXT_LOCALE is set: a session cookie per
  page, one year when picked with the language switcher.
- Privacy policy lists the Loki feedback widget as a service provider.
- /pros no longer says owners share pet records or Digital Twin data with
  vets and sitters (a booking shows them only the pet's name): rewrote
  metaDesc, heroDesc, vet/sitter hero copy; cut vb1 ("months of structured
  health history"); dropped 72 unrendered pros keys that still shipped the
  same claims in every page's message payload.
- Cut unmeasured timings: home heroSub ("30-second check-in"),
  benefitTrackDesc ("in 30 seconds"), "set up in minutes", "a few minutes".
- Species guide CTA: a record to show your vet, not one shared with them.
- ROADMAP/CHANGELOG: email+password sign-up still works for new users;
  changelog line lists what was cut instead of claiming all copy is true.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(copy): privacy names what an OrangeCat sign-in stores; drop a dead features key

- Privacy, "Data we collect": an OrangeCat sign-in also stores the name and
  profile picture from the OrangeCat account (accountkit's orangecatProfile
  maps name and picture onto users.name and users.image), not only the id.
- features.heroSubtitle is rendered nowhere but still shipped in every page's
  message payload, carrying "cross-border adoption" and "in any language" —
  both cut elsewhere in this PR. Removed from all nine locales.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-29 17:45:53 +01:00
Cato b9c4899ee7 feat(auth): one password rule from accountkit (non-empty, up to 128); no local minimum or hint text (#123) 2026-10-28 03:53:21 +01:00
Cato 6a3044927b feat(auth): password recovery uses the shared accountkit form (#122)
Forgot/reset pages render PasswordRecoveryForm from @bitbaum/accountkit 0.8.1
through a small adapter over Petvity's own routes, so users, bcrypt passwords,
roles and Auth.js sessions are untouched. The hand-written pages could stay
stuck after a network error; the shared form leaves its busy state and says so.
The reset route now answers an invalid link with code INVALID_TOKEN.
2026-10-28 01:29:57 +01:00
CatoandClaude Opus 5.5 3209d7d74b refactor(auth): OrangeCat sign-in through @bitbaum/accountkit; no reset link for an OrangeCat-created account (#108)
lib/auth/orangecat.ts (provider, profile without email, placeholder email,
the sub-keyed adapter wrapper) moves to @bitbaum/accountkit/orangecat v0.2.1,
which took it as one of its sources; its tests went with it. The
ADMIN_EMAILS guard is accountkit's emailEarnsPromotion.

Fixes a gap: forgot-password emailed a reset link to an account OrangeCat
had created. That address came from OrangeCat unverified, so the link would
have given whoever owns it a password on the OrangeCat person's account.
It now gets the same generic answer (mayReceivePasswordReset); a person
with a password of their own can still reset it. Two route tests.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 05:19:24 -07:00
GandClaude Opus 5 c65ac4b7d7 chore: add a formatter (#71)
* chore: add a formatter, matching the style this repo already writes

singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.

Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* style: format with prettier (252 files)

Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore: teach git blame to skip the reformat

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-29 10:05:01 +00:00
GandClaude Fable 5 e9b48a84a9 feat(auth): no-account demo access + honest password-reset failures (#16)
A real user (Manuel) got locked out: wrong password 3×, and the
forgot-password flow answered 'success' while prod had no
RESEND_API_KEY — the reset email silently never sent. Two fixes:

1. Forgot-password now returns 503 with a support address for EVERY
   request when email is unconfigured (uniform before any user lookup,
   so it stays enumeration-safe). No more silent lockouts.

2. 'Explore the demo — no account needed' on the login page signs
   visitors into a shared, seeded demo account (Luna the Golden
   Retriever: 30 days of check-ins, vaccinations, medication, records —
   charts and digital twin look alive). The account can't be locked
   out: password changes and resets are refused for it, and the
   CRON_SECRET-gated /api/cron/reset-demo wipes and reseeds it daily
   (user-row delete cascades every drive-by edit).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-07 20:28:29 +00:00
GandClaude Opus 4.8 f79ae9772d chore(infra): remove Vercel references — self-hosted now (#8)
Vercel is decommissioned; petvity runs self-hosted on the Hetzner box
behind Caddy at petvity.orangecat.ch. Repoint every current-setup Vercel
reference to that reality:

- Remove vercel.json (Vercel Cron is gone; CLAUDE.md cron table is the
  schedule SSOT, driven by host cron/systemd timers).
- Privacy page: Vercel hosting -> Hetzner; drop "Vercel Blob" vendor
  (avatars now on local disk, not a third party).
- Cookies page: drop the Vercel Analytics claim (no analytics package is
  installed) -> state no third-party analytics.
- FAQ (de/en/es/fr): "Vercel's global edge infrastructure" -> self-hosted
  European infrastructure.
- schema.ts / avatar route / forgot-password: comments no longer say
  "Vercel Blob"/"Vercel logs".
- .gitignore: drop the .vercel ignore.

Kept: lib/storage.ts "replaces @vercel/blob" narrative and the CLAUDE.md
"there is no Vercel Cron" guardrail. Lockfile transitive deps untouched.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 21:51:16 +02:00
g-butandClaude Opus 4.7 dd0599bdec feat(i18n): translate all email templates into 9 locales
- lib/email/i18n.ts: new SSOT with locale-keyed strings for every email
  template (ownerWelcome/AddPet/HealthTracking/WeekOne, passwordReset,
  petHealthAlert, vaccinationReminder, medicationEndingReminder,
  bookingReminder, bookingRequestReceived, bookingStatusChanged,
  orderConfirmation, orderStatusUpdate, sellerOrderNotification,
  adoptionApplicationReceived, adoptionApplicationStatusChanged) in all
  9 locales (en de fr es ja zh ko tr ar). Arabic sets dir=rtl; base()
  injects lang/dir on <html> and rtl inline styles for Arabic.
- lib/email/templates.ts: all template functions accept locale? and
  delegate to getEmailStrings(); t() handles {{key}} interpolation.
- Cron routes: cron/emails now fetches users.locale; cron/health-alerts
  adds locale to owner query; vaccination/medication/booking reminders
  pass ownerLocale to template calls (was only used for date formatting).
- API routes: all transactional email sends (bookings, orders, adoptions,
  forgot-password) add locale to their user selects and pass to templates.
- lib/email/i18n.test.ts: 12 tests covering locale resolution, RTL flag,
  translation completeness for all 9 locales, bullet count, and t().

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 09:51:18 +02:00
g-butandClaude Sonnet 4.6 c0b0869489 test(api): add integration tests for forgot-password and reset-password
10 new tests: forgot-password (400 missing email, 400 non-string, 200
anti-enumeration when user not found, 200 success); reset-password (400
missing fields, 400 short password, 400 invalid/expired token, 200 success,
404 account-deleted edge case).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 22:14:26 +02:00
g-butandClaude Sonnet 4.6 895af2c1a4 fix(security): prevent token/email leakage in server logs
- forgot-password: only write reset URL to stderr in non-production and
  only when RESEND_API_KEY is absent — prevents token exposure in Vercel
  logs while RESEND is unconfigured (current production state)
- email/index.ts: suppress recipient address from warn log in production;
  keep dev-only stderr notice for missing key
- records/page.tsx: add missing startTransition(router.refresh()) after
  delete (consistent with medications + vaccinations pages)
- CLAUDE.md: correct species count (4, not 10)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 13:52:06 +02:00
g-butandClaude Sonnet 4.6 78b5c8889e feat(auth): password confirm, forgot/reset password flow, welcome email
Registration:
- Add confirm password field with client-side mismatch validation
- Send welcome email immediately on registration (not just queued for cron)

Forgot/reset password:
- POST /api/auth/forgot-password — generates secure token (crypto.randomBytes),
  stores in verification_tokens table, sends reset email via Resend
- POST /api/auth/reset-password — validates token, updates bcrypt password,
  consumes token (one-time use)
- /forgot-password page: email form + inbox-check success state
- /reset-password page: token from URL, password + confirm fields, success state
- Dev fallback: logs reset URL to console when RESEND_API_KEY is not set

Email:
- sendEmail() now gracefully handles missing RESEND_API_KEY (logs warning,
  returns { sent: false }) instead of throwing — prevents registration crashes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 12:16:38 +02:00
g-butandClaude Sonnet 4.6 ddfb647149 feat: scaffold Petvity — global pet care platform
Full Phase 1 scaffold:
- Next.js 16 + TypeScript strict + Tailwind 4 + Neon/Drizzle + NextAuth 5
- 9-language i18n (EN DE FR ES JA ZH KO TR AR) with RTL support for Arabic
- SSOT config: species (10 types), health metrics (7 KPIs), pet signal system
- DB schema: pets, healthMetrics (unique per pet+day), vaccinations, medications,
  healthRecords, emailQueue
- Numeric storage: weight=grams, temperature=centidegrees (no float drift)
- computePetSignal() — pure domain function, 9 unit tests passing
- API routes: auth, account, pets CRUD, health metrics (upsert), records,
  vaccinations, medications, public pet profiles (no auth)
- Cron: health-alerts, vaccination-reminders, email queue (all Bearer-protected)
- Portal UI: dashboard, pet list, add pet, health tracking, log page, vaccinations
- Public influencer pet profiles at /[locale]/pets/[handle]
- Email templates: welcome sequence, health alert, vaccination reminder

pnpm build ✓  pnpm test ✓ (9/9)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 19:19:52 +02:00