fix(frontend): serve SPA documents for /vote (Legal return 404) #19

Merged
PlasticDigits merged 1 commit from fix/issue-8-spa-fallback into main 2026-08-29 14:57:46 +00:00
PlasticDigits commented 2026-08-29 14:43:45 +00:00 (Migrated from gitlab.com)

Summary

  • Live https://vote.cl8y.com/vote is a 404 after Legal Accept (full document load of a client-only route). / already returns 200 HTML.
  • Canonical routes are now /, /new, /:id on this dedicated host so Legal return to / works even on a root-only edge. /vote* stay as aliases.
  • Nginx try_files $uri /index.html is the real deep-link fix (O8). Image HEALTHCHECK probes /vote and /new. CI job test:frontend-spa-fallback asserts 200 HTML for app paths and 404 for missing /assets/*.
  • Do not treat this MR as closing #8 until Coolify uses deploy/docker/frontend.nginx.conf (or an equivalent try_files) and live curl -sI https://vote.cl8y.com/vote is 200.

Related: #8 · #7 · #5

Test plan

  • cd frontend && npm test (46) — allowlist, route flatten, prod guards
  • cd frontend && npm run test:e2e (7, 5 workers) — / and /vote* hard navigation
  • sh deploy/docker/test-frontend-spa-fallback.sh — /vote 200 HTML, /assets/missing.js 404, X-Frame-Options: DENY
  • After Coolify picks up this image: curl -sI https://vote.cl8y.com/vote → 200
  • curl -sI https://vote.cl8y.com/new → 200; curl -sI https://vote.cl8y.com/assets/missing.js → 404
  • Terra Legal Accept → return to a rendered list (not 404); wallet still connected
  • EVM Legal Accept → same
  • Hard refresh /vote/new and a proposal URL
  • Disconnected browse of / and /vote still open; connected unsigned still fail-closed
  • Production build still refuses hatch / mnemonic / VITE_* BSC RPC
## Summary - Live `https://vote.cl8y.com/vote` is a **404** after Legal Accept (full document load of a client-only route). `/` already returns 200 HTML. - Canonical routes are now `/`, `/new`, `/:id` on this dedicated host so Legal return to `/` works even on a root-only edge. `/vote*` stay as aliases. - Nginx `try_files $uri /index.html` is the real deep-link fix (O8). Image HEALTHCHECK probes `/vote` and `/new`. CI job `test:frontend-spa-fallback` asserts 200 HTML for app paths and 404 for missing `/assets/*`. - Do **not** treat this MR as closing [#8](https://gitlab.com/PlasticDigits/voting/-/issues/8) until Coolify uses `deploy/docker/frontend.nginx.conf` (or an equivalent `try_files`) and live `curl -sI https://vote.cl8y.com/vote` is 200. Related: #8 · #7 · #5 ## Test plan - [x] `cd frontend && npm test` (46) — allowlist, route flatten, prod guards - [x] `cd frontend && npm run test:e2e` (7, 5 workers) — `/` and `/vote*` hard navigation - [x] `sh deploy/docker/test-frontend-spa-fallback.sh` — `/vote` 200 HTML, `/assets/missing.js` 404, `X-Frame-Options: DENY` - [ ] After Coolify picks up this image: `curl -sI https://vote.cl8y.com/vote` → 200 - [ ] `curl -sI https://vote.cl8y.com/new` → 200; `curl -sI https://vote.cl8y.com/assets/missing.js` → 404 - [ ] Terra Legal Accept → return to a rendered list (not 404); wallet still connected - [ ] EVM Legal Accept → same - [ ] Hard refresh `/vote/new` and a proposal URL - [ ] Disconnected browse of `/` and `/vote` still open; connected unsigned still fail-closed - [ ] Production build still refuses hatch / mnemonic / `VITE_*` BSC RPC
PlasticDigits commented 2026-08-29 14:57:47 +00:00 (Migrated from gitlab.com)

mentioned in commit e2e941e998

mentioned in commit e2e941e998eb0890870188ab3b8cceb56744213d
PlasticDigits (Migrated from gitlab.com) merged commit e2e941e998 into main 2026-08-29 14:57:47 +00:00
PlasticDigits commented 2026-08-29 15:01:49 +00:00 (Migrated from gitlab.com)

mentioned in commit b33da5edf0

mentioned in commit b33da5edf0f55188e8ac623a5616e78be855bba4
PlasticDigits commented 2026-08-29 15:02:40 +00:00 (Migrated from gitlab.com)

mentioned in issue #8

mentioned in issue #8
PlasticDigits commented 2026-08-29 15:02:42 +00:00 (Migrated from gitlab.com)

mentioned in issue #9

mentioned in issue #9
PlasticDigits commented 2026-08-29 15:02:44 +00:00 (Migrated from gitlab.com)

mentioned in issue #7

mentioned in issue #7
Sign in to join this conversation.
No reviewers
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
code/voting!19
No description provided.