Skip to content

feat(r3dr): migrate UI to Cloudflare Workers with TypeScript/React/Vite #1106

@aaylward

Description

@aaylward

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

  1. 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
  2. Port the existing UI (URL input, shorten button, result/copy display, error display) to React components
  3. Wire up the /shorten API call and https://r3dr.net/r/<slug> result display
  4. Add Vitest + RTL tests
  5. Set up wrangler config for CF Workers deployment
  6. Remove domains/r3dr/apps/r3dr_web/ static files and the corresponding scp/cp steps from deploy/consolidated/deploy.sh
  7. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions