How its-varun-2/trust-flow works
TrustFlow is an adaptive fraud-protection experience for safer beneficiary setup and transfers. A user signs in, manages trusted contacts and payees, then starts a transfer that is risk-evaluated and routed into low-, medium-, or high-risk handling; high-risk handling can require security answers or nominee approval and dispatch an alert. The frontend also provides account/security views, onboarding, simulation, and English/Hindi/Tamil translations. The README documents SMS/social-engineering analysis and caller-ID guidance, but the supplied tree does not identify their implementation. Backend and unsampled UI links are included only where the index or README supports them.
Main entry points: App.tsx Application shell · TransferModal.tsx Transfer entry · app.ts API router · TrustFlowContext.tsx Application state
Components 33
User experience
- Application shell
src/App.tsx - Sign-in
src/components/auth/LoginPage.tsx - Dashboard
src/components/desktop/DashboardLayout.tsx - Account overview
src/components/shell/AccountOverview.tsx - Beneficiary list
src/components/payee/BeneficiaryList.tsx - Add beneficiary
src/components/payee/AddPayeeModal.tsx - Trusted contact setup
src/components/onboarding/OnboardingModal.tsx - Risk simulator
src/components/simulator/SimulatorBar.tsx - API activity panel
src/components/debug/DebugPanel.tsx
Transfer protection
- Transfer entry
src/components/transfer/TransferModal.tsx - Risk evaluation hook
src/hooks/useRiskEvaluate.ts - Risk API client
src/api/riskApi.ts - Risk scoring
server/src/services/riskEngine.ts - Low-risk handling
src/components/transfer/LowRiskFlow.tsx - Medium-risk handling
src/components/transfer/MediumRiskFlow.tsx - High-risk verification
src/components/transfer/HighRiskVerificationModal.tsx - Alert dispatch client
src/api/alertService.ts - Payee verification hook
src/hooks/usePayeeVerify.ts - Payee API client
src/api/payeeApi.ts - Scam-safety guidance
API services
- Risk endpoint
server/src/routes/risk.ts - Alert endpoint
server/src/routes/alerts.ts - Alert service
server/src/services/alertService.ts - Payee endpoint
server/src/routes/payee.ts - Payee verification
server/src/services/payeeService.ts - Authentication endpoint
server/src/routes/auth.ts - Authentication service
server/src/services/authService.ts - Token middleware
server/src/middleware/auth.ts - API router
server/src/app.ts - HTTP client
src/api/client.ts
Shared state and language
- Application state
src/context/TrustFlowContext.tsx - Translations
src/i18n/index.ts
Other components
- Banking user
Connections 41
- Banking user → Application shell: uses
src/App.tsx - Application shell → Application state: reads state
src/App.tsx - Application shell → Sign-in: shows when signed out
src/App.tsx - Application shell → Dashboard: renders
src/App.tsx - Application shell → Account overview: renders
src/App.tsx - Application shell → Beneficiary list: renders
src/App.tsx - Application shell → Transfer entry: opens
src/App.tsx - Application shell → Trusted contact setup: renders
src/App.tsx - Application shell → Risk simulator: renders
src/App.tsx - Application shell → API activity panel: renders
src/App.tsx - Beneficiary list → Add beneficiary: opens
src/components/payee/BeneficiaryList.tsx - Add beneficiary → Payee verification hook: uses
src/components/payee/AddPayeeModal.tsx - Payee verification hook → Payee API client: calls
src/hooks/usePayeeVerify.ts - Payee API client → HTTP client: sends requests
src/api/payeeApi.ts - Transfer entry → Risk evaluation hook: evaluates risk
src/components/transfer/TransferModal.tsx - Risk evaluation hook → Risk API client: calls
src/hooks/useRiskEvaluate.ts - Risk API client → HTTP client: sends requests
src/api/riskApi.ts - Risk evaluation hook → Application state: updates result and step
src/hooks/useRiskEvaluate.ts - Transfer entry → Low-risk handling: renders
src/components/transfer/TransferModal.tsx - Transfer entry → Medium-risk handling: renders
src/components/transfer/TransferModal.tsx - Transfer entry → High-risk verification: renders
src/components/transfer/TransferModal.tsx - High-risk verification → Alert dispatch client: dispatches alert
src/components/transfer/HighRiskVerificationModal.tsx - Alert dispatch client → HTTP client: sends requests
src/api/alertService.ts - HTTP client → API router: calls API
- API router → Token middleware: applies
server/src/app.ts - API router → Authentication endpoint: mounts
server/src/app.ts - API router → Risk endpoint: mounts
server/src/app.ts - API router → Payee endpoint: mounts
server/src/app.ts - API router → Alert endpoint: mounts
server/src/app.ts - Authentication endpoint → Authentication service: calls
server/src/routes/auth.ts - Authentication service → Token middleware: signs token
server/src/services/authService.ts - Risk endpoint → Risk scoring: calls
server/src/routes/risk.ts - Payee endpoint → Payee verification: calls
server/src/routes/payee.ts - Alert endpoint → Alert service: calls
server/src/routes/alerts.ts - Sign-in → Application state: updates session
src/components/auth/LoginPage.tsx - Trusted contact setup → Application state: updates preferences
src/components/onboarding/OnboardingModal.tsx - Risk simulator → Application state: sets test risk
src/components/simulator/SimulatorBar.tsx - API activity panel → Application state: reads API activity
src/components/debug/DebugPanel.tsx - Dashboard → Translations: uses text
src/components/desktop/DashboardLayout.tsx - Transfer entry → Translations: uses text
src/components/transfer/TransferModal.tsx - Scam-safety guidance → Banking user: guides against scams
README.md