Merged
Conversation
- Replace all mock data with real backend API calls - Update discover page to load 30 real GitHub issues - Transform leaderboard to display real user data from database - Fix GitHub OAuth configuration and security: - Move client secret to user secrets (secure) - Fix callback URL configuration - Add UserSecretsId to project file - Enhance API service layer in frontend with proper error handling - Update authentication state management in Header component - Configure CORS properly between frontend:3000 and backend:5198 - Add comprehensive integration documentation All frontend components now use real data from the .NET backend instead of mock data.
- Fix frontend API call to send {code: string} instead of raw string
- Backend expects GitHubLoginRequest object with Code property
- Resolves 'auth_error=login_failed' issue during GitHub OAuth flow
- OAuth authentication should now work end-to-end
- Update README.md to reflect completed frontend-backend integration - Add current status section showing fully operational application - Improve setup instructions with PowerShell script and security best practices - Add AGENTS.md comprehensive development guide for AI agents - Include build commands, code style guidelines, error handling patterns - Document authentication flow, API patterns, and common pitfalls - Ready for production use with real GitHub API integration
WalkthroughThis pull request introduces GitHub OAuth authentication flow with backend endpoints, updates API routes for user profiles and leaderboards, and replaces static mock data with live API integration throughout the frontend. It includes comprehensive developer documentation, OAuth configuration, and real-time data fetching for issue discovery, leaderboards, and user profiles. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User/Browser
participant Frontend as Frontend App
participant Backend as ASP.NET Backend
participant GitHub as GitHub OAuth API
participant Database as Database
User->>Frontend: Clicks "Sign In"
Frontend->>Frontend: Constructs OAuth URL with client_id
Frontend->>GitHub: Redirects to GitHub authorization page
GitHub->>User: Shows OAuth consent screen
User->>GitHub: Authorizes application
GitHub->>Frontend: Redirects back with authorization code
Frontend->>Backend: POST /api/auth/github with code
Backend->>GitHub: Exchanges code for access token
GitHub->>Backend: Returns access token
Backend->>GitHub: Fetches user info (email, profile)
GitHub->>Backend: Returns user details
Backend->>Database: Sync/create user record
Database->>Backend: User saved
Backend->>Backend: Generates JWT token
Backend->>Frontend: Returns JWT (HTTP-only cookie) + user info
Frontend->>Frontend: Stores user state, clears auth UI
Frontend->>User: Displays authenticated header with profile
sequenceDiagram
participant Component as Frontend Component
participant APIClient as API Client (api.ts)
participant Backend as Backend API
participant Database as Database
Component->>Component: useEffect triggered on mount
Component->>APIClient: Calls getLeaderboard() or getUserProfile()
APIClient->>Backend: GET /api/users/leaderboard or /api/users/{username}
Backend->>Database: Query users with EF
Database->>Backend: Returns user records
Backend->>APIClient: Returns ApiResponse<User[]> or ApiResponse<User>
APIClient->>Component: Promise resolves with data/error
Component->>Component: Updates state (users, profile, loading, error)
Component->>Component: Conditional rendering (loading spinner, error msg, or data)
Component->>User: Renders live leaderboard or profile
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ort, function or class' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ort, function or class' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request completes the integration of the GitQuest frontend with the backend, replacing all mock data with real data from the backend and GitHub APIs. It introduces robust authentication via GitHub OAuth, improves error handling and loading states, and updates both backend and frontend API contracts to support real-time data flow. The most important changes are grouped below:
Frontend Integration and UI Improvements:
discover-issues.tsx) now fetches 30 real GitHub issues from the backend, replaces all mock data, adds loading spinners and error states, and displays real repository, XP, and issue details. Issue cards are updated to use real API fields and include a "View Issue" button. [1] [2] [3] [4] [5] [6] [7]FRONTEND_BACKEND_INTEGRATION_COMPLETE.md, summarizes the completed integration, lists all working endpoints, and provides next steps for production.Backend API and Authentication Enhancements:
GET /api/auth/github), callback handling (GET /api/auth/github-callback), and direct login via code (POST /api/auth/github). The API contract is updated to accept a typed request object. [1] [2]API and Endpoint Updates:
GET /api/users/{username}(was/profile/{username}) to match frontend expectations.Configuration and Security:
appsettings.jsonis updated with a secure JWT key, a real GitHub Client ID, and expanded CORS origins to allow bothlocalhostand127.0.0.1.These changes ensure the GitQuest application now provides a seamless, real-data experience across authentication, issues discovery, leaderboard, and user profiles.
References:
Frontend: [1] [2] [3] [4] [5] [6] [7] [8]
Backend: [1] [2] [3] [4] [5]
Config:
Summary by CodeRabbit
Release Notes
New Features
Documentation