Summary
The current r3dr frontend (domains/r3dr/apps/r3dr_web/) is a plain HTML/CSS/JS app served as static files via Caddy (copied to /var/www/r3dr during deploy). Migrate it to a Cloudflare Workers-hosted SPA using the same stack as 1d4_web.
Motivation
- Plain JS/HTML is harder to maintain and test than a typed React app
- Static files are deployed via
scp in deploy/consolidated/deploy.sh and served from the Caddy host — removing this moves hosting to CF and simplifies the deploy script
- Aligns with the project's existing CF Workers + Vite pattern (
1d4_web)
Proposed Work
- Create
domains/r3dr/apps/r3dr_web_v2/ (or rename in-place) as a Vite + React + TypeScript + Tailwind v4 CF Workers app, mirroring the 1d4_web setup
- Port the existing UI (URL input, shorten button, result/copy display, error display) to React components
- Wire up the
/shorten API call and https://r3dr.net/r/<slug> result display
- Add Vitest + RTL tests
- Set up wrangler config for CF Workers deployment
- Remove
domains/r3dr/apps/r3dr_web/ static files and the corresponding scp/cp steps from deploy/consolidated/deploy.sh
- Remove the
/var/www/r3dr static file serving block from the Caddyfile (routing handled by CF)
Current files to remove/replace
domains/r3dr/apps/r3dr_web/index.html
domains/r3dr/apps/r3dr_web/script.js
domains/r3dr/apps/r3dr_web/styles.css
Summary
The current r3dr frontend (
domains/r3dr/apps/r3dr_web/) is a plain HTML/CSS/JS app served as static files via Caddy (copied to/var/www/r3drduring deploy). Migrate it to a Cloudflare Workers-hosted SPA using the same stack as1d4_web.Motivation
scpindeploy/consolidated/deploy.shand served from the Caddy host — removing this moves hosting to CF and simplifies the deploy script1d4_web)Proposed Work
domains/r3dr/apps/r3dr_web_v2/(or rename in-place) as a Vite + React + TypeScript + Tailwind v4 CF Workers app, mirroring the1d4_websetup/shortenAPI call andhttps://r3dr.net/r/<slug>result displaydomains/r3dr/apps/r3dr_web/static files and the correspondingscp/cpsteps fromdeploy/consolidated/deploy.sh/var/www/r3drstatic file serving block from the Caddyfile (routing handled by CF)Current files to remove/replace
domains/r3dr/apps/r3dr_web/index.htmldomains/r3dr/apps/r3dr_web/script.jsdomains/r3dr/apps/r3dr_web/styles.css