Skip to content

feat: wire resume upload and preferences to backend API#107

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/create-sub-issues-for-mvp
Open

feat: wire resume upload and preferences to backend API#107
Copilot wants to merge 2 commits into
mainfrom
copilot/create-sub-issues-for-mvp

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 11, 2026

Frontend pages were entirely disconnected from the backend — resume upload only did client-side text extraction, and preferences were saved with setTimeout mocks. This wires the full end-to-end flows.

New: frontend/src/lib/api.ts

Minimal typed API client shared across pages:

  • Attaches Clerk ****** to every request via useAuth().getToken()
  • Reads base URL from VITE_BACKEND_URL (falls back to http://localhost:3000)
  • Exports: fetchResume, uploadResume, fetchPreferences, savePreferences, patchPreferences

ResumePage

After client-side text extraction, the file is now POSTed to POST /resume:

const token = await getToken();
await uploadResume(token, f); // multipart/form-data → backend → Cloudinary + DB + async AI parse

Status badge reflects upload state: PROCESSINGPARSED / FAILED.

ProfilePage

  • On mount: GET /preferences and GET /resume fetched in parallel; form hydrated from server state instead of hardcoded defaults
  • Save preferences: POST /preferences with { seniority, locationPreferences }; state updated from response
  • Replace resume: POST /resume; returned fileUrl stored so the "View ↗" link in ResumeUpdateSection works
  • Inline error display for both operations
  • URL filename extraction uses new URL(fileUrl).pathname to handle query strings correctly

Copilot AI linked an issue Apr 11, 2026 that may be closed by this pull request
- Add frontend/src/lib/api.ts: typed API client with Clerk auth token support
- ResumePage: upload file to POST /resume after local text extraction
- ProfilePage: load preferences+resume on mount, replace setTimeout mocks with real POST /preferences and POST /resume API calls

Agent-Logs-Url: https://github.com/yb175/CVPilot/sessions/72185afe-2230-45fe-8d4b-6692803d3faf

Co-authored-by: yb175 <181614786+yb175@users.noreply.github.com>
Copilot AI changed the title [WIP] Create 5-8 well-defined sub-issues for MVP feat: wire resume upload and preferences to backend API Apr 11, 2026
Copilot AI requested a review from yb175 April 11, 2026 10:46
@armaansharma-dev armaansharma-dev marked this pull request as ready for review April 11, 2026 11:16
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.

Backend frontend integration

2 participants