Switch pal-e-app to adapter-static + nginx #53

Closed
opened 2026-03-27 00:22:41 +00:00 by forgejo_admin · 1 comment

Type

Feature

Lineage

Depends on forgejo_admin/pal-e-app#52 (auth + data fetching must be client-side first).

Repo

forgejo_admin/pal-e-app

User Story

As pal-e-app
I want to build to static files served by nginx
So that I follow the platform SvelteKit convention and am Capacitor-ready

Context

Once auth and data fetching are client-side (issue #52), pal-e-app no longer needs a Node.js runtime. It can switch to adapter-static and be served by nginx — matching the mcd-tracker-app pattern. This makes pal-e-app Capacitor-ready for future mobile deployment and reduces resource usage (nginx alpine vs Node.js).

Blocker: This ticket literally cannot succeed until #52 is complete. The codebase currently has 14 +page.server.ts files, 3 +server.ts API routes, hooks.server.ts, and src/auth.ts — all using server-only imports ($env/dynamic/private, @auth/sveltekit). adapter-static will fail to build with any of these present.

Scope clarification: @auth/sveltekit removal is handled by #52, not this ticket. By the time this ticket starts, all server-only code should already be gone.

File Targets

Files to modify:

  • svelte.config.js — switch adapter-node to adapter-static with fallback: 'index.html'
  • Dockerfile — replace Node.js multi-stage with nginx pattern (match ~/mcd-tracker-app/Dockerfile)
  • k8s/deployment.yaml — remove pal-e-auth-secrets secretRef, remove PAL_E_DOCS_API_URL env, remove PAL_E_DOCS_API_KEY env, update containerPort 3000 → 80, update probes for nginx
  • package.json — swap @sveltejs/adapter-node for @sveltejs/adapter-static

Files to remove:

  • k8s/pal-e-auth-secrets.enc.yaml — no server secrets needed

Files the agent should NOT touch:

  • src/ routes or components — those were handled in issue #52
  • Woodpecker CI config — should work as-is since build command doesn't change

Acceptance Criteria

  • npm run build produces static files in build/ directory
  • No $env/dynamic/private imports remain (verified by grep)
  • Dockerfile builds nginx image that serves the SPA
  • SPA fallback works (direct URL navigation to any route returns index.html)
  • k8s deployment has no secrets or server env vars
  • ArgoCD syncs successfully with new image
  • All existing routes work in production (nginx serves, client-side routing handles)

Test Expectations

  • Build: npm run build succeeds with adapter-static
  • Docker: docker build . produces working image
  • E2E: all existing E2E tests pass against nginx-served build
  • Run command: npm run build && npm run test:e2e

Constraints

  • Match mcd-tracker-app Dockerfile pattern exactly (nginx:alpine, SPA fallback config)
  • adapter-static fallback must be 'index.html' for SPA client-side routing
  • Harbor image path stays harbor.tail5b443a.ts.net/pal-e-app/app
  • Keep deployment in-repo k8s/ (not moving to pal-e-deployments in this ticket)
  • All @auth/sveltekit and server-only code removal is out of scope (handled by #52)

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • forgejo_admin/pal-e-app#52 — hard prerequisite (client-side auth + data)
  • forgejo_admin/pal-e-app#51 — convention spec
  • project-pal-e-docs — pal-e-app is the frontend
  • convention-sveltekit-spa — the spec this follows
### Type Feature ### Lineage Depends on `forgejo_admin/pal-e-app#52` (auth + data fetching must be client-side first). ### Repo `forgejo_admin/pal-e-app` ### User Story As pal-e-app I want to build to static files served by nginx So that I follow the platform SvelteKit convention and am Capacitor-ready ### Context Once auth and data fetching are client-side (issue #52), pal-e-app no longer needs a Node.js runtime. It can switch to adapter-static and be served by nginx — matching the mcd-tracker-app pattern. This makes pal-e-app Capacitor-ready for future mobile deployment and reduces resource usage (nginx alpine vs Node.js). **Blocker:** This ticket literally cannot succeed until #52 is complete. The codebase currently has 14 `+page.server.ts` files, 3 `+server.ts` API routes, `hooks.server.ts`, and `src/auth.ts` — all using server-only imports (`$env/dynamic/private`, `@auth/sveltekit`). adapter-static will fail to build with any of these present. **Scope clarification:** `@auth/sveltekit` removal is handled by #52, not this ticket. By the time this ticket starts, all server-only code should already be gone. ### File Targets Files to modify: - `svelte.config.js` — switch adapter-node to adapter-static with fallback: 'index.html' - `Dockerfile` — replace Node.js multi-stage with nginx pattern (match ~/mcd-tracker-app/Dockerfile) - `k8s/deployment.yaml` — remove pal-e-auth-secrets secretRef, remove PAL_E_DOCS_API_URL env, remove PAL_E_DOCS_API_KEY env, update containerPort 3000 → 80, update probes for nginx - `package.json` — swap @sveltejs/adapter-node for @sveltejs/adapter-static Files to remove: - `k8s/pal-e-auth-secrets.enc.yaml` — no server secrets needed Files the agent should NOT touch: - `src/` routes or components — those were handled in issue #52 - Woodpecker CI config — should work as-is since build command doesn't change ### Acceptance Criteria - [ ] `npm run build` produces static files in `build/` directory - [ ] No `$env/dynamic/private` imports remain (verified by grep) - [ ] Dockerfile builds nginx image that serves the SPA - [ ] SPA fallback works (direct URL navigation to any route returns index.html) - [ ] k8s deployment has no secrets or server env vars - [ ] ArgoCD syncs successfully with new image - [ ] All existing routes work in production (nginx serves, client-side routing handles) ### Test Expectations - [ ] Build: `npm run build` succeeds with adapter-static - [ ] Docker: `docker build .` produces working image - [ ] E2E: all existing E2E tests pass against nginx-served build - Run command: `npm run build && npm run test:e2e` ### Constraints - Match mcd-tracker-app Dockerfile pattern exactly (nginx:alpine, SPA fallback config) - adapter-static fallback must be 'index.html' for SPA client-side routing - Harbor image path stays `harbor.tail5b443a.ts.net/pal-e-app/app` - Keep deployment in-repo k8s/ (not moving to pal-e-deployments in this ticket) - All @auth/sveltekit and server-only code removal is out of scope (handled by #52) ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - `forgejo_admin/pal-e-app#52` — hard prerequisite (client-side auth + data) - `forgejo_admin/pal-e-app#51` — convention spec - `project-pal-e-docs` — pal-e-app is the frontend - `convention-sveltekit-spa` — the spec this follows
Author
Owner

Scope Review: NEEDS_REFINEMENT

Review note: review-414-2026-03-26
Ticket is well-structured with all template sections present and all file targets verified, but has three issues blocking READY status.

  • Wrong Lineage reference: Says #2 (closed scaffold issue) but actual dependency is #52 (client-side auth migration, open/backlog)
  • Missing blocker annotation: 14 +page.server.ts files, 3 +server.ts API routes, hooks.server.ts, and auth.ts all use server-only code. Ticket cannot execute until #52 removes all server-side code.
  • package.json scope ambiguity: @auth/sveltekit is in dependencies -- unclear if this ticket or #52 removes it
## Scope Review: NEEDS_REFINEMENT Review note: `review-414-2026-03-26` Ticket is well-structured with all template sections present and all file targets verified, but has three issues blocking READY status. - **Wrong Lineage reference**: Says `#2` (closed scaffold issue) but actual dependency is `#52` (client-side auth migration, open/backlog) - **Missing blocker annotation**: 14 +page.server.ts files, 3 +server.ts API routes, hooks.server.ts, and auth.ts all use server-only code. Ticket cannot execute until #52 removes all server-side code. - **package.json scope ambiguity**: @auth/sveltekit is in dependencies -- unclear if this ticket or #52 removes it
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo_admin/pal-e-docs-app#53
No description provided.