CatoandClaude Opus 5 6fc47ed130 refactor(auth): one field and one submit across the four auth pages
Sign in, register, forgot password and reset password are four views of
essentially one form, and each had written out its own label/input/error block
— seven copies of the same six lines — plus its own submit button.

The block is small, which is exactly why it drifts: it is the kind of thing you
copy without reading. The `htmlFor`/`id` pairing, the error paragraph placed
after the input rather than before it, and the button that disables itself
while submitting are accessibility and double-submit guarantees. They should
hold on all four pages because they are one component, not because four pages
happened to remember.

These are also the only pages a patient meets before they have an account, so
"it behaves slightly differently on the reset page" is a trust problem rather
than a cosmetic one.

app/[locale]/(auth)/AuthFields.tsx now holds AuthField and AuthSubmit; each
page keeps its own translations, layout and links. Markup, classes and copy are
unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012KAn51JHFcTrPeCjZDGXM8
2026-09-15 11:57:32 +02:00
2026-08-29 10:48:01 +00:00
2026-08-29 10:48:01 +00:00
2026-08-29 10:48:01 +00:00
2026-08-29 10:48:01 +00:00

Vita

Clinical patient management platform for Vita GmbH — a metabolic psychiatry and systemic longevity clinic in Zürich. The platform has two parts:

  1. Public marketing site — multilingual (de/en/fr), with the Inflection Edge self-assessment overlay as the primary CTA.
  2. Patient portal + admin panel — authenticated and database-backed: patients at /dashboard, the clinician at /admin.

Stack

  • Next.js 16 (App Router, standalone output) · TypeScript (strict)
  • Tailwind v4 (tokens in app/globals.css, no tailwind.config.*)
  • PostgreSQL (self-hosted) via Drizzle ORM (pg driver)
  • NextAuth 5 (auth) · Resend (transactional email)
  • next-intl (i18n)

Hosting

Self-hosted on the Hetzner box ("bitbaum") behind Caddy, served at https://vitareba.orangecat.ch (vitareba.ch is the intended future domain; it has no DNS yet — see lib/config/company.ts). There is no managed platform — a push to main triggers .github/workflows/deploy.yml, which calls the fleet's reusable selfhost-deploy.yml (in bitbaum/loki): it waits for this commit's CI to go green, builds (standalone output), rsyncs the release to the box, swaps a symlink atomically, restarts the systemd service, and health-checks with auto-rollback. Uploaded documents are stored on local disk and served only through the authenticated route GET /api/documents/[id]/file — nothing serves the uploads directory publicly. Scheduled /api/cron/* jobs run from systemd timers / cron on the box (schedules defined in CLAUDE.md → Cron Jobs).

Getting started

pnpm install
cp env.local.example .env.local   # fill in DATABASE_URL, auth + Resend secrets
pnpm db:push                      # apply the Drizzle schema to your Postgres
pnpm dev                          # http://localhost:3000

Scripts

pnpm dev          # dev server
pnpm build        # production build (standalone)
pnpm start        # serve the production build
pnpm lint         # eslint
pnpm typecheck    # tsc --noEmit
pnpm test         # vitest run
pnpm db:push      # push schema changes to Postgres
pnpm db:generate  # generate migration files
pnpm db:studio    # Drizzle Studio

See CLAUDE.md for architecture, conventions, and the full design-system rules.

Languages
TypeScript 89.1%
CSS 10.2%
JavaScript 0.7%