Some checks failed
Profile Linker Docker Build / Build and push Docker image (push) Failing after 3s
- Integrated Cloudflare R2 for template storage and converted file management - Added Google Gemini AI for resume parsing and HTML generation - Created backend API endpoints for templates, conversion, and history - Refactored frontend to use real API instead of mock data - Fixed Docker networking issues (IPv6/IPv4) for R2 connectivity - Added resumeService.ts for frontend API integration - Updated Vite configuration for proper asset serving in Docker - Successfully tested with 13 templates from R2 bucket
6.9 KiB
6.9 KiB
Integration Complete! 🎉
What We've Done:
✅ 1. Fixed Environment Variables
- Updated
.envfiles with correctAPP_NAME=resumeformatter - Added Cloudflare R2 credentials to root
.env - Fixed frontend
.envto useVITE_APP_NAME=resumeformatter
✅ 2. Added Backend Dependencies
Added to requirements.txt:
boto3==1.34.51- AWS SDK (works with R2)python-multipart==0.0.9- For file uploadsgoogle-generativeai==0.3.2- Gemini AI SDK
✅ 3. Created R2 Service (backend/app/services/r2_service.py)
Functions:
list_templates()- Get all templates from R2get_template_content(name)- Download template HTMLupload_converted_file()- Upload HTML/PDF to R2list_converted_resumes()- Get conversion historyget_file_url()- Generate presigned download URLs
✅ 4. Created AI Service (backend/app/services/ai_service.py)
Functions:
extract_text_from_resume()- Extract text from PDF/DOCX using Gemini Visiongenerate_html_from_template()- Merge resume data into template using Gemini
✅ 5. Created Resume API Endpoints (backend/app/api/endpoints/resumes.py)
Endpoints:
GET /api/resumes/templates- List available templatesGET /api/resumes/templates/{name}- Get template contentPOST /api/resumes/convert- Convert resume (accepts file + template name)GET /api/resumes/history- Get conversion historyGET /api/resumes/download/{key}- Get download URL
✅ 6. Updated Configuration
- Added R2 and Gemini settings to
backend/app/core/config.py - Updated
docker-compose.ymlto pass environment variables - Registered resume endpoints in API router
Next Steps:
🎯 Option 1: Test Docker Build (Recommended)
Since you don't have Node.js installed locally, use Docker:
# Build and run with Docker
docker-compose up --build
Then test at: http://localhost:8080/resumeformatter
🎯 Option 2: Update Frontend to Use Backend API
The frontend currently has mock R2 functions. We need to:
- Create API service functions in frontend
- Replace mock functions with real API calls
- Remove AI logic from frontend (now handled by backend)
🎯 Option 3: Install Node.js for Local Development
If you want to develop locally:
# Install Node.js (macOS)
brew install node
# Then install frontend dependencies
cd frontend
npm install
Architecture Summary:
┌─────────────────────────────────────────────────────┐
│ USER BROWSER │
│ http://localhost:8080 │
└──────────────────────┬──────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│ FRONTEND (React + Vite) │
│ - Upload resume file │
│ - Select template │
│ - Preview HTML │
│ - Download files │
└──────────────────────┬──────────────────────────────┘
│ API Calls
▼
┌─────────────────────────────────────────────────────┐
│ BACKEND (FastAPI + Python) │
│ │
│ ┌─────────────────────────────────────────┐ │
│ │ Resume Endpoints │ │
│ │ /api/resumes/* │ │
│ └──────────┬──────────────────────────────┘ │
│ │ │
│ ┌────────┴────────┐ │
│ ▼ ▼ │
│ ┌──────────┐ ┌──────────┐ │
│ │ R2 │ │ AI │ │
│ │ Service │ │ Service │ │
│ └──────────┘ └──────────┘ │
│ │ │ │
└───────┼────────────────┼────────────────────────────┘
│ │
▼ ▼
┌───────────────┐ ┌──────────────┐
│ Cloudflare R2 │ │ Gemini AI │
│ - Templates │ │ - Vision │
│ - Resumes │ │ - Text Gen │
└───────────────┘ └──────────────┘
API Flow Example:
- User uploads resume.pdf + selects "Google" template
- Frontend → POST /api/resumes/convert
- Sends file + template_name
- Backend extracts text → Gemini Vision API
- Backend fetches template → R2 Storage
- Backend generates HTML → Gemini Text API
- Backend uploads HTML → R2 Storage
- Backend returns → { html_content, html_url }
- Frontend displays preview and allows download
Environment Variables Reference:
# Root .env (for Docker)
APP_NAME=resumeformatter
GEMINI_API_KEY=AIzaSyB4Y9qrGynW3UNflYcQC-HGlJxOe_ty6VI
R2_ENDPOINT=https://cba4afd7666247724ece1f34e1aace6c.r2.cloudflarestorage.com
R2_ACCESS_KEY_ID=8f7244b0e7f9c8297a606af0073d4a5a
R2_SECRET_ACCESS_KEY=17845714ff4c2e5f33f09740112be47925d0fab93d27b26982964cd14808b60b
R2_BUCKET_NAME=e-teams
# Frontend .env (for Vite)
VITE_APP_NAME=resumeformatter
GEMINI_API_KEY=AIzaSyB4Y9qrGynW3UNflYcQC-HGlJxOe_ty6VI
Testing Checklist:
- Docker builds successfully
- Can access app at http://localhost:8080/resumeformatter
- API docs at http://localhost:8080/resumeformatter/api/docs
- Can list templates from R2
- Can upload and convert resume
- Can view conversion history
- Can download HTML files
What Would You Like to Do Next?
A) Test the Docker build now (docker-compose up --build)
B) Update frontend to use new backend API
C) Install Node.js for local development
D) Something else?
Let me know and I'll guide you through it! 🚀