How aryannehe/loanr works
PLRS is a personalized loan recommendation product: the user supplies a financial profile, optional portfolio, loan requirement and risk appetite, then receives a ranked decision or an explicit no-suitable-loan outcome with alternatives, risk, trace and explanation. Its central workflow runs deterministic financial and portfolio analysis, eligibility and candidate generation before risk and suitability scoring; deterministic validation and guardrails then accept or block ranked options. The React UI submits requests to FastAPI and presents results. The README documents the major stages and capabilities; some implementation links, notably the India rates service, are not established by the excerpts and are left unverified.
Main entry points: recommendation.py Recommendation orchestration · routes.py FastAPI routes · App.tsx Loan workflow UI · client.ts API client
Components 27
User interface
- Loan workflow UI
frontend/src/App.tsx - Profile entry
frontend/src/screens/ProfileForm.tsx - Portfolio entry
frontend/src/screens/PortfolioForm.tsx - Loan requirement
frontend/src/screens/RequirementForm.tsx - API client
frontend/src/api/client.ts - Decision results
frontend/src/screens/ResultsScreen.tsx - Bank rates panel
frontend/src/components/IndiaBankRates.tsx
API surface
- FastAPI routes
app/api/routes.py - Loan catalogue
app/api/catalogue.py - India rates service
app/india
Decision pipeline
- Financial analysis
app/core/financial.py - Portfolio analysis
app/core/portfolio.py - Eligibility rules
app/core/eligibility.py - Candidate generation
app/core/candidates.py - Finance calculations
app/core/finance_math.py - Recommendation orchestration
app/core/recommendation.py - Candidate validation
app/core/validation.py - Safety guardrails
app/core/guardrails.py
Scoring and explanation
- Risk prediction
app/ml/risk.py - Feature assembly
app/ml/features.py - Suitability ranking
app/ml/recommender.py - Feature contributions
app/explain/xai.py - Natural-language explanation
app/explain/llm.py
Personalization and state
- Personalization context
app/personalization/context.py - Pseudonymous history
app/personalization/store.py - Recommendation logging
app/storage/mongo_log.py
Other components
- Loan applicant
Connections 31
- Loan applicant → Loan workflow UI: enters details
- Loan workflow UI → Profile entry: collects profile
frontend/src/App.tsx - Loan workflow UI → Portfolio entry: collects portfolio
frontend/src/App.tsx - Loan workflow UI → Loan requirement: collects requirement
frontend/src/App.tsx - Loan workflow UI → API client: submits request
frontend/src/App.tsx - API client → FastAPI routes: sends request
- FastAPI routes → Recommendation orchestration: requests decision
app/api/routes.py - FastAPI routes → Financial analysis: analyzes finances
app/api/routes.py - FastAPI routes → Portfolio analysis: analyzes portfolio
app/api/routes.py - FastAPI routes → Loan catalogue: loads products
app/api/catalogue.py - Recommendation orchestration → Financial analysis: derives metrics
app/core/recommendation.py - Recommendation orchestration → Portfolio analysis: derives metrics
app/core/recommendation.py - Recommendation orchestration → Personalization context: loads preferences
app/core/recommendation.py - Personalization context → Pseudonymous history: reads history
app/personalization/context.py - Recommendation orchestration → Eligibility rules: checks products
app/core/recommendation.py - Recommendation orchestration → Candidate generation: generates options
app/core/recommendation.py - Candidate generation → Finance calculations: computes EMI
app/core/candidates.py - Recommendation orchestration → Risk prediction: predicts risk
app/core/recommendation.py - Recommendation orchestration → Suitability ranking: ranks candidates
app/core/recommendation.py - Suitability ranking → Feature assembly: assembles features
app/ml/recommender.py - Recommendation orchestration → Candidate validation: checks ranked options
app/core/recommendation.py - Recommendation orchestration → Safety guardrails: enforces caps
app/core/recommendation.py - Recommendation orchestration → Feature contributions: requests contributions
- Recommendation orchestration → Natural-language explanation: requests explanation
- Natural-language explanation → Loan applicant: explains decision
- Recommendation orchestration → FastAPI routes: returns decision
app/api/routes.py - FastAPI routes → Recommendation logging: logs session
app/api/routes.py - FastAPI routes → Decision results: returns result
- Loan workflow UI → Decision results: shows outcome
frontend/src/App.tsx - Loan workflow UI → Bank rates panel: displays rates
frontend/src/App.tsx - FastAPI routes → India rates service: serves rate data
app/api/routes.py