Small bits and bobs, codebase quality (#129)

* initial change

* nav highlighting

* icon change

* deeeedoooop

* text

* show version number on all pages

* icon

* remove unused code

* add knip

* formatting

* remove unused code

* types fix

* remove notion completely from the codebase.

* update test for new url structure

* clean up the fucking shop boys

* make a "create job" factory and use that

* moar factories

* formatting
This commit is contained in:
Shaheer Sarfaraz
2026-02-10 20:01:58 +00:00
committed by GitHub
parent 2962e0c2ae
commit fe0aebe01a
81 changed files with 1614 additions and 3137 deletions
-10
View File
@@ -52,18 +52,8 @@ export const updateSettingsSchema = z
.max(1000)
.nullable()
.optional(),
jobspyHoursOld: z.number().int().min(1).max(720).nullable().optional(),
jobspyCountryIndeed: z.string().trim().max(100).nullable().optional(),
jobspySites: z
.array(z.string().trim().min(1).max(50))
.max(20)
.nullable()
.optional(),
jobspyLinkedinFetchDescription: z.boolean().nullable().optional(),
jobspyIsRemote: z.boolean().nullable().optional(),
showSponsorInfo: z.boolean().nullable().optional(),
/** @deprecated Use llmApiKey instead. */
openrouterApiKey: z.string().trim().max(2000).nullable().optional(),
rxresumeEmail: z.string().trim().max(200).nullable().optional(),
rxresumePassword: z.string().trim().max(2000).nullable().optional(),
basicAuthUser: z.string().trim().max(200).nullable().optional(),
+210
View File
@@ -0,0 +1,210 @@
import type {
ApplicationTask,
AppSettings,
Job,
PipelineRun,
ResumeProjectCatalogItem,
StageEvent,
} from "../types";
export const createJob = (overrides: Partial<Job> = {}): Job => ({
id: "job-1",
source: "linkedin",
sourceJobId: null,
jobUrlDirect: null,
datePosted: null,
title: "Backend Engineer",
employer: "Acme Labs",
employerUrl: null,
jobUrl: "https://example.com/job-1",
applicationLink: "https://example.com/apply",
disciplines: null,
deadline: null,
salary: null,
location: "California",
degreeRequired: null,
starting: null,
jobDescription: "Job description content",
status: "ready",
outcome: null,
closedAt: null,
suitabilityScore: 90,
suitabilityReason: "Strong fit",
tailoredSummary: null,
tailoredHeadline: null,
tailoredSkills: null,
selectedProjectIds: null,
pdfPath: null,
sponsorMatchScore: null,
sponsorMatchNames: null,
jobType: null,
salarySource: null,
salaryInterval: null,
salaryMinAmount: null,
salaryMaxAmount: null,
salaryCurrency: null,
isRemote: null,
jobLevel: null,
jobFunction: null,
listingType: null,
emails: null,
companyIndustry: null,
companyLogo: null,
companyUrlDirect: null,
companyAddresses: null,
companyNumEmployees: null,
companyRevenue: null,
companyDescription: null,
skills: null,
experienceRange: null,
companyRating: null,
companyReviewsCount: null,
vacancyCount: null,
workFromHomeType: null,
discoveredAt: "2025-01-01T00:00:00Z",
processedAt: null,
appliedAt: null,
createdAt: "2025-01-01T00:00:00Z",
updatedAt: "2025-01-01T00:00:00Z",
...overrides,
});
export const createStageEvent = (
overrides: Partial<StageEvent> = {},
): StageEvent => ({
id: "event-1",
applicationId: "job-1",
title: "Moved to applied",
groupId: null,
fromStage: null,
toStage: "applied",
occurredAt: Date.now(),
metadata: null,
outcome: null,
...overrides,
});
export const createApplicationTask = (
overrides: Partial<ApplicationTask> = {},
): ApplicationTask => ({
id: "task-1",
applicationId: "job-1",
type: "todo",
title: "Follow up",
dueDate: null,
isCompleted: false,
notes: null,
...overrides,
});
export const createPipelineRun = (
overrides: Partial<PipelineRun> = {},
): PipelineRun => ({
id: "run-1",
startedAt: "2025-01-01T00:00:00Z",
completedAt: null,
status: "running",
jobsDiscovered: 0,
jobsProcessed: 0,
errorMessage: null,
...overrides,
});
export const createResumeProjectCatalogItem = (
overrides: Partial<ResumeProjectCatalogItem> = {},
): ResumeProjectCatalogItem => ({
id: "p1",
name: "Project 1",
description: "Description 1",
date: "2024",
isVisibleInBase: true,
...overrides,
});
export const createAppSettings = (
overrides: Partial<AppSettings> = {},
): AppSettings => ({
model: "gpt-4o",
defaultModel: "gpt-4o",
overrideModel: null,
modelScorer: "gpt-4o",
overrideModelScorer: null,
modelTailoring: "gpt-4o",
overrideModelTailoring: null,
modelProjectSelection: "gpt-4o",
overrideModelProjectSelection: null,
llmProvider: "openai",
defaultLlmProvider: "openai",
overrideLlmProvider: null,
llmBaseUrl: "https://api.openai.com/v1",
defaultLlmBaseUrl: "https://api.openai.com/v1",
overrideLlmBaseUrl: null,
pipelineWebhookUrl: "",
defaultPipelineWebhookUrl: "",
overridePipelineWebhookUrl: null,
jobCompleteWebhookUrl: "",
defaultJobCompleteWebhookUrl: "",
overrideJobCompleteWebhookUrl: null,
profileProjects: [],
resumeProjects: {
maxProjects: 3,
lockedProjectIds: [],
aiSelectableProjectIds: [],
},
defaultResumeProjects: {
maxProjects: 3,
lockedProjectIds: [],
aiSelectableProjectIds: [],
},
overrideResumeProjects: null,
rxresumeBaseResumeId: null,
ukvisajobsMaxJobs: 50,
defaultUkvisajobsMaxJobs: 50,
overrideUkvisajobsMaxJobs: null,
gradcrackerMaxJobsPerTerm: 50,
defaultGradcrackerMaxJobsPerTerm: 50,
overrideGradcrackerMaxJobsPerTerm: null,
searchTerms: ["Software Engineer"],
defaultSearchTerms: ["Software Engineer"],
overrideSearchTerms: null,
jobspyLocation: "United Kingdom",
defaultJobspyLocation: "United Kingdom",
overrideJobspyLocation: null,
jobspyResultsWanted: 20,
defaultJobspyResultsWanted: 20,
overrideJobspyResultsWanted: null,
jobspyCountryIndeed: "united kingdom",
defaultJobspyCountryIndeed: "united kingdom",
overrideJobspyCountryIndeed: null,
showSponsorInfo: true,
defaultShowSponsorInfo: true,
overrideShowSponsorInfo: null,
llmApiKeyHint: null,
rxresumeEmail: null,
rxresumePasswordHint: null,
basicAuthUser: null,
basicAuthPasswordHint: null,
ukvisajobsEmail: null,
ukvisajobsPasswordHint: null,
webhookSecretHint: null,
basicAuthActive: false,
backupEnabled: false,
defaultBackupEnabled: false,
overrideBackupEnabled: null,
backupHour: 3,
defaultBackupHour: 3,
overrideBackupHour: null,
backupMaxCount: 7,
defaultBackupMaxCount: 7,
overrideBackupMaxCount: null,
penalizeMissingSalary: false,
defaultPenalizeMissingSalary: false,
overridePenalizeMissingSalary: null,
missingSalaryPenalty: 10,
defaultMissingSalaryPenalty: 10,
overrideMissingSalaryPenalty: null,
autoSkipScoreThreshold: null,
defaultAutoSkipScoreThreshold: null,
overrideAutoSkipScoreThreshold: null,
...overrides,
});
+1 -17
View File
@@ -6,7 +6,7 @@ export type JobStatus =
| "discovered" // Crawled but not processed
| "processing" // Currently generating resume
| "ready" // PDF generated, waiting for user to apply
| "applied" // User marked as applied (added to Notion)
| "applied" // User marked as applied
| "skipped" // User skipped this job
| "expired"; // Deadline passed
@@ -160,7 +160,6 @@ export interface Job {
tailoredSkills: string | null; // Generated resume skills (JSON)
selectedProjectIds: string | null; // Comma-separated IDs of selected projects
pdfPath: string | null; // Path to generated PDF
notionPageId: string | null; // Notion page ID if synced
sponsorMatchScore: number | null; // 0-100 fuzzy match score with visa sponsors
sponsorMatchNames: string | null; // JSON array of matched sponsor names (when 100% matches or top match)
@@ -314,7 +313,6 @@ export interface UpdateJobInput {
tailoredSkills?: string;
selectedProjectIds?: string;
pdfPath?: string;
notionPageId?: string;
appliedAt?: string;
sponsorMatchScore?: number;
sponsorMatchNames?: string;
@@ -601,27 +599,13 @@ export interface AppSettings {
jobspyResultsWanted: number;
defaultJobspyResultsWanted: number;
overrideJobspyResultsWanted: number | null;
jobspyHoursOld: number;
defaultJobspyHoursOld: number;
overrideJobspyHoursOld: number | null;
jobspyCountryIndeed: string;
defaultJobspyCountryIndeed: string;
overrideJobspyCountryIndeed: string | null;
jobspySites: string[];
defaultJobspySites: string[];
overrideJobspySites: string[] | null;
jobspyLinkedinFetchDescription: boolean;
defaultJobspyLinkedinFetchDescription: boolean;
overrideJobspyLinkedinFetchDescription: boolean | null;
jobspyIsRemote: boolean;
defaultJobspyIsRemote: boolean;
overrideJobspyIsRemote: boolean | null;
showSponsorInfo: boolean;
defaultShowSponsorInfo: boolean;
overrideShowSponsorInfo: boolean | null;
llmApiKeyHint: string | null;
/** @deprecated Use llmApiKeyHint instead. */
openrouterApiKeyHint: string | null;
rxresumeEmail: string | null;
rxresumePasswordHint: string | null;
basicAuthUser: string | null;