How priyanshu3221/banksim-blue-team-ai-firewall works
BankSim is a simulated banking application with a defensive AI security layer. The user workflow runs from registration or login through OTP verification, then into account and transaction views; transfer requests are assessed for risk and memo threats before any permitted execution. Admin and security-console views provide separate monitoring and analysis capabilities. The README describes some verification and transaction features as planned, while the sampled source index shows corresponding implementation modules; treat those flows as present in code but subject to that status caveat.
Main entry points: router.py API router · App.tsx BankSim app · auth.py Authentication API · client.ts API client
Components 26
Banking interface
- BankSim app
frontend/src/App.tsx - Login and registration
frontend/src/pages/LoginPage.tsx - Session context
frontend/src/context/AuthContext.tsx - API client
frontend/src/api/client.ts - Account and transfer views
frontend/src/pages/TransferPage.tsx - Security console
frontend/src/pages/SecurityConsolePage.tsx - Admin dashboard
frontend/src/pages/AdminPage.tsx
API and access
- API router
backend/api/router.py - Authentication API
backend/api/auth.py - User and admin APIs
backend/api/users.py - Banking API
backend/api/banking.py - Security API
backend/api/security.py - Auth and RBAC
backend/security/dependencies.py - Login tracking
backend/security/login_tracker.py - JWT tokens
backend/security/tokens.py
Banking and risk
- Transfer service
backend/services/banking_service.py - Adaptive risk engine
backend/services/risk_engine.py - Verification service
backend/services/verification_service.py
Threat defense
- AI threat analyzer
backend/services/ai_threat_analyzer.py - AI providers
backend/services/ai_providers.py
Data and audit
- SQLite database
backend/database.py - Banking and security records
backend/models.py - API schemas
backend/schemas.py
Other components
- Customer
- Administrator
- OpenAI service
Connections 35
- Customer → BankSim app: uses
- Administrator → BankSim app: uses
- BankSim app → Session context: provides session
frontend/src/App.tsx - BankSim app → Account and transfer views: renders
frontend/src/App.tsx - BankSim app → Security console: renders
frontend/src/App.tsx - BankSim app → Admin dashboard: renders
frontend/src/App.tsx - Login and registration → Session context: submits login
frontend/src/pages/LoginPage.tsx - Session context → API client: calls
frontend/src/context/AuthContext.tsx - Account and transfer views → API client: requests banking
frontend/src/api/client.ts - Security console → API client: requests analysis
frontend/src/api/client.ts - Admin dashboard → API client: requests metrics
frontend/src/api/client.ts - API client → API router: HTTP requests
- API router → Authentication API: registers routes
backend/api/router.py - API router → User and admin APIs: registers routes
backend/api/router.py - API router → Banking API: registers routes
backend/api/router.py - API router → Security API: registers routes
backend/api/router.py - Authentication API → Login tracking: tracks failures
backend/api/auth.py - Authentication API → JWT tokens: issues tokens
backend/api/auth.py - Authentication API → Verification service: handles challenges
backend/api/auth.py - User and admin APIs → Auth and RBAC: enforces access
backend/api/users.py - Banking API → Auth and RBAC: checks identity
backend/api/banking.py - Banking API → Transfer service: delegates banking
backend/api/banking.py - Security API → AI threat analyzer: analyzes text
backend/api/security.py - Security API → Adaptive risk engine: assesses risk
backend/api/security.py - Transfer service → Adaptive risk engine: assesses transfers
backend/services/banking_service.py - Transfer service → Verification service: handles step-up
backend/services/banking_service.py - Adaptive risk engine → AI threat analyzer: uses threat results
backend/services/risk_engine.py - AI threat analyzer → AI providers: selects provider
backend/services/ai_threat_analyzer.py - AI providers → OpenAI service: calls optionally
- SQLite database → Banking and security records: maps records
backend/database.py - Authentication API → SQLite database: reads and writes
backend/api/auth.py - Transfer service → SQLite database: reads and writes
backend/services/banking_service.py - Adaptive risk engine → SQLite database: reads and audits
- Verification service → SQLite database: stores challenges
backend/services/verification_service.py - API router → API schemas: validates API data