Skip to content

Migrate Next.js API routes to backend GraphQL#821

Open
marcodejongh wants to merge 1 commit intomainfrom
cleanup_nextjs_backend
Open

Migrate Next.js API routes to backend GraphQL#821
marcodejongh wants to merge 1 commit intomainfrom
cleanup_nextjs_backend

Conversation

@marcodejongh
Copy link
Owner

Summary

  • Delete dead Aurora proxy routes (~7 routes) that no longer work due to Aurora's App Attest requirement, plus old sync cron and shared-sync endpoints superseded by the backend
  • Switch frontend callers to existing GraphQL for profile, aurora credentials, controllers, and favorites (5 REST routes replaced)
  • Create new backend GraphQL resolvers for beta links, climb stats, hold classifications, user board mappings, unsynced counts, setter stats, and hold heatmap (7 new resolvers)
  • Clean up orphaned code: removed ~3,600 lines of dead code including route files, validation utilities, query builders, and OpenAPI registrations

Net result: -1,674 lines (1,956 added, 3,630 deleted), 58 files changed.

Routes deleted (25 total)

  • 7 Aurora proxy routes (login, user-sync, getLogbook, saveAscent, saveClimb)
  • 2 sync routes (user-sync-cron, shared-sync)
  • 5 already-duplicated routes (profile, profile/[userId], aurora-credentials, controllers, favorites)
  • 7 data query routes (beta, climb-stats, hold-classifications, unsynced, user-board-mapping, setters, heatmap)
  • 4 orphaned utility files (setter-stats.ts, holds-heatmap.ts, create-climb-filters.ts, validation.ts)

Routes kept in Next.js

  • All authentication routes (NextAuth)
  • SSR data routes (slugs, grades, angles, climb detail)
  • Middleware

Test plan

  • Settings page: profile editing, avatar upload, Instagram URL
  • Settings page: aurora credentials link/unlink, unsynced counts display
  • Settings page: controller registration/deletion
  • Favorites: toggle favorite on climb, verify persisted
  • Climb detail: beta video links load correctly
  • Angle selector: climb stats load for all angles
  • Hold classification wizard: load/save classifications
  • Setter search: autocomplete dropdown populates with setter stats
  • Heatmap overlay: hold usage data renders correctly
  • Heatmap with filters: personal progress filters (hide attempted, etc.) work
  • Public profile page: loads profile data via GraphQL
  • Typecheck passes (npm run typecheck) - only pre-existing errors remain

🤖 Generated with Claude Code

Delete dead Aurora proxy routes (blocked by App Attest), old sync cron,
and shared-sync. Switch frontend callers for profile, credentials,
controllers, and favorites to use existing GraphQL resolvers. Create new
backend GraphQL resolvers for beta links, climb stats, hold
classifications, user board mappings, unsynced counts, setter stats, and
hold heatmap. Remove ~30 Next.js API route files and orphaned utilities,
reducing the web package by ~3600 lines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vercel
Copy link

vercel bot commented Feb 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
boardsesh Error Error Feb 13, 2026 2:35pm

Request Review

@claude
Copy link

claude bot commented Feb 13, 2026

Claude Review

Ready to merge - Minor issues noted below, but nothing blocking.

Issues

  1. Bug: Inconsistent property name - packages/web/app/components/beta-videos/beta-videos.tsx:173

    {selectedVideo?.foreign_username ? `Beta by @${selectedVideo.foreignUsername}` : 'Beta Video'}

    The check uses foreign_username (old REST naming) but the value uses foreignUsername (new GraphQL naming). This will always show "Beta Video" since foreign_username will be undefined. Should be:

    {selectedVideo?.foreignUsername ? `Beta by @${selectedVideo.foreignUsername}` : 'Beta Video'}
  2. Minor: Test coverage - Tests for validation utilities (packages/web/app/api/internal/hold-classifications/__tests__/validation.test.ts) were deleted since the route was migrated, but no replacement tests were added for the new backend validation schemas in packages/backend/src/validation/schemas.ts.

Documentation

  • The cron job removal in vercel.json aligns with removing sync routes - no doc update needed since this relates to infrastructure rather than documented architecture.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant