How kullayireddy/build-a-production-ready-credit-risk-loan-default-prediction-platform-from-scratch works
This is a web-based credit-risk scoring and monitoring platform, not the Python/FastAPI training system described in the README’s aspirational project brief. The user signs in, enters applicant attributes, receives a server-side model score and explanation, and the app saves the result for history and dashboard views. The sampled code supports model scoring, risk categorization, model-card data, and Supabase-backed prediction records. Training and experiment workflows are described in the README but are not represented in the supplied tree; unsampled implementation details are omitted.
Main entry points: credit.functions.ts Scoring server functions · predict.tsx Applicant predictor · dashboard.tsx Dashboard · predictions.ts Prediction history store
Components 17
Access and routing
- Sign-in page
src/routes/auth.tsx - Route map
src/routeTree.gen.ts - Authenticated route gate
src/routes/_authenticated/route.tsx - Supabase client
src/integrations/supabase/client.ts
Scoring and model
- Applicant predictor
src/routes/_authenticated/predict.tsx - Applicant field definitions
src/lib/credit-fields.ts - Scoring server functions
src/lib/credit.functions.ts - Credit model and explanations
src/lib/credit-model.server.ts
Prediction records
- Prediction history store
src/lib/predictions.ts - Supabase predictions database
Risk insights
- Authenticated app shell
src/components/app-shell.tsx - Dashboard
src/routes/_authenticated/dashboard.tsx - Explainability view
src/routes/_authenticated/explainability.tsx - Model performance view
src/routes/_authenticated/performance.tsx - History view
src/routes/_authenticated/history.tsx - Risk category badge
src/components/risk-badge.tsx
Other components
- Platform user
Connections 28
- Platform user → Sign-in page: signs in
src/routes/auth.tsx - Sign-in page → Supabase client: authenticates with
src/routes/auth.tsx - Route map → Authenticated route gate: routes to
src/routeTree.gen.ts - Authenticated route gate → Supabase client: checks session
src/routes/_authenticated/route.tsx - Platform user → Applicant predictor: submits applicant
src/routes/_authenticated/predict.tsx - Applicant predictor → Applicant field definitions: renders fields
src/routes/_authenticated/predict.tsx - Applicant predictor → Scoring server functions: requests score
src/routes/_authenticated/predict.tsx - Scoring server functions → Credit model and explanations: scores applicant
src/lib/credit.functions.ts - Scoring server functions → Credit model and explanations: loads model details
src/lib/credit.functions.ts - Applicant predictor → Prediction history store: saves result
src/routes/_authenticated/predict.tsx - Prediction history store → Supabase client: reads and writes
src/lib/predictions.ts - Platform user → Dashboard: views summary
- Dashboard → Scoring server functions: loads model info
src/routes/_authenticated/dashboard.tsx - Dashboard → Prediction history store: loads predictions
src/routes/_authenticated/dashboard.tsx - Platform user → Explainability view: views explanations
- Explainability view → Scoring server functions: loads model info
src/routes/_authenticated/explainability.tsx - Platform user → Model performance view: views performance
- Model performance view → Scoring server functions: loads metrics
src/routes/_authenticated/performance.tsx - Model performance view → Prediction history store: loads predictions
src/routes/_authenticated/performance.tsx - Platform user → History view: reviews history
- History view → Prediction history store: loads predictions
src/routes/_authenticated/history.tsx - Dashboard → Authenticated app shell: renders within
src/routes/_authenticated/dashboard.tsx - Explainability view → Authenticated app shell: renders within
src/routes/_authenticated/explainability.tsx - Model performance view → Authenticated app shell: renders within
src/routes/_authenticated/performance.tsx - History view → Authenticated app shell: renders within
src/routes/_authenticated/history.tsx - Dashboard → Risk category badge: shows risk category
src/routes/_authenticated/dashboard.tsx - History view → Risk category badge: shows risk category
src/routes/_authenticated/history.tsx - Applicant predictor → Risk category badge: shows scored risk
src/routes/_authenticated/predict.tsx