refactor(api): move backend into next route handlers

✅ merged · #2 · elitan/mike ← elitan/mike · opened 11d ago by elitan · merged 11d ago by elitan · self · +2,294-7,090 across 63 files · ↗ on GitHub

From the PR description

Summary

  • move the former Express API surface into Next.js route handlers under /api/backend
  • remove the standalone backend package and keep server code under frontend/src/server/backend
  • add oRPC route handlers, client utilities, and TanStack Query provider setup
  • document the oRPC decision, TanStack Query pattern, and Node runtime constraints

Validation

  • npx tsc --noEmit
  • npm run build
  • smoke tested /api/backend/health, protected REST auth, and protected oRPC auth

Notes

  • full npm run lint still fails on pre-existing frontend lint issues unrelated to this change
  • uploads, downloads, and SSE keep the existing REST paths for compatibility

Our analysis

Collapse Express backend into Next.js route handlers with oRPC — read the full analysis →

Think the analysis missed something the PR description covers?

Capture this PR into my fork

Download a Markdown prompt that tells Claude how to port every commit in this PR into your working tree. Run it via claude -p < capture-pull-2.md from inside the repo you want the changes in.

⬇ Download capture-pull-2.md