Files
CatoandClaude 0b8e9246c6 feat(auth): every way in on AccountKit's own screens (#160)
Vita answers sign-in from AccountKit since today's switch (loki
accountkit-switch.yml). This moves the pages onto AccountKit's screens:
SignInForm, SignUpForm and the recovery form in de/en/fr, AccountPanel on
the profile. Password, passkey, a second factor; the email link and
recovery with mail; OrangeCat and the bitbaum sign-in when their env is set.

What stays Vita's: no delete button (medical records are kept ten years:
accountDeletion: false, and the panel leads to the erasure request); the
name on `users` (ownProfile); the per-account lockout, now a plugin on
AccountKit's sign-in; a new person's users row, profile and welcome
sequence; the role-aware landing. The runtime answers only with
AUTH_RUNTIME=accountkit and is unavailable elsewhere, so it never writes
accounts an import would refuse.

NextAuth, the bridge and Vita's own registration, forgot-, reset- and
change-password routes are gone; AccountKit is the only credential writer.
Production has no Google client and no Google links, so nobody loses a way in.


Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-02 22:44:00 +01:00

2.3 KiB

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)
  • @bitbaum/accountkit (accounts) · Resend (transactional email)
  • next-intl (i18n)

Hosting

Self-hosted on the Hetzner box ("bitbaum") behind Caddy, served at https://vita.orangecat.ch (the old vitareba.orangecat.ch redirects its pages there) (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 AGENTS.md → Cron).

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 AGENTS.md for architecture, conventions, and the full design-system rules.