feat : added Google Calendar backend OAuth2 routes - #1932
Conversation
|
Thank you for your contribution! To keep reviews manageable and maintain repository quality, contributors may have a maximum of 3 open Issues and 3 open Pull Requests at any given time. Please wait until one of your existing submissions is reviewed or closed before opening additional ones. If you believe this was closed by mistake, feel free to contact the maintainers. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe backend adds Google Calendar OAuth, status, and event endpoints. It validates OAuth and event input, handles token exchange errors, redirects successful callbacks, and mounts the router under ChangesGoogle Calendar backend integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant InterviewPrep
participant googleCalendarRoutes
participant GoogleOAuth
participant Frontend
InterviewPrep->>googleCalendarRoutes: GET /api/google-calendar/connect
googleCalendarRoutes->>GoogleOAuth: Request authorization URL
GoogleOAuth-->>googleCalendarRoutes: OAuth callback with code
googleCalendarRoutes->>GoogleOAuth: Exchange code for tokens
googleCalendarRoutes-->>Frontend: Redirect after callback
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Summary of What Has Been Done
Created
backend/routes/googleCalendarRoutes.jswith four routes that the frontend Interview Prep page already calls viaAPI_PATHS.GOOGLE_CALENDAR:GET /connect— initiates Google OAuth2 flow and returns{ authUrl }GET /callback— handles the OAuth2 redirect, exchanges code for tokenGET /status— returns{ connected, email }for the authenticated user (stub)POST /events— creates a calendar event for the interview session (stub)Mounted the router at
/api/google-calendarinbackend/server.js.Changes Made
backend/routes/googleCalendarRoutes.js(new): all four routes with input validation and stub responsesbackend/server.js: added import andapp.use("/api/google-calendar", ...)mountImpact it Made
The Google Calendar connect/sync UI in the Interview Prep page no longer returns 404. The
/connectand/callbackroutes provide a foundation for real OAuth2 integration whenGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETenv vars are set.Closes #1793
Closes #1927
Note: Please assign this PR to the
tmdeveloper007account.Summary
Adds Google Calendar API routes and mounts them at
/api/google-calendar.503when OAuth credentials are not configured.