Session lifecycle, public rules API, web vitals RUM, ops docs, and project guidelines #47
Reference in New Issue
Block a user
Delete Branch "adilallo/feature/BackendImplementation5"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
This PR continues backend and platform work: a clearer API error contract and shared helpers (
apiRoute,requestId, response helpers), custom session lifecycle across auth routes (magic link, session, logout, drafts), a public marketing rule detail page and related rules API behavior, and web vitals changes that favor external RUM with a refactored admin monitor dashboard and local storage plumbing where appropriate. It also adds operational documentation (Cloudron/backend deploy), CI for a Postgres migration smoke job, a session prune script, and a repo-wide Cursor rule (Karpathy-style coding guidelines) plus a small api-routes rule update. Docs (backend tickets, roadmap, relaunch brief) are refreshed to match the current plan.Changes
drafts/meupdated for consistent session handling;lib/server/session.tsandscripts/prune-sessions.tsfor lifecycle maintenance.lib/server/apiRoute.ts,requestId, extendedresponses.tsfor structured errors; rules and drafts routes aligned;app/api/web-vitals/route.tsand validation/store/mode underlib/server/webVitals/.app/(marketing)/rules/[id]/page.tsxfor public rule detail;lib/server/publishedRules.tsand related API routes.MonitorPageContentsplit from monitor page; Web Vitals dashboard container/types/view and message files updated..env.exampleupdates for new/related settings..gitea/workflows/migrate-smoke.yamlfor migration smoke against Postgres.docs/guides/ops-backend-deploy.md(new), updates tobackend-linear-tickets,backend-roadmap,docs/relaunch-brief.md,docs/README.md,CONTRIBUTING.md..cursor/rules/coding-guidelines.mdc(always-apply behavioral guidelines);.cursor/rules/api-routes.mdcupdated.apiRoute,requestId,responses,draftsMe,rulesById, session lifecycle, web vitals schema/mode, etc.Screenshots
How to Test
CONTRIBUTING.md; copy.env.example→.envand set values needed for auth, DB, and web vitals as documented.npx tsc --noEmitnpx vitest runnpx next builddrafts/me; open a published rule on the marketing rule detail URL; in admin, open Monitor and confirm Web Vitals dashboard behavior and copy (no hardcoded user-visible strings outsidemessages/).Notes
BackendImplementation5); call out if this should merge before/after related backend tickets.coding-guidelines.mdcautomatically (alwaysApply: true); no change toAGENTS.mdunless you want it cross-linked.NEXT_PUBLIC_ENABLE_BACKEND_SYNCor legacy create-flow scaffolding remains per existing project policy (do not remove without an explicit request).