How saanvibsc/creditguard_ai_flask_prototype works
CreditGuard AI is a credit-risk analytics dashboard backed by Flask, a saved model, and portfolio data. Users review portfolio metrics, search customers, inspect risk assessments and alerts, explore segments, and generate reports; the Python console also exposes execution actions. The README documents backend API capabilities that remain important even where implementation excerpts are unavailable. Edges are limited to relationships visible in excerpts or documented in the README; several backend internals are represented at their exact top-level paths because their source was read but not excerpted.
Main entry points: App.tsx Dashboard shell · api.js API service · app.py Flask API · Dashboard.tsx Portfolio dashboard
Components 21
Dashboard interface
- Dashboard shell
src/App.tsx - Navigation
src/components/Sidebar.tsx - Top navigation
src/components/TopNav.tsx - Portfolio dashboard
src/components/Dashboard.tsx - Customer search
src/components/CustomerSearch.tsx - Risk assessment
src/components/RiskAssessment.tsx - Early-warning alerts
src/components/EarlyWarningAlerts.tsx - Customer segmentation
src/components/CustomerSegmentation.tsx - Risk reports
src/components/RiskReports.tsx - Python console
src/components/PythonEngine.tsx - Risk charts
src/components/charts/RiskCharts.tsx
Risk analytics
- PDF generator
src/utils/pdfGenerator.js - Risk scoring
src/utils/scoringEngine.js
Backend services
- API service
src/services/api.js - Flask API
app.py - Credit risk engine
creditguard_engine.py - Model training
train_model.py
Model and data
- Customer ledger
data/combined_credit_risk_realistic_with_ids.csv - Saved model
data/model.pkl - Demo datasets
src/data/mockData.js
Other components
- Credit analyst
Connections 28
- Credit analyst → Dashboard shell: uses dashboard
README.md - Dashboard shell → Top navigation: renders
src/App.tsx - Dashboard shell → Portfolio dashboard: renders
src/App.tsx - Dashboard shell → Customer search: renders
src/App.tsx - Dashboard shell → Risk assessment: renders
src/App.tsx - Dashboard shell → Early-warning alerts: renders
src/App.tsx - Dashboard shell → Customer segmentation: renders
src/App.tsx - Dashboard shell → Risk reports: renders
src/App.tsx - Dashboard shell → Python console: renders
src/App.tsx - Dashboard shell → Navigation: uses navigation
src/App.tsx - Customer search → API service: requests customer data
src/components/CustomerSearch.tsx - Portfolio dashboard → API service: requests portfolio data
src/components/Dashboard.tsx - Customer segmentation → API service: requests segments
src/components/CustomerSegmentation.tsx - Early-warning alerts → API service: requests alerts
src/components/EarlyWarningAlerts.tsx - Risk assessment → API service: requests predictions
src/components/RiskAssessment.tsx - Risk reports → API service: requests report data
src/components/RiskReports.tsx - Risk assessment → PDF generator: generates report
src/components/RiskAssessment.tsx - Risk reports → PDF generator: generates report
src/components/RiskReports.tsx - Portfolio dashboard → Risk charts: renders charts
src/components/Dashboard.tsx - API service → Risk scoring: calculates risk
src/services/api.js - API service → Demo datasets: loads demo data
src/services/api.js - API service → Flask API: calls API
src/services/api.js - Flask API → Credit risk engine: provides risk services
- Flask API → Customer ledger: loads customer data
README.md - Flask API → Saved model: loads model
README.md - Credit risk engine → Customer ledger: analyzes portfolio
- Model training → Saved model: creates model
- Python console → Flask API: posts training action
src/components/PythonEngine.tsx