Skip to content

Collapse the dual backend so local dev runs the same code as production #34

Description

@paccloud

What to build

End the drift between the local Express+SQLite server and the Vercel serverless functions. They were meant to be kept in sync by hand and have diverged: the local server is missing the public-calcs, consolidated export, and fish-data routes (so the community feed 404s and Export History is broken in local dev), upload validation differs materially, and the local schema lacks the OAuth columns — so OAuth flows can't be exercised locally at all.

Decision needed first: either (a) extract each route's logic into shared handler modules consumed by both the serverless functions and a thin Express adapter (run against local Postgres or a Neon dev branch), or (b) retire the Express server and standardize local dev on vercel dev. Then migrate route-by-route rather than big-bang, and update CLAUDE.md/README to remove the "keep two implementations in sync manually" rule.

Context: AUDIT_REPORT.md §3.6, theme 4, and task 2.1 (branch claude/repo-audit-improvement-ozhlau); Open Question #3.

Acceptance criteria

  • Architecture decision recorded (shared handlers + adapter, or vercel dev)
  • Local dev serves the same routes with the same validation as production (community feed and export work locally)
  • OAuth flows are exercisable in local dev
  • Exactly one implementation of each route's logic exists in the repo
  • CLAUDE.md/README describe the new local dev story

Blocked by

These fix the contract first so the consolidation ports correct behavior, not bugs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions