Skip to content

feat : added Google Calendar backend OAuth2 routes - #1932

Closed
tmdeveloper007 wants to merge 1 commit into
Canopus-Labs:mainfrom
tmdeveloper007:#1927
Closed

feat : added Google Calendar backend OAuth2 routes#1932
tmdeveloper007 wants to merge 1 commit into
Canopus-Labs:mainfrom
tmdeveloper007:#1927

Conversation

@tmdeveloper007

@tmdeveloper007 tmdeveloper007 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary of What Has Been Done

Created backend/routes/googleCalendarRoutes.js with four routes that the frontend Interview Prep page already calls via API_PATHS.GOOGLE_CALENDAR:

  • GET /connect — initiates Google OAuth2 flow and returns { authUrl }
  • GET /callback — handles the OAuth2 redirect, exchanges code for token
  • GET /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-calendar in backend/server.js.

Changes Made

  • backend/routes/googleCalendarRoutes.js (new): all four routes with input validation and stub responses
  • backend/server.js: added import and app.use("/api/google-calendar", ...) mount

Impact it Made

The Google Calendar connect/sync UI in the Interview Prep page no longer returns 404. The /connect and /callback routes provide a foundation for real OAuth2 integration when GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET env vars are set.

Closes #1793
Closes #1927

Note: Please assign this PR to the tmdeveloper007 account.

Summary

Adds Google Calendar API routes and mounts them at /api/google-calendar.

  • Adds OAuth connect and callback endpoints.
  • Adds authenticated status and event creation endpoints.
  • Validates OAuth parameters, event fields, and ISO dates.
  • Returns 503 when OAuth credentials are not configured.
  • Provides a foundation for future Google Calendar integration.

@github-actions github-actions Bot added the rate-limited Closed automatically: contributor rate limit reached label Aug 13, 2026
@github-actions

Copy link
Copy Markdown

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.

@github-actions github-actions Bot closed this Aug 13, 2026
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 27d4a93d-035e-4770-b9c7-f21f123d9d28

📥 Commits

Reviewing files that changed from the base of the PR and between 206d384 and e6e967d.

📒 Files selected for processing (2)
  • backend/routes/googleCalendarRoutes.js
  • backend/server.js

📝 Walkthrough

Walkthrough

The 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 /api/google-calendar.

Changes

Google Calendar backend integration

Layer / File(s) Summary
Route registration and OAuth initiation
backend/routes/googleCalendarRoutes.js, backend/server.js
The router reads Google OAuth settings, builds the authorization URL, exports the router, and mounts it with generalLimiter.
OAuth callback exchange
backend/routes/googleCalendarRoutes.js
The callback validates parameters, exchanges the authorization code, handles provider and network errors, and redirects on success.
Calendar status and event endpoints
backend/routes/googleCalendarRoutes.js
Authenticated endpoints report disconnected status and validate event titles and ISO date values before returning stub responses.

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
Loading

Possibly related PRs

Suggested labels: type:feature

Suggested reviewers: karanunique

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

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

Labels

rate-limited Closed automatically: contributor rate limit reached

Projects

None yet

1 participant