diff --git a/docs/adr/0029-web-surface-frontend-backend-separation.md b/docs/adr/0029-web-surface-frontend-backend-separation.md new file mode 100644 index 0000000..5022ab1 --- /dev/null +++ b/docs/adr/0029-web-surface-frontend-backend-separation.md @@ -0,0 +1,132 @@ +# ADR 0029: Web Surfaces Are Static SPAs; the Hub Serves JSON Only + +## Status + +Accepted. + +## Context + +The Hub exposes three browser surfaces: the org-admin console (`/admin`), the +teacher-facing file library (`/app`), and the database admin back office +(`/database`). They arrived at different times and diverged in how HTML reached +the browser. + +`/admin` and `/app` were already separated: the backend serves a prebuilt static +`index.html` and never inspects the request; all data flows through JSON +endpoints. `/database` was not. Roughly 1770 lines across four modules +(`renderDashboard`/`renderLoginPage` in `routes/databaseRoutes.ts`, +`routes/adminPanels.ts`, `routes/libraryBrowser.ts`, `routes/libraryPage.ts`) +assembled HTML template strings server-side, reading the session cookie and +querying Prisma inside the page handler, with layout expressed as inline +`style="…"` attributes and behavior as `