From fa014fe4982dc5baf1ee80f9469e179a4471aa56 Mon Sep 17 00:00:00 2001 From: "a.hakimi" Date: Fri, 12 Jun 2026 12:21:25 +0330 Subject: [PATCH 1/3] feat: add evaluation form and results page with file upload functionality --- .../src/app/components/EvaluateForm.tsx | 99 +++++++++++++++++++ apps/web-ui/src/app/components/FileUpload.tsx | 87 ++++++++++++++++ apps/web-ui/src/app/components/ScoreCard.tsx | 37 +++++++ apps/web-ui/src/app/components/TextStats.tsx | 16 +++ apps/web-ui/src/app/lib/evaluation-storage.ts | 41 ++++++++ apps/web-ui/src/app/page.tsx | 3 + apps/web-ui/src/app/results/page.tsx | 86 ++++++++++++++++ 7 files changed, 369 insertions(+) create mode 100644 apps/web-ui/src/app/components/EvaluateForm.tsx create mode 100644 apps/web-ui/src/app/components/FileUpload.tsx create mode 100644 apps/web-ui/src/app/components/ScoreCard.tsx create mode 100644 apps/web-ui/src/app/components/TextStats.tsx create mode 100644 apps/web-ui/src/app/lib/evaluation-storage.ts create mode 100644 apps/web-ui/src/app/results/page.tsx diff --git a/apps/web-ui/src/app/components/EvaluateForm.tsx b/apps/web-ui/src/app/components/EvaluateForm.tsx new file mode 100644 index 0000000..1b4c959 --- /dev/null +++ b/apps/web-ui/src/app/components/EvaluateForm.tsx @@ -0,0 +1,99 @@ +"use client"; + +import { useState } from "react"; +import { useRouter } from "next/navigation"; +import { evaluate } from "@cv-builder/core"; +import { TextStats } from "./TextStats"; +import { saveEvaluationResult } from "../lib/evaluation-storage"; +import { FileUpload } from "./FileUpload"; + +export function EvaluateForm() { + const router = useRouter(); + + const [cv, setCv] = useState(""); + const [jd, setJd] = useState(""); + const [loading, setLoading] = useState(false); + + async function handleEvaluate() { + if (!cv.trim()) { + alert("Please paste your CV."); + return; + } + + + setLoading(true); + + try { + const result = await evaluate({ + cv: { + content: cv, + format: "plaintext", + }, + jd: { + content: jd, + }, + }); + + saveEvaluationResult(result); + + router.push("/results"); + } catch (error) { + console.error(error); + alert("Evaluation failed."); + } finally { + setLoading(false); + } + } + + return ( +
+
+
+ + +