diff --git a/specs/epics/README.md b/specs/epics/README.md index 29155e3..9bc6fc7 100644 --- a/specs/epics/README.md +++ b/specs/epics/README.md @@ -7,5 +7,6 @@ folder is the adoption; the merge creates the epic in the workspace. | Epic | Cluster | Status | What it is | |------|---------|--------|------------| +| [`shadcn-admin/`](./shadcn-admin/) | **SA** | In progress (SA0) | Vercel's Next.js & shadcn/ui Admin Dashboard — Studio Admin — on Cloudflare Workers + Static Assets through OpenNext, inside Workers Free with its fonts self-hosted, and an Orun baseline that instantiates it (SA2) | As-built ≠ intent: what shipped lives in each epic's `IMPLEMENTATION-STATUS.md`. diff --git a/specs/epics/shadcn-admin/IMPLEMENTATION-STATUS.md b/specs/epics/shadcn-admin/IMPLEMENTATION-STATUS.md new file mode 100644 index 0000000..0a0a878 --- /dev/null +++ b/specs/epics/shadcn-admin/IMPLEMENTATION-STATUS.md @@ -0,0 +1,11 @@ +# shadcn-admin — implementation status + +| Milestone | State | Landed | +|---|---|---| +| SA0 — the spec | ✅ | the repository's first commit | +| SA1 — the admin dashboard on Workers | planned | SA-2 | +| SA2 — a baseline | planned | SA-3 | + +## Departures from the upstream template + +Recorded as they land, from SA1 on. diff --git a/specs/epics/shadcn-admin/README.md b/specs/epics/shadcn-admin/README.md new file mode 100644 index 0000000..cdefd02 --- /dev/null +++ b/specs/epics/shadcn-admin/README.md @@ -0,0 +1,34 @@ +# shadcn-admin — Vercel's Next.js & shadcn/ui Admin Dashboard on Cloudflare Workers + +**Studio Admin — the Next.js 16 and shadcn/ui admin dashboard, two dozen +screens over mock data with theme presets and layout controls — built by +OpenNext into one Cloudflare Worker inside Workers Free, its fonts +self-hosted, deployed by Orun to stage and prod on every merge, and the +baseline that makes a copy of it somebody else's in one landing.** + +| | | +|---|---| +| Status | In progress — SA0 on main | +| Upstream | [arhamkhnz/next-shadcn-admin-dashboard](https://github.com/arhamkhnz/next-shadcn-admin-dashboard), at `89f28da` (2026-10-27), MIT | +| Reference | [portfolio-starter-kit](https://github.com/sourceplane/portfolio-starter-kit) — the same scaffolding, tests and bootstrap | +| Key | `SA` | + +## Read in this order + +1. [design.md](design.md) — the template, how each Vercel piece maps to + Cloudflare, the Worker's size, the repository and the build, and the + alternative rejected. +2. [implementation-plan.md](implementation-plan.md) — the milestones and + what each one lands. +3. [risks-and-open-questions.md](risks-and-open-questions.md) — what is not + proven, and what was accepted. +4. [IMPLEMENTATION-STATUS.md](IMPLEMENTATION-STATUS.md) — what shipped, and + every departure from the upstream template. + +## Milestones + +| Milestone | What it lands | Task | +|---|---|---| +| SA0 — the spec | the repository, its intent, CI, tooling and spec index; this doc set | SA-1 | +| SA1 — the admin dashboard on Workers | the template in `apps/web`, built by OpenNext into one Worker; the self-hosted fonts; the origin per environment; `tests/web` | SA-2 | +| SA2 — a baseline | the console card, the build document, the context pack and the baseline's tests | SA-3 | diff --git a/specs/epics/shadcn-admin/design.md b/specs/epics/shadcn-admin/design.md new file mode 100644 index 0000000..a72ae25 --- /dev/null +++ b/specs/epics/shadcn-admin/design.md @@ -0,0 +1,69 @@ +# shadcn-admin — design + +## The template + +[arhamkhnz/next-shadcn-admin-dashboard](https://github.com/arhamkhnz/next-shadcn-admin-dashboard) +(Next.js 16.4 App Router, React 19 with the React Compiler, Tailwind CSS 4, +shadcn/ui on Radix UI, Biome) is Studio Admin, the template Vercel lists as +"Next.js & shadcn/ui Admin Dashboard": a landing page, then two dozen +screens — under `/dashboard` default, CRM, finance, analytics, e-commerce, +products, academy, logistics, infrastructure, file manager, patient +monitoring, productivity, calendar, kanban, tasks, users, roles, invoice and +profile, beside `/chat` and `/mail` — and the auth screens (`/auth/v1`, `/auth/v2`: login, +register). Every screen draws on mock data in its own `_components`; the +auth screens are design only and sign nobody in. A preferences panel picks +a theme preset, a font (17 Google families through `next/font/google`), the +content width, the navbar and the sidebar's variant and collapse, and keeps +them in cookies that the server layout reads, so the dashboards render per +request. It deploys to Vercel with no environment variables. + +## How it maps to Cloudflare + +| Vercel | Here | Why | +|---|---|---| +| Next.js hosting | One Worker built by `@opennextjs/cloudflare` (`output: 'standalone'`), the static-assets incremental cache and `populateCache local` | The landing page, the sitemap and robots are pre-rendered and come from the assets; the dashboards read cookies and render in the Worker; nothing needs a binding | +| `next build` (Turbopack) | `next build --webpack` | Turbopack's per-route server chunks make the Worker 3.32 MiB gzipped, over Workers Free's 3 MiB; webpack's shared chunks make it 2.25 MiB (risk SA-B) | +| `next/font/google` (17 families) | `next/font/local` over each family's `@fontsource-variable` latin variable font, and `geist`'s own files; the same CSS variables | `next/font/google` downloads from Google Fonts at build, which fails on GitHub's runners; the picker and the presets read the variables and do not notice | +| `opengraph-image.png` / `twitter-image.png` (the file convention) | One `public/opengraph-image.png`, named by the root and landing metadata | The convention compiles each PNG into a Worker route: two copies of a 420 KB image, about 0.8 MiB gzipped | +| `metadataBase`, the sitemap and `robots.txt` on the author's domain | `NEXT_PUBLIC_SITE_URL` per environment; `robots.txt` a static route that names the environment's sitemap | A site built from this is not the author's | +| The landing's star count (`revalidate: 3600`) | Fetched once by the build (`force-cache`), for the site's own repository | The static-assets cache is read-only: a revalidation has nowhere to write (risk SA-D) | +| The author's Google Analytics tag | Removed | It reports to the author's property | +| `vercel.json` (a host redirect to the author's domain) | Not carried | The site serves on its own origin | + +## The repository + +portfolio-starter-kit's shape: `apps/web` (type +`cloudflare-workers-assets-turbo`, lane `isolated`) and `tests/web` (type +`turbo-package`, a vitest suite run on the `dev` rung). No infrastructure: +the data is the template's mock data. The site's name is one seam, +`SITE_NAME` in `apps/web/src/config/site.ts`, which the template's +`APP_CONFIG` reads (the page title, the landing header, the copyright, the +social card's alt text); `SOURCE_URL` is the landing's GitHub link and the +repository its star count reads, rewritten to the site's repository. The +template's own lint is Biome, and stays. + +## The build + +`next build --webpack` (the React Compiler, the template's Tailwind +PostCSS), then `opennextjs-cloudflare build --skipBuild` and `populateCache +local`. `repo-blueprint.yaml` is portfolio-starter-kit's: one landing +(`01-product`) places, brands and lands the whole tree, one convergence +builds and deploys stage and prod side by side, and `03-docs` records what +went live. The smoke checks the landing page links the dashboard, the +dashboard renders its sidebar, and `/api/health` is ok. + +## Out of scope + +- Real sign-in behind the auth screens: the template ships them as design. +- A data store behind the screens: the template's data is mock data, and an + owner who wants one adds it. +- The template's other editions (Base UI, React Aria, TanStack Start): the + Radix UI edition on Next.js is the one Vercel lists. + +## The alternative rejected + +**Workers Paid, keeping Turbopack.** Turbopack is the template's default +bundler and Next 16's, and Workers Paid takes a 10 MiB Worker. But a +baseline that asks every site built from it for a paid plan to save a build +flag costs every owner; webpack builds the same pages, the e2e tier checks +every route, and the README says how to go back. diff --git a/specs/epics/shadcn-admin/epic.yaml b/specs/epics/shadcn-admin/epic.yaml new file mode 100644 index 0000000..53f5558 --- /dev/null +++ b/specs/epics/shadcn-admin/epic.yaml @@ -0,0 +1,31 @@ +# The epic's declaration. metadata.name equals the directory name; metadata.key +# is the task-key prefix this epic reserves (SA → SA-1, SA-2, …). Owner, target +# date and health are the platform's — never written here. +apiVersion: orun.io/v1 +kind: Epic +metadata: + name: shadcn-admin + key: SA +spec: + title: "Vercel's Next.js & shadcn/ui Admin Dashboard on Cloudflare Workers" + summary: "Studio Admin — the Next.js 16 and shadcn/ui admin dashboard template, its dashboards, auth screens, theme presets and layout preferences over mock data — runs on Cloudflare Workers + Static Assets through @opennextjs/cloudflare, inside Workers Free, with its fonts self-hosted, inside the Cirrus baseline's repository conventions, and becomes an Orun baseline that takes a new site from nothing to live on stage and prod in one landing." + state: started + milestones: + - name: "SA0 — the spec" + exitCriteria: + - "the repository is born with its intent, CI, tooling and spec index, and this doc set and the task contracts are on main" + tasks: [SA-1] + - name: "SA1 — the admin dashboard on Workers" + exitCriteria: + - "apps/web is the upstream template, built by OpenNext into one Worker with Static Assets; every dashboard, auth screen, the landing page, the sitemap and robots serve from it" + - "the fonts are self-hosted: the build fetches nothing from Google Fonts, and the font picker and theme presets are unchanged" + - "the origin is the environment's: the metadata, the sitemap and robots name no domain of the template author's" + - "`pnpm typecheck`, `pnpm lint`, `pnpm test` and `pnpm build` are green, and the Worker fits Workers Free" + - "the README says how to run, test, preview and deploy it, and how every Vercel piece maps to Cloudflare" + tasks: [SA-2] + - name: "SA2 — a baseline" + exitCriteria: + - "blueprint.yaml (the console card) and repo-blueprint.yaml (the build) take a new site from nothing to live on stage and prod in one landing, then record it" + - "a site built from it carries the site only, renamed throughout to its own name, repository and Worker, with the template's credit intact" + - "Baseline CI is green: contract tests, generated component docs, the blueprint read by the pinned orun, the leak gate, the offline bootstrap and the end-to-end tier" + tasks: [SA-3] diff --git a/specs/epics/shadcn-admin/implementation-plan.md b/specs/epics/shadcn-admin/implementation-plan.md new file mode 100644 index 0000000..95a4b79 --- /dev/null +++ b/specs/epics/shadcn-admin/implementation-plan.md @@ -0,0 +1,46 @@ +# shadcn-admin — implementation plan + +Three milestones, each one reviewed pull request (SA0 is the repository's +first commit), each green before it merges. + +## SA0 — the spec (SA-1) + +The repository is born: `intent.yaml` with the placeholder workspace +`ws_CHANGE_ME`, `ci.yml` (byte for byte turso-starter's, which plans nothing +until the workspace is set), the shared TypeScript configuration, the spec +index, this doc set and the task contracts. + +## SA1 — the admin dashboard on Workers (SA-2) + +- The template's `src/`, `public/`, `media/`, `biome.json`, + `components.json`, `.gitignore` and configuration in `apps/web`; its + dependencies at its lockfile's versions on Next 16.3.8, with + `@opennextjs/cloudflare` and `wrangler`; husky and lint-staged left out. +- `next.config.mjs`: `output: 'standalone'`, the workspace root for the + trace and Turbopack, images unoptimized, the template's React Compiler, + console stripping and `/dashboard` redirect. `open-next.config.ts` with + the static-assets incremental cache; `wrangler.jsonc`. `build` is `next + build --webpack` and OpenNext. +- `src/lib/fonts/registry.ts`: every family through `next/font/local` over + its `@fontsource-variable` package (and `geist`), the same variables. +- `src/config/site.ts` (`SITE_NAME`, `SOURCE_URL`); `APP_CONFIG` reads them + and `NEXT_PUBLIC_SITE_URL`. The social card in `public/`; `robots.txt` a + route; the star count fetched once, for `SOURCE_URL`; the analytics tag + and the author's metadata removed. `/api/health`. +- `component.yaml`: the deploy contract (the origin per environment) and its + smoke. `tests/web`: the identity and seam, the origin, the social card, + the robots and sitemap routes, the health route, the self-hosted fonts. +- The README's "How it maps to Vercel". + +## SA2 — a baseline (SA-3) + +portfolio-starter-kit's machinery, renamed: `blueprint.yaml`, +`repo-blueprint.yaml`, `.baseline/` (identity, the product's README, its +`AGENTS.md`, task contracts), `tooling/rebrand` (the template's repository +names, which spell this baseline's slug, masked as its credit), +`tooling/bootstrap`, `hooks/render-deployment-docs.sh` (probing +`/dashboard/default` and `/api/health`), `docs/phases/`, the context pack, +`testing/` (the leak and placement gates on this tree's files; the e2e tier +building and serving the site and walking every dashboard, the auth screens, +the social card, the fonts, a layout cookie and the routes) and +`baseline.yml` / `tag.yml`. diff --git a/specs/epics/shadcn-admin/risks-and-open-questions.md b/specs/epics/shadcn-admin/risks-and-open-questions.md new file mode 100644 index 0000000..63d5e42 --- /dev/null +++ b/specs/epics/shadcn-admin/risks-and-open-questions.md @@ -0,0 +1,10 @@ +# shadcn-admin — risks and open questions + +| ID | Risk | State | Notes | +|---|---|---|---| +| SA-A | `baseline-v1` is not yet proven live | OPEN | Proven offline in Baseline CI: the offline bootstrap with the blueprint's own hooks, the stage lane's own steps in a staged job tree, the site served by `wrangler dev` and smoke-tested with the component's own command, every dashboard walked. A console bootstrap closes it | +| SA-B | The Worker is 2.25 MiB gzipped; Workers Free stops at 3 MiB | WATCH | Turbopack made it 3.32 MiB; webpack's shared chunks 2.25 MiB. A template upgrade that adds screens or a chart library can cross it: measure with `wrangler deploy --dry-run` on every upgrade. Past 3 MiB, a site needs Workers Paid (10 MiB) | +| SA-C | Next 16.3.8, not 16.4.3 | ACCEPTED | `@opennextjs/cloudflare` 1.20.11 fails every request on Next 16.4.x; every OpenNext starter here is proven on 16.3.8, and the template uses nothing 16.4 adds | +| SA-D | The landing's star count is as fresh as the last deploy | ACCEPTED | Upstream revalidates it hourly; the static-assets cache is read-only, so the build fetches it once (and renders no count when GitHub refuses). The client hook still refreshes it in the browser | +| SA-E | The auth screens sign nobody in | ACCEPTED | They are the template's design-only screens, kept as upstream; the README and the site's `AGENTS.md` say so | +| SA-F | Fonts from `@fontsource-variable`, latin subset | ACCEPTED | Google serves the same families; the Fontsource packages carry the same variable fonts, and the latin subset is what upstream's `subsets: ["latin"]` asked for. Roboto Slab is Apache-2.0, the rest OFL-1.1 | diff --git a/tasks/SA-1.TaskContract.yaml b/tasks/SA-1.TaskContract.yaml new file mode 100644 index 0000000..2bec2d5 --- /dev/null +++ b/tasks/SA-1.TaskContract.yaml @@ -0,0 +1,15 @@ +apiVersion: orun.io/v1 +kind: TaskContract +metadata: + name: SA-1 + title: "The spec" +spec: + goal: The shadcn-admin repository is born with its intent, CI, tooling and spec index, and the shadcn-admin epic — declaration, doc set and task contracts — is on main + affects: + - specs/epics/shadcn-admin + - specs/epics/README.md + - tasks + doneWhen: + - epic.yaml, README, design, implementation plan, risks and status are on main + - the three task contracts exist + gates: [] diff --git a/tasks/SA-2.TaskContract.yaml b/tasks/SA-2.TaskContract.yaml new file mode 100644 index 0000000..2d67013 --- /dev/null +++ b/tasks/SA-2.TaskContract.yaml @@ -0,0 +1,19 @@ +apiVersion: orun.io/v1 +kind: TaskContract +metadata: + name: SA-2 + title: "The admin dashboard on Workers" +spec: + goal: Studio Admin runs on Cloudflare Workers + Static Assets through OpenNext inside Workers Free, its fonts self-hosted and its origin the environment's, and has its tests and a README that says how it maps to Vercel + affects: + - apps/web + - tests/web + - pnpm-lock.yaml + - pnpm-workspace.yaml + - README.md + - .gitignore + doneWhen: + - pnpm typecheck, lint, test and build are green + - wrangler dev serves every route the template has + - the Worker is under Workers Free's 3 MiB gzipped + gates: [] diff --git a/tasks/SA-3.TaskContract.yaml b/tasks/SA-3.TaskContract.yaml new file mode 100644 index 0000000..0adcd2a --- /dev/null +++ b/tasks/SA-3.TaskContract.yaml @@ -0,0 +1,29 @@ +apiVersion: orun.io/v1 +kind: TaskContract +metadata: + name: SA-3 + title: "shadcn-admin becomes an Orun baseline" +spec: + goal: blueprint.yaml and repo-blueprint.yaml take a new admin dashboard from nothing to live on stage and prod in one landing, held by Baseline CI + affects: + - blueprint.yaml + - repo-blueprint.yaml + - BOOTSTRAP.md + - .baseline + - .github/workflows/baseline.yml + - .github/workflows/tag.yml + - ai/context + - docs/phases + - hooks + - testing + - tooling/rebrand + - tooling/bootstrap + - tooling/catalog + - apps/web/docs + - tests/web/docs + - specs/epics/shadcn-admin + - README.md + doneWhen: + - every Baseline CI tier is green + - a site placed from it carries the site only, branded, with the template's credit intact + gates: []