diff --git a/PROGRESS.md b/PROGRESS.md index 70404df..243417a 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -104,3 +104,6 @@ - Reconciled test DB migration history: aligned checksum for `20251212_agent_billing` and marked `20260310_site_settings` and `20260311_billing_preferences` as applied to stop Prisma errors and surface listings again. - Applied the same agent billing schema to staging/prod DB (`lomavuokraus`) and marked the migration as applied; Prisma status now clean there too. - Deploy script now runs a Prisma migration status preflight using DATABASE_URL from env or in-cluster secret and fails fast on drift before applying manifests. + +## 2026-02-04 — Documentation +- Expanded Logical Architecture doc with a Next.js App Router walkthrough: routing layout, server/client component split, data fetching patterns, mutations, auth middleware, and asset handling. diff --git a/docs/architecture.html b/docs/architecture.html index ac403f4..c01fe8e 100644 --- a/docs/architecture.html +++ b/docs/architecture.html @@ -92,6 +92,16 @@ flowchart LR
session_token), roles.app/; Client Components opt in with "use client" (forms, maps, language toggle). This keeps most data fetching server-side and ships minimal JS.app/; notable paths: app/page.tsx (home), app/browse/page.tsx (search + map), app/listings/[slug]/page.tsx (detail), and admin routes under app/admin. API handlers live in app/api/*/route.ts (REST-like endpoints used by forms and fetch calls).fetch(..., { cache: 'no-store' }) for sensitive pages (profile/admin) and ISR for mostly-read content (listing details + home feed).useRouter().refresh() so the server-rendered data is re-fetched without a full page reload.middleware.ts checks the session cookie early and guards admin/listing edit areas; protected pages also re-validate the session on the server before rendering. The same session util is shared by API handlers to avoid drift./public and cached by Varnish and Next.js. Listing images are streamed through /api/images/:id; the handler sets cache headers while respecting auth where required.