Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

Bug fixes

Khuram Niazf63a9d835ca3
diff --git a/e2e/profile.spec.ts b/e2e/profile.spec.ts
index 2ef1090..2e5ebbd 100644
--- a/e2e/profile.spec.ts
+++ b/e2e/profile.spec.ts
@@ -28,6 +28,9 @@ test.describe("Profile page", () => {
);
await expect(page.locator("tbody")).toContainText(resumeTitle);
await deleteResume(page, resumeTitle);
+ await expect(page.getByRole("status").first()).toContainText(
+ /Resume has been deleted successfully/
+ );
});
test("should edit the resume title", async ({ page, baseURL }) => {
@@ -54,6 +57,9 @@ test.describe("Profile page", () => {
);
await expect(page.locator("tbody")).toContainText(editedTitle);
await deleteResume(page, editedTitle);
+ await expect(page.getByRole("status").first()).toContainText(
+ /Resume has been deleted successfully/
+ );
});
test("should add resume contact info", async ({ page }) => {
const resumeTitle = "Test Resume 3";
@@ -87,6 +93,9 @@ test.describe("Profile page", () => {
);
await expect(page.getByRole("heading", { name: "John Doe" })).toBeVisible();
await deleteResume(page, resumeTitle);
+ await expect(page.getByRole("status").first()).toContainText(
+ /Resume has been deleted successfully/
+ );
});
test("should add resume summary section", async ({ page }) => {
@@ -112,6 +121,9 @@ test.describe("Profile page", () => {
/Summary has been created/
);
await deleteResume(page, resumeTitle);
+ await expect(page.getByRole("status").first()).toContainText(
+ /Resume has been deleted successfully/
+ );
});
test("should add resume work experience section", async ({ page }) => {
@@ -119,75 +131,51 @@ test.describe("Profile page", () => {
const jobText = "Software Developer";
await page.getByRole("link", { name: "Profile" }).click();
await createResume(page, resumeTitle);
+ await addExperience(page, resumeTitle, jobText);
+ await expect(page.getByRole("status").first()).toContainText(
+ /Experience has been added/
+ );
+ await expect(page.getByRole("heading", { name: jobText })).toBeVisible();
+ await deleteResume(page, resumeTitle);
+ await expect(page.getByRole("status").first()).toContainText(
+ /Resume has been deleted successfully/
+ );
+ });
+
+ test("should add resume work experience after clicking Edit Experience section", async ({
+ page,
+ }) => {
+ const resumeTitle = "Test Resume 6";
+ const jobText = "Software Developer";
+ await page.getByRole("link", { name: "Profile" }).click();
+ await createResume(page, resumeTitle);
+ await addExperience(page, resumeTitle, jobText);
+ await expect(page.getByRole("status").first()).toContainText(
+ /Experience has been added/
+ );
+ await expect(page.getByRole("heading", { name: jobText })).toBeVisible();
await page
- .getByRole("row", { name: new RegExp(resumeTitle, "i") })
- .first()
- .getByTestId("resume-actions-menu-btn")
+ .getByText(jobText + "Edit")
+ .getByRole("button", { name: "Edit" })
.click();
- await page.getByRole("link", { name: "View/Edit Resume" }).click();
- await expect(page.getByRole("heading", { name: "Resume" })).toBeVisible();
+ await expect(
+ page.getByRole("heading", { name: "Edit Experience" })
+ ).toBeVisible();
+ await page.getByText("Cancel").click();
await page.getByRole("button", { name: "Add Section" }).click();
await page.getByRole("menuitem", { name: "Add Experience" }).click();
- await page.getByPlaceholder("Ex: Experience").fill("Experience");
- await page.getByPlaceholder("Ex: Experience").press("Tab");
- await page.getByLabel("Job Title").click();
- await page.getByPlaceholder("Create or Search title").click();
- await page.getByPlaceholder("Create or Search title").fill(jobText);
- const jobTitle = page.getByRole("option", {
- name: jobText,
- exact: true,
- });
- if (await jobTitle.isVisible()) {
- await jobTitle.click();
- } else {
- await page.getByText(jobText).click();
- }
- await expect(page.getByLabel("Job Title")).toContainText(jobText);
- await page.getByLabel("Company").click();
- await page.getByPlaceholder("Create or Search company").click();
- const companyText = "company test";
- await page.getByPlaceholder("Create or Search company").fill(companyText);
- const companyTitle = page.getByRole("option", {
- name: companyText,
- exact: true,
- });
- if (await companyTitle.isVisible()) {
- await companyTitle.click();
- } else {
- await page.getByText(companyText).click();
- }
- await expect(page.getByLabel("Company")).toContainText(companyText);
- await page.getByLabel("Job Location").click();
- await page.getByPlaceholder("Create or Search location").click();
- const locationText = "location test";
- await page.getByPlaceholder("Create or Search location").fill(locationText);
- const locationTitle = page.getByRole("option", {
- name: locationText,
- exact: true,
- });
- if (await locationTitle.isVisible()) {
- await locationTitle.click();
- } else {
- await page.getByText(locationText).click();
- }
- await expect(page.getByLabel("Job Location")).toContainText(locationText);
- await page.getByLabel("Start Date").click();
- await page
- .getByRole("gridcell", { name: "2", exact: true })
- .first()
- .click();
- await page.locator("div:nth-child(2) > .tiptap").click();
- await page.locator("div:nth-child(2) > .tiptap").fill("test description");
- await page.getByRole("button", { name: "Save" }).click();
+ await expect(
+ page.getByRole("heading", { name: "Add Experience" })
+ ).toBeVisible();
+ await page.getByText("Cancel").click();
+ await deleteResume(page, resumeTitle);
await expect(page.getByRole("status").first()).toContainText(
- /Experience has been added/
+ /Resume has been deleted successfully/
);
- await expect(page.getByRole("heading", { name: jobText })).toBeVisible();
- await deleteResume(page, resumeTitle);
});
test("should add resume education section", async ({ page }) => {
- const resumeTitle = "Test Resume 6";
+ const resumeTitle = "Test Resume 7";
const degreeText = "Bachelor of Science";
await page.getByRole("link", { name: "Profile" }).click();
await createResume(page, resumeTitle);
@@ -239,17 +227,72 @@ test.describe("Profile page", () => {
page.getByRole("heading", { name: "test school" })
).toBeVisible();
await deleteResume(page, resumeTitle);
+ await expect(page.getByRole("status").first()).toContainText(
+ /Resume has been deleted successfully/
+ );
});
-
- // test("should delete a resume", async ({ page }) => {
- // await deleteResume(page, editedTitle);
- // await expect(page.getByRole("status").first()).toContainText(
- // /Resume has been deleted successfully/
- // );
- // await expect(page.locator("tbody")).not.toContainText(editedTitle);
- // });
});
+async function addExperience(page: Page, resumeTitle: string, jobText: string) {
+ await page
+ .getByRole("row", { name: new RegExp(resumeTitle, "i") })
+ .first()
+ .getByTestId("resume-actions-menu-btn")
+ .click();
+ await page.getByRole("link", { name: "View/Edit Resume" }).click();
+ await expect(page.getByRole("heading", { name: "Resume" })).toBeVisible();
+ await page.getByRole("button", { name: "Add Section" }).click();
+ await page.getByRole("menuitem", { name: "Add Experience" }).click();
+ await page.getByPlaceholder("Ex: Experience").fill("Experience");
+ await page.getByPlaceholder("Ex: Experience").press("Tab");
+ await page.getByLabel("Job Title").click();
+ await page.getByPlaceholder("Create or Search title").click();
+ await page.getByPlaceholder("Create or Search title").fill(jobText);
+ const jobTitle = page.getByRole("option", {
+ name: jobText,
+ exact: true,
+ });
+ if (await jobTitle.isVisible()) {
+ await jobTitle.click();
+ } else {
+ await page.getByText(jobText).click();
+ }
+ await expect(page.getByLabel("Job Title")).toContainText(jobText);
+ await page.getByLabel("Company").click();
+ await page.getByPlaceholder("Create or Search company").click();
+ const companyText = "company test";
+ await page.getByPlaceholder("Create or Search company").fill(companyText);
+ const companyTitle = page.getByRole("option", {
+ name: companyText,
+ exact: true,
+ });
+ if (await companyTitle.isVisible()) {
+ await companyTitle.click();
+ } else {
+ await page.getByText(companyText).click();
+ }
+ await expect(page.getByLabel("Company")).toContainText(companyText);
+ await page.getByLabel("Job Location").click();
+ await page.getByPlaceholder("Create or Search location").click();
+ const locationText = "location test";
+ await page.getByPlaceholder("Create or Search location").fill(locationText);
+ const locationTitle = page.getByRole("option", {
+ name: locationText,
+ exact: true,
+ });
+ if (await locationTitle.isVisible()) {
+ await locationTitle.click();
+ } else {
+ await page.getByText(locationText).click();
+ }
+ await expect(page.getByLabel("Job Location")).toContainText(locationText);
+ await page.getByLabel("Start Date").click();
+ await page.getByRole("gridcell", { name: "2", exact: true }).first().click();
+ await page.locator("div:nth-child(2) > .tiptap").click();
+ await page.locator("div:nth-child(2) > .tiptap").fill("test description");
+ await page.getByRole("button", { name: "Save" }).click();
+}
+
async function deleteResume(page: Page, title: string) {
await page.getByRole("link", { name: "Profile" }).click();
await page
diff --git a/src/actions/ai.actions.ts b/src/actions/ai.actions.ts
index 2cb0656..76b2cfe 100644
--- a/src/actions/ai.actions.ts
+++ b/src/actions/ai.actions.ts
@@ -80,17 +80,14 @@ export const getJobMatchByAi = async (
modelProvider?: string
): Promise<any | undefined> => {
const resumeText = await convertResumeToText(resume);
+
const jobText = await convertJobToText(job);
const prompt = ChatPromptTemplate.fromMessages([
[
"system",
`
- You are an expert assistant tasked with matching job seekers' resumes with job descriptions and providing suggestions to improve their resumes.
- You will analyze the given resume and job description, provide a matching score between 0 and 100,
- score will be based on application tracking system (ATS) friendliness and skill and keywords match,
- and suggest improvements to increase the matching score and make the resume more aligned with the job description.
- Be verbose and highlight details in your response.
+ You are an expert assistant tasked with matching job seekers' resumes with job descriptions and providing suggestions to improve their resumes. You will analyze the given resume and job description, provide a matching score between 0 and 100, score will be based on application tracking system (ATS) friendliness and skill and keywords match, and suggest improvements to increase the matching score and make the resume more aligned with the job description. Be verbose and highlight details in your response.
Your response must always return JSON object with following structure:
@@ -114,13 +111,13 @@ export const getJobMatchByAi = async (
"value": ["<missing keywords not found in resume>", "<missing skill not found in resume>",...],
<<example 2>>
"category": "Format for clarity and ATS optimization:",
- "value": ["<suggested_change 1>", "<suggested_change 2>",...],
+ "value": ["<change 1>", "<change 2>",...],
<<example 3>>
"category": "Enhancement for relevant experience:",
- "value": ["<suggested_change 1>", "<suggested_change 2>",...],
+ "value": ["<change 1>", "<change 2>",...],
"additional_comments": summary of recommendations as array of strings.
<<example>>
- ["<brief summary description>"],
+ ["<comments>"],
`,
],
[
@@ -142,14 +139,17 @@ export const getJobMatchByAi = async (
]);
const inputMessage = await prompt.format({
- resume: resumeText,
+ resume: resumeText || "No resume provided",
job_description: jobText,
});
+ console.log("input message length", inputMessage.length);
const model = new ChatOllama({
baseUrl: process.env.OLLAMA_BASE_URL || "http://127.0.0.1:11434",
model: "llama3.1",
temperature: 0,
format: "json",
+ maxConcurrency: 1,
+ numCtx: 3000,
});
const stream = await model
diff --git a/src/actions/profile.actions.ts b/src/actions/profile.actions.ts
index 3efb1d1..736799a 100644
--- a/src/actions/profile.actions.ts
+++ b/src/actions/profile.actions.ts
@@ -388,6 +388,11 @@ export const addExperience = async (
if (!user) {
throw new Error("Not authenticated");
}
+
+ if (!data.sectionId && !data.sectionTitle) {
+ throw new Error("SectionTitle is required.");
+ }
+
const section = !data.sectionId
? await prisma.resumeSection.create({
data: {
@@ -415,7 +420,7 @@ export const addExperience = async (
},
},
});
- revalidatePath("/dashboard/profile/resume/[id]");
+ revalidatePath("/dashboard/profile/resume/[id]", "page");
return { data: experience, success: true };
} catch (error) {
const msg = "Failed to create experience.";
diff --git a/src/components/ComboBox.tsx b/src/components/ComboBox.tsx
index bb74a19..5d37c2f 100644
--- a/src/components/ComboBox.tsx
+++ b/src/components/ComboBox.tsx
@@ -97,7 +97,11 @@ export function Combobox({ options, field, creatable }: ComboboxProps) {
</FormControl>
</PopoverTrigger>
<PopoverContent className="md:w-[240px] lg:w-[280px] p-0">
- <Command filter={(value, search) => (value.includes(search) ? 1 : 0)}>
+ <Command
+ filter={(value, search) =>
+ value.includes(search.toLowerCase()) ? 1 : 0
+ }
+ >
<CommandInput
value={newOption}
onValueChange={(val: string) => setNewOption(val)}
diff --git a/src/components/admin/AddCompany.tsx b/src/components/admin/AddCompany.tsx
index 0f29633..264ebff 100644
--- a/src/components/admin/AddCompany.tsx
+++ b/src/components/admin/AddCompany.tsx
@@ -160,15 +160,16 @@ function AddCompany({
<DialogFooter
// className="md:col-span
>
- <DialogClose>
+ <div>
<Button
type="reset"
variant="outline"
className="mt-2 md:mt-0 w-full"
+ onClick={() => setDialogOpen(false)}
>
Cancel
</Button>
- </DialogClose>
+ </div>
<Button type="submit" disabled={!formState.isDirty}>
Save
{isPending && (
diff --git a/src/components/profile/AddResumeSection.tsx b/src/components/profile/AddResumeSection.tsx
index 7d57816..be99c33 100644
--- a/src/components/profile/AddResumeSection.tsx
+++ b/src/components/profile/AddResumeSection.tsx
@@ -112,13 +112,23 @@ const AddResumeSection = forwardRef<AddResumeSectionRef, AddResumeSectionProps>(
</DropdownMenuItem>
<DropdownMenuItem
className="cursor-pointer"
- onClick={() => setExperienceDialogOpen(true)}
+ onClick={() => {
+ if (experienceToEdit) {
+ resetExperienceToEdit();
+ }
+ setExperienceDialogOpen(true);
+ }}
>
Add Experience
</DropdownMenuItem>
<DropdownMenuItem
className="cursor-pointer"
- onClick={() => setEducationDialogOpen(true)}
+ onClick={() => {
+ if (educationToEdit) {
+ resetEducationToEdit();
+ }
+ setEducationDialogOpen(true);
+ }}
>
Add Education
</DropdownMenuItem>
diff --git a/src/components/profile/AiJobMatchSection.tsx b/src/components/profile/AiJobMatchSection.tsx
index 6a38506..3cdd31e 100644
--- a/src/components/profile/AiJobMatchSection.tsx
+++ b/src/components/profile/AiJobMatchSection.tsx
@@ -68,13 +68,13 @@ export const AiJobMatchSection = ({
const getJobMatch = async (resumeId: string, jobId: string) => {
try {
setLoading(true);
- setAIContent("");
// if (
- // abortControllerRef.current &&
- // (await readerRef?.current?.closed) === false
+ // abortControllerRef.current
+ // // && (await readerRef?.current?.closed) === false
// ) {
- // return await abortStream();
+ // await abortStream();
// }
+ setAIContent("");
const abortController = new AbortController();
abortControllerRef.current = abortController;
@@ -130,11 +130,9 @@ export const AiJobMatchSection = ({
const onSelectResume = async (resumeId: string) => {
setSelectedResumeId(resumeId);
- // if getting job match response clear first
await getJobMatch(resumeId, jobId);
};
useEffect(() => {
- console.log("job match rendered");
getResumes();
}, []);
return (
@@ -144,26 +142,28 @@ export const AiJobMatchSection = ({
<SheetHeader>
<SheetTitle>AI Job Match</SheetTitle>
</SheetHeader>
- <div className="mt-4">
- <Select value={selectedResumeId} onValueChange={onSelectResume}>
- <SelectTrigger className="w-[180px]">
- <SelectValue placeholder="Select a resume" />
- </SelectTrigger>
- <SelectContent>
- <SelectGroup>
- {resumesRef.current.map((resume) => (
- <SelectItem
- key={resume.id}
- value={resume.id!}
- className="capitalize"
- >
- {resume.title}
- </SelectItem>
- ))}
- </SelectGroup>
- </SelectContent>
- </Select>
- </div>
+ {!selectedResumeId && (
+ <div className="mt-4">
+ <Select value={selectedResumeId} onValueChange={onSelectResume}>
+ <SelectTrigger className="w-[180px]">
+ <SelectValue placeholder="Select a resume" />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectGroup>
+ {resumesRef.current.map((resume) => (
+ <SelectItem
+ key={resume.id}
+ value={resume.id!}
+ className="capitalize"
+ >
+ {resume.title}
+ </SelectItem>
+ ))}
+ </SelectGroup>
+ </SelectContent>
+ </Select>
+ </div>
+ )}
<div className="mt-2">
{loading ? (
<div className="flex items-center flex-col">
@@ -173,6 +173,9 @@ export const AiJobMatchSection = ({
) : (
<>
<AiJobMatchResponseContent content={aIContent} />
+ <pre className="mt-2 w-[340px] rounded-md bg-slate-950 p-4">
+ <code className="text-white">{aIContent}</code>
+ </pre>
</>
)}
</div>
diff --git a/src/models/AddEductionForm.schema.ts b/src/models/AddEductionForm.schema.ts
index 3645c1e..b087013 100644
--- a/src/models/AddEductionForm.schema.ts
+++ b/src/models/AddEductionForm.schema.ts
@@ -28,7 +28,7 @@ export const AddEducationFormSchema = z.object({
.min(2, {
message: "Location name must be at least 2 characters.",
}),
- description: z.string().optional(),
+ description: z.string().nullable().optional(),
startDate: z.date(),
endDate: z.date().nullable().optional(),
degreeCompleted: z.boolean().default(true).optional(),
diff --git a/src/utils/ai.utils.ts b/src/utils/ai.utils.ts
index c20c51d..efcc468 100644
--- a/src/utils/ai.utils.ts
+++ b/src/utils/ai.utils.ts
@@ -8,6 +8,11 @@ import {
WorkExperience,
} from "@/models/profile.model";
+const removeHtmlTags = (description: string | undefined): string => {
+ if (!description) return "N/A";
+ return description.replace(/<[^>]+>/g, "");
+};
+
export const convertResumeToText = (resume: Resume): Promise<string> => {
return new Promise((resolve) => {
const formatContactInfo = (contactInfo?: ContactInfo) => {
@@ -29,7 +34,7 @@ export const convertResumeToText = (resume: Resume): Promise<string> => {
Company: ${experience.Company.label}
Job Title: ${experience.jobTitle.label}
Location: ${experience.location.label}
- Description: ${experience.description}
+ Description: ${removeHtmlTags(experience.description)}
`
)
.join("\n");
@@ -50,8 +55,8 @@ export const convertResumeToText = (resume: Resume): Promise<string> => {
Institution: ${education.institution}
Degree: ${education.degree}
Field of Study: ${education.fieldOfStudy}
- Location: ${education.location}
- Description: ${education.description || "N/A"}
+ Location: ${education.location.label}
+ Description: ${removeHtmlTags(education.description)}
`
)
// Start Date: ${education.startDate.toLocaleDateString().split("T")[0]}
@@ -70,7 +75,7 @@ export const convertResumeToText = (resume: Resume): Promise<string> => {
.map((section) => {
switch (section.sectionType) {
case SectionType.SUMMARY:
- return `Summary: ${section.summary?.content || "N/A"}`;
+ return `Summary: ${removeHtmlTags(section.summary?.content)}`;
case SectionType.EXPERIENCE:
return formatWorkExperiences(section.workExperiences);
case SectionType.EDUCATION:
@@ -100,14 +105,12 @@ export const convertJobToText = (job: JobResponse): Promise<string> => {
Company: { label: companyName },
Location: { label: location },
} = job;
- // Remove HTML tags from the description
- const plainDescription = description.replace(/<[^>]+>/g, "");
const jobText = `
Job Title: ${jobTitle}
Company: ${companyName}
Location: ${location}
- Description: ${plainDescription}
+ Description: ${removeHtmlTags(description)}
`;
return resolve(jobText);