Commit 33d8f93
Add Phase 5 Svelte dashboard on Cloudflare Pages (#4)
* Add Phase 5 Svelte dashboard on Cloudflare Pages
SvelteKit 5 app in dashboard/ with SSR load functions that forward the
Cf-Access-Jwt-Assertion header server-side so the token never reaches
browser JS. uPlot sparklines on the overview cards, full trend charts
on the drill-in page with metric selector and branch input.
Cloudflare Pages build settings: root=dashboard, output=.svelte-kit/cloudflare.
Configure WORKER_URL env var in Pages dashboard before deploying.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix dashboard API redirect handling and scope wrangler config
- api.ts: add redirect:'manual' to all Worker fetch calls so that
Cloudflare Access login redirects (302) surface as HTTP errors
instead of silently returning HTML that breaks JSON.parse
- Add dashboard/wrangler.toml so the adapter-cloudflare dev server
stops walking up to the root wrangler.jsonc (which was injecting
the Worker's WORKER_URL env var into the dashboard process)
- Update .gitignore to cover .dev.vars; update .env.example to
document both Vite (.env) and wrangler (.dev.vars) dev patterns
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Add local dev bypass for Cloudflare Access + Service Token plan
Worker:
- src/types.ts: add optional DEV_BYPASS_SECRET to Bindings
- src/middleware/access.ts: if DEV_BYPASS_SECRET is set and the request
carries a matching X-Dev-Bypass header, skip JWT verification; the
guard is dead code in production where the env var is never set
- .dev.vars.example: document DEV_BYPASS_SECRET with a warning
Dashboard:
- api.ts: add optional extraHeaders param to fetchProjects/fetchTrend
- +page.server.ts (both routes): read DEV_BYPASS_SECRET from env and
pass X-Dev-Bypass when set; no-op in production
- .env.example: document both WORKER_URL and DEV_BYPASS_SECRET
Docs:
- docs/plans/service-auth-token.md: future refactor to replace bypass +
JWT forwarding with Cloudflare Access Service Tokens
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Add local D1 seed script and mark Phase 5 as implemented
- test/seed-local.sql: inserts a test owner, project, and 15+4 metric
data points for local development against wrangler d1 --local
- package.json: add db:seed:local script (npx wrangler d1 execute)
- docs/PROGRESS.md: update Phase 5 from "Not started" to "Implemented –
pending Pages deployment", listing what's done vs. still outstanding
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Add dashboard CI deploy workflow via Cloudflare Pages Direct Upload
- .github/workflows/deploy-dashboard.yml: builds and deploys the
dashboard on push to main (production) and on PRs (preview branch),
path-filtered to dashboard/** so unrelated changes don't trigger it
- dashboard/package.json: add wrangler ^4.104.0 as devDependency so
the workflow resolves it from node_modules after npm ci
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Document dashboard deployment in INSTALLATION.md (step 14)
Covers: Pages project creation, WORKER_URL secret, GitHub Actions
secrets, Access application, and the "run from dashboard/ dir" note
to avoid the wrangler pages_build_output_dir warning.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix INSTALLATION.md: wrangler pages warning is unavoidable, not a cd issue
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Convert dashboard/wrangler.toml to wrangler.jsonc, unignore it
The root .gitignore blanket-ignores wrangler.jsonc to protect the
Worker's secrets. Add !dashboard/wrangler.jsonc to allow the Pages
config to be committed. This suppresses the spurious "missing
pages_build_output_dir" warning on wrangler pages commands (wrangler
finds the .jsonc before walking up to the root wrangler.jsonc).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Remove stale wrangler pages warning note from INSTALLATION.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Add nodejs_compat flag to dashboard Pages config
SvelteKit uses node:async_hooks internally; without nodejs_compat the
Pages worker throws at runtime.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix deploy: remove wrangler from dashboard deps, install v4 in CI
@sveltejs/adapter-cloudflare@4.x declares a peer dep on wrangler@^3;
having wrangler@^4 in devDependencies caused an ERESOLVE conflict on
npm ci. Remove it from package.json and install wrangler@^4 globally
as a dedicated CI step before the deploy, keeping peer deps clean.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 43843c8 commit 33d8f93
30 files changed
Lines changed: 4817 additions & 7 deletions
File tree
- .github/workflows
- dashboard
- src
- lib
- components
- routes
- [owner]/[repo]
- static
- docs
- plans
- src
- middleware
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
0 commit comments