How codewithrishabh09/borrower-copilot works
Borrower Copilot is a client-side Indian loan self-assessment tool. A borrower starts an assessment, answers required and profile-dependent questions, and receives a rules-based analysis with borrowing guidance, affordability, rate/APR, and stress-test results; results also provide recommendations and a lender-facing Negotiation Card. The graph follows the documented workflow and source-indexed calls. Some page behavior and calculation details are unsampled, so uncertain links are omitted.
Main entry points: App.tsx App flow · borrowerAnalyzer.ts Borrower analyzer · Results.tsx Results screen · Questions.tsx Question screen
Components 23
Assessment experience
- App flow
src/App.tsx - Home screen
src/pages/Home.tsx - Question screen
src/pages/Questions.tsx - Analysis screen
src/pages/AnalyzingScreen.tsx - Session state
src/hooks/useLocalStorage.ts
Borrower inputs
- Question flow
src/engine/questionFlow.ts - Required questions
src/questions/mustQuestions.ts - Adaptive questions
src/questions/adaptiveQuestions.ts - Question controls
src/components/QuestionCard.tsx - Borrower profile
src/types/borrower.ts
Financial analysis
- Borrower analyzer
src/engine/borrowerAnalyzer.ts - Financial calculators
src/engine - Borrowing decision
src/rules/borrowingDecision.ts - Eligibility rules
src/rules/eligibility.ts - Rate rules
src/rules/interestRate.ts - Negotiation strategy
src/rules/negotiation.ts - Loan assumptions
src/data/loanProducts.ts
Results and guidance
- Results screen
src/pages/Results.tsx - Recommendations
src/engine/recommendationEngine.ts - Assessment summary
src/components/AssessmentSummary.tsx - Plan comparison
src/components/PlanComparison.tsx - Negotiation Card
src/components/NegotiationCard.tsx
Other components
- Borrower
Connections 25
- Borrower → Home screen: starts assessment
README.md - App flow → Home screen: shows
src/App.tsx - Home screen → App flow: starts
src/App.tsx - App flow → Question screen: shows
src/App.tsx - Question screen → Question flow: requests questions
src/pages/Questions.tsx - Question flow → Required questions: loads
src/engine/questionFlow.ts - Question flow → Adaptive questions: loads
src/engine/questionFlow.ts - Question screen → Question controls: renders
src/pages/Questions.tsx - Question screen → App flow: submits profile
src/App.tsx - App flow → Borrower profile: stores
src/App.tsx - App flow → Session state: persists state with
src/App.tsx - Session state → Borrower: reads and writes browser storage
src/hooks/useLocalStorage.ts - App flow → Analysis screen: shows
src/App.tsx - App flow → Borrower analyzer: analyzes profile with
src/App.tsx - Borrower analyzer → Financial calculators: calls calculations
src/engine/borrowerAnalyzer.ts - Borrower analyzer → Borrowing decision: evaluates decision with
src/engine/borrowerAnalyzer.ts - Borrower analyzer → Eligibility rules: checks eligibility with
src/engine/borrowerAnalyzer.ts - Borrower analyzer → Rate rules: estimates rate with
src/engine/borrowerAnalyzer.ts - Borrower analyzer → Negotiation strategy: generates strategy with
src/engine/borrowerAnalyzer.ts - Borrower analyzer → Loan assumptions: loads assumptions from
src/engine/borrowerAnalyzer.ts - App flow → Results screen: shows analysis
src/App.tsx - Results screen → Recommendations: generates
src/pages/Results.tsx - Results screen → Assessment summary: renders
src/pages/Results.tsx - Results screen → Plan comparison: renders
src/pages/Results.tsx - Results screen → Negotiation Card: renders
src/pages/Results.tsx