From cb9e2544ef8e2caeffc4efa19baa0ca5ea1f2d03 Mon Sep 17 00:00:00 2001 From: ShatadruM Date: Sun, 23 Mar 2025 09:53:40 +0530 Subject: [PATCH 1/3] debugged --- client/package-lock.json | 1 - client/package.json | 9 --------- client/src/App.jsx | 21 ++------------------- client/src/pages/ChooseResume.jsx | 7 ------- client/src/pages/ResumeDev.jsx | 5 ----- client/src/pages/ResumeResearch.jsx | 17 ----------------- 6 files changed, 2 insertions(+), 58 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index a7534d4..2f97c5c 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -5217,7 +5217,6 @@ "version": "11.5.0", "resolved": "https://registry.npmjs.org/firebase/-/firebase-11.5.0.tgz", "integrity": "sha512-ZTpO/zD5nYqY02bGpXCg1dRNLggTXPQZdLQeSeur3jYH270p1QkAZZJsm/lrKZ2W4ZjBlafTxxs4OwN38Vyocw==", - "license": "Apache-2.0", "dependencies": { "@firebase/analytics": "0.10.12", "@firebase/analytics-compat": "0.2.18", diff --git a/client/package.json b/client/package.json index 25a5363..7aed14c 100644 --- a/client/package.json +++ b/client/package.json @@ -35,18 +35,9 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "date-fns": "^4.1.0", -<<<<<<< HEAD - "firebase": "^11.2.0", - - "framer-motion": "^12.5.0", - - "jspdf": "^3.0.1", - -======= "firebase": "^11.5.0", "framer-motion": "^12.5.0", "jspdf": "^3.0.1", ->>>>>>> upstream/main "lucide-react": "^0.469.0", "motion": "^12.5.0", "react": "^18.3.1", diff --git a/client/src/App.jsx b/client/src/App.jsx index 769e523..10f29a9 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -3,13 +3,12 @@ import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; import { ThemeProvider } from './components/ThemeProvider'; import LandingPage from './pages/LandingPage'; import NotFound from './pages/NotFound'; -import SignIn from './pages/AuthPage'; +import Login from './pages/AuthPage' import Dashboard from './pages/Dashboard'; import ProfilePage from './pages/ProfilePage'; import ResumeDev from './pages/ResumeDev'; import ResumeResearch from './pages/ResumeResearch' import ChooseResume from './pages/ChooseResume'; -import ResumeResearch from './pages/ResumeResearch'; import ProtectedRoute from './components/ProtectedRoute'; // Resume type components @@ -25,29 +24,13 @@ const App = () => { {/* Public Routes */} } /> } /> -<<<<<<< HEAD - } /> + } /> } /> } /> } /> } /> }> - } /> -======= - } /> - - {/* Protected Routes */} - - - - } - > - ->>>>>>> upstream/main } /> { return ( <> -<<<<<<< HEAD
@@ -53,12 +52,6 @@ const ChooseResume = () => { ))}
-======= -
- - - ->>>>>>> upstream/main
) diff --git a/client/src/pages/ResumeDev.jsx b/client/src/pages/ResumeDev.jsx index 056cb1f..54f91ba 100644 --- a/client/src/pages/ResumeDev.jsx +++ b/client/src/pages/ResumeDev.jsx @@ -29,7 +29,6 @@ function App({ resumeType = 'developer' }) { return ( <> -<<<<<<< HEAD

{getResumeTitle()}

@@ -37,10 +36,6 @@ function App({ resumeType = 'developer' }) {
-======= -
-
->>>>>>> upstream/main
diff --git a/client/src/pages/ResumeResearch.jsx b/client/src/pages/ResumeResearch.jsx index 33076c1..4276800 100644 --- a/client/src/pages/ResumeResearch.jsx +++ b/client/src/pages/ResumeResearch.jsx @@ -5,18 +5,13 @@ import resumeData from '../components/ResumeResearch/resumeData.json' import ChatInterface from '../components/ResumeResearch/ChatInterface' import Topbar from '@/components/Topbar' -<<<<<<< HEAD function App({ resumeType = 'developer' }) { -======= -function App() { ->>>>>>> upstream/main const [currentResumeData, setCurrentResumeData] = useState(resumeData); const handleResumeData = (data) => { setCurrentResumeData(data); }; -<<<<<<< HEAD // Get the title based on resume type const getResumeTitle = () => { switch(resumeType) { @@ -46,18 +41,6 @@ function App() {
-======= - return ( - <> - -
-
-
- -
-
- ->>>>>>> upstream/main
From c3aba4040838351a9c72adbfaa93f8b93268b174 Mon Sep 17 00:00:00 2001 From: ShatadruM Date: Sun, 23 Mar 2025 14:11:18 +0530 Subject: [PATCH 2/3] main feature working --- .../components/ResumeDev/ChatInterface.jsx | 57 +++++++++--- client/src/components/ResumeDev/profile.json | 84 ++++++++++++++++++ client/src/pages/Dashboard.jsx | 88 ++++++++++++++++--- client/vite.config.js | 18 ++-- 4 files changed, 218 insertions(+), 29 deletions(-) create mode 100644 client/src/components/ResumeDev/profile.json diff --git a/client/src/components/ResumeDev/ChatInterface.jsx b/client/src/components/ResumeDev/ChatInterface.jsx index 00edaab..e926f24 100644 --- a/client/src/components/ResumeDev/ChatInterface.jsx +++ b/client/src/components/ResumeDev/ChatInterface.jsx @@ -1,5 +1,6 @@ import { useState, useEffect, useRef } from 'react'; import resumeData from './resumeData.json'; +import profile from './profile.json' export default function ChatInterface({ onResumeData }) { const [messages, setMessages] = useState([ @@ -47,10 +48,8 @@ export default function ChatInterface({ onResumeData }) { { text: `Thanks! Analyzing your profile for a ${jobRole} position...`, sender: 'bot' } ]); - // Mock delay to simulate processing - setTimeout(() => { - processResume(jobRole, input); - }, 2000); + // Make API call to generate the resume + fetchCustomizedResume(jobRole, input); } } catch (error) { console.error('Error processing request:', error); @@ -63,33 +62,63 @@ export default function ChatInterface({ onResumeData }) { } }; - const processResume = async (role, description) => { + const fetchCustomizedResume = async (role, description) => { try { - // Use the actual resume data from the JSON file instead of mock data + setIsLoading(true); - // Update messages to reflect findings + // Prepare request payload according to the API documentation + const payload = { + user_profile: profile, + resume_template: resumeData, + job_description: description + }; + + // Make the API call + const response = await fetch('/api/resume/create', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(payload), + }); + + if (!response.ok) { + throw new Error(`API call failed with status: ${response.status}`); + } + + // Parse the response - according to docs it should have a "resume" property + const responseData = await response.json(); + + // Log the entire response + console.log("API Response:", responseData); + + // Extract the resume data from the response + const customizedResumeData = responseData.resume; + console.log("Customized Resume Data:", customizedResumeData); + + // Update messages to reflect success setMessages(prev => [ ...prev, { text: `Identifying relevant skills for this position...`, sender: 'bot' }, - { text: `I found ${resumeData.skills.length} relevant skills for this position.`, sender: 'bot' }, + { text: `I found ${customizedResumeData.skills?.length || 0} relevant skills for this position.`, sender: 'bot' }, { text: `Identifying relevant projects for this position...`, sender: 'bot' }, - { text: `I found ${resumeData.projects.length} relevant projects for this position.`, sender: 'bot' }, + { text: `I found ${customizedResumeData.projects?.length || 0} relevant projects for this position.`, sender: 'bot' }, { text: `Identifying relevant work experience...`, sender: 'bot' }, - { text: `I found ${resumeData.workEx.length} relevant work experiences for this position.`, sender: 'bot' }, + { text: `I found ${customizedResumeData.workEx?.length || 0} relevant work experiences for this position.`, sender: 'bot' }, { text: `Generating a tailored summary for your resume...`, sender: 'bot' }, { text: `Your resume is ready! I've created a tailored resume that highlights your relevant skills and experience for this ${role} position. You can view it in the preview panel and download it as a PDF.`, sender: 'bot' } ]); - // Pass the resume data from the JSON file up to the parent component - onResumeData(resumeData); + // Pass the customized resume data to the parent component + onResumeData(customizedResumeData); // Mark process as complete setStage('complete'); } catch (error) { - console.error('Error processing resume:', error); + console.error('Error fetching customized resume:', error); setMessages(prev => [ ...prev, - { text: 'Sorry, there was an error generating your resume. Please try again.', sender: 'bot' } + { text: 'Sorry, there was an error generating your customized resume. Please try again.', sender: 'bot' } ]); } finally { setIsLoading(false); diff --git a/client/src/components/ResumeDev/profile.json b/client/src/components/ResumeDev/profile.json new file mode 100644 index 0000000..26d07ac --- /dev/null +++ b/client/src/components/ResumeDev/profile.json @@ -0,0 +1,84 @@ +{ + "personal_info": { + "name": "John Doe", + "age": 25, + "address": { + "street": "123 Main Street", + "city": "New York", + "state": "NY", + "zip": "10001", + "country": "USA" + }, + "phone_number": "+1 234-567-8901", + "email": "johndoe@example.com", + "linkedin": "https://linkedin.com/in/johndoe", + "github": "https://github.com/johndoe", + "website": "https://johndoe.dev" + }, + "skills": [ + "JavaScript", + "React.js", + "Node.js", + "Python", + "Machine Learning", + "Data Structures & Algorithms", + "Database Management", + "Cybersecurity", + "Cloud Computing" + ], + "education": [ + { + "degree": "Bachelor of Technology", + "field": "Computer Science and Engineering", + "university": "XYZ University", + "year_of_graduation": 2024, + "cgpa": 8.9 + } + ], + "certifications": [ + { + "title": "Google Data Analytics Certificate", + "issuer": "Google", + "year": 2023 + }, + { + "title": "AWS Certified Solutions Architect", + "issuer": "Amazon Web Services", + "year": 2022 + } + ], + "projects": [ + { + "title": "AI-Powered Resume Builder", + "description": "Developed an AI-based web application that dynamically generates resumes based on user input.", + "technologies": ["React.js", "Node.js", "GPT API", "MongoDB"], + "github_link": "https://github.com/johndoe/resume-builder" + }, + { + "title": "Secure Chat App", + "description": "Built an end-to-end encrypted chat application with AI-assisted message summarization.", + "technologies": ["Next.js", "Socket.io", "WebRTC", "AES Encryption"], + "github_link": "https://github.com/johndoe/secure-chat" + } + ], + "experience": [ + { + "role": "Software Engineer Intern", + "company": "Tech Corp", + "duration": "June 2023 - Dec 2023", + "responsibilities": [ + "Developed APIs for a high-traffic web application.", + "Implemented authentication and role-based access control.", + "Optimized database queries to improve response time by 30%." + ] + } + ], + "achievements": [ + "Finalist in Google Solution Challenge 2023", + "Top 5% in LeetCode Global Coding Contest", + "Published research paper on AI in Education at ICML 2024" + ], + "languages": ["English", "Spanish", "French"], + "interests": ["Open Source Contributions", "Cybersecurity Research", "AI Ethics"] + } + \ No newline at end of file diff --git a/client/src/pages/Dashboard.jsx b/client/src/pages/Dashboard.jsx index 4adb8ae..dea0794 100644 --- a/client/src/pages/Dashboard.jsx +++ b/client/src/pages/Dashboard.jsx @@ -1,24 +1,92 @@ -import React from "react"; +import React, { useState } from "react"; import Topbar from "@/components/Topbar"; import { Outlet } from "react-router-dom"; import { TypewriterEffectSmooth } from "@/components/ui/typewriter-effect"; import { FlipWords } from "@/components/ui/flip-words"; +import { Button } from "@/components/ui/button"; const words = ["Stronger", "Better", "Higher"]; const Dashboard = () => { + const [showFeedback, setShowFeedback] = useState(false); + const [feedback, setFeedback] = useState(""); + + const handleSubmit = () => { + // Handle the feedback submission here + console.log("Feedback submitted:", feedback); + setFeedback(""); + setShowFeedback(false); + }; + return ( -
- {/* Fixed Topbar */} -
- + <> +
+ {/* Fixed Topbar */} +
+ +
+ + {/* Scrollable Content */} +
+ Build +
+ + {/* Feedback Button */} +
+ +
- {/* Scrollable Content */} -
- Build -
-
+ {/* Feedback Modal (custom implementation) */} + {showFeedback && ( +
+
+
+

Share Your Feedback

+ +
+ +
+ +