Skip to content

Conversation

@staticpayload
Copy link

@staticpayload staticpayload commented Dec 28, 2025

What

Frontend tRPC router for GitHub integration, connecting to the backend API from PR #1516.

Why

Enables the frontend to:

  • Initiate GitHub OAuth connection
  • Exchange OAuth code for access token
  • Disconnect GitHub accounts
  • Fetch PR details with bounty extraction

Implementation

New File: frontend/trpc/routes/github.ts

Endpoints:

  • getOAuthUrl - Gets OAuth URL for GitHub connection popup
  • exchangeCode - Exchanges OAuth code for access token
  • disconnect - Disconnects GitHub account
  • fetchPr - Fetches PR details including bounty, merged status, verification

Features:

  • Uses @/env for API base URL construction
  • Zod schemas for type-safe response validation
  • Transforms snake_case backend responses to camelCase

Modified: frontend/trpc/server.ts

  • Registered githubRouter in appRouter

Dependencies

Requires backend PR #1516 to be merged first (adds /internal/github/* endpoints).

AI Disclosure

This PR was developed with AI assistance:

  • Planning & Review: Claude Opus 4.5
  • Implementation: GLM 4.7

Related to #1507

chaitanya-mishra-ai and others added 3 commits December 28, 2025 15:11
Frontend tRPC router with the following endpoints:
- getOAuthUrl: Gets OAuth URL for GitHub connection
- exchangeCode: Exchanges OAuth code for access token
- disconnect: Disconnects GitHub account
- fetchPr: Fetches PR details with bounty extraction

These endpoints call the Rails backend API at /internal/github/*.
Transforms snake_case responses to camelCase for frontend use.
ESLint disallows type assertions in this project. Using zod schemas
to validate and parse API responses instead of 'as' assertions.
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