Repository navigation
feat: extract business logic into src/use-cases/ (Clean Architecture) - #80
Closed
arnavgoel17 wants to merge 1 commit into
Closed
arnavgoel17 wants to merge 1 commit into
arnavgoel17 wants to merge 1 commit into
Conversation
- New directory with framework-agnostic pure functions: - : validators, ATS score, XP calc for tasks - : Gemini response parsing + XP mapping - : prompt builders + security checks - : minimal assertions covering all use-cases - Refactor to use + validators - Refactor to use + XP helpers - Refactor to use + - Refactor API routes to delegate prompt construction to use-cases - Update > prepverse@0.1.0 test > tsx src/use-cases/self-check.ts 🔎 Running use-cases self-check... ✓ resume-ats validators ✓ computeAtsScore ✓ computeInterviewXp ✓ computeTaskXp ✓ clamp ✓ extractScore ✓ parseEvaluation ✓ xpForInterviewScore ✓ nextCompletedToday ✓ hasMaliciousContent ✓ isPayloadTooLarge ✓ buildStudyPlanPrompt ✓ buildResumeReviewPrompt ✓ buildInterviewGradePrompt 🎉 All self-checks passed! to run the self-check Fixes pari-28#76
|
@arnavgoel17 is attempting to deploy a commit to the Pari's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
This pull request has been marked as stale because it has been inactive for 30 days. It will be closed in 7 days if no further activity occurs. |
|
Closing this pull request due to inactivity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Related Issue
Fixes #76
📝 Description
Extracts core business logic from presentation layer and API routes into a new
src/use-cases/directory implementing Clean Architecture pattern.New use-cases (framework-agnostic, fully unit-testable):
resume-ats.ts— email/phone/GitHub/LinkedIn validators, ATS compliance score, XP mapping for interviews & tasksinterview-grading.ts— parses Gemini raw evaluation text into structured score/pros/cons/reference; XP helpersai-prompts.ts— prompt builders for chat/study-plan/resume-review/interview-grade + prompt-injection blocklist + payload size guardself-check.ts— minimal assertions exercising all use-cases (runs vianpm test)Refactored consumers:
ResumeStudio.tsx→ usescomputeAtsScore+ imported validatorsInterviewHub.tsx→ usesparseEvaluation+xpForInterviewScore+nextCompletedTodayDashboard.tsx→ usescomputeTaskXp+clampserver.tsAPI routes → thin handlers delegating tobuildStudyPlanPrompt,buildResumeReviewPrompt,buildInterviewGradePrompt, security middleware useshasMaliciousContent+isPayloadTooLarge🚀 Type of Change
🧪 Testing
npm run lint— TypeScript type-check passesnpm run build— Vite + esbuild production build succeedsnpm test— All 14 self-check assertions pass:✅ Checklist