How aacho04/securebank works
SecureBank is a passwordless banking-authentication application. A user registers through email verification and a WebAuthn passkey, can log in or recover access, and then uses the dashboard to manage security, sync devices, and authorize transfers with an S-PIN and face check. The graph preserves these documented capabilities and the sampled controller, route, session, and persistence layers. Some frontend-to-API and face-liveness implementation details are not shown in the excerpts, so those connections are omitted rather than inferred.
Main entry points: App.jsx App routing · auth.js Authentication routes · useAuth.jsx Session context · registerController.js Passkey enrollment
Components 31
Banking web app
- App routing
frontend/src/App.jsx - Session context
frontend/src/hooks/useAuth.jsx - Registration page
frontend/src/pages/RegisterPage.jsx - Email verification
frontend/src/pages/VerifyEmailPage.jsx - Login page
frontend/src/pages/LoginPage.jsx - Recovery page
frontend/src/pages/RecoveryPage.jsx - Banking dashboard
frontend/src/pages/Dashboard.jsx - Biometric modal
frontend/src/components/AuthModal.jsx - Device sync
frontend/src/pages/DeviceSyncPage.jsx - Sync claim
frontend/src/pages/SyncClaimPage.jsx
Backend API
- Authentication routes
backend/routes/auth.js - Dashboard routes
backend/routes/dashboard.js - Passkey enrollment
backend/controllers/registerController.js - Passkey login
backend/controllers/loginController.js - Account recovery
backend/controllers/recoveryController.js - Device pairing
backend/controllers/syncController.js - Account security
backend/controllers/settingsController.js - Transfer authorization
backend/controllers/transactionController.js
Auth services
- Challenge cookies
backend/services/challengeCookie.js - JWT service
backend/services/jwtService.js - Email delivery
backend/services/emailService.js - Email validation
backend/services/emailValidator.js - Recovery codes
backend/services/recoveryService.js
Persistent data
- User records
backend/models/User.js - Passkey devices
backend/models/Device.js - Bank accounts
backend/models/Account.js - Transaction records
backend/models/Transaction.js - Pairing tokens
backend/models/PairingToken.js - Verification records
backend/models/EmailVerification.js
Other components
- Bank customer
- MongoDB
Connections 48
- Bank customer → App routing: uses
README.md - App routing → Login page: routes to
frontend/src/App.jsx - App routing → Registration page: routes to
frontend/src/App.jsx - App routing → Email verification: routes to
frontend/src/App.jsx - App routing → Recovery page: routes to
frontend/src/App.jsx - App routing → Banking dashboard: guards route
frontend/src/App.jsx - App routing → Device sync: guards route
frontend/src/App.jsx - App routing → Sync claim: routes to
frontend/src/App.jsx - App routing → Session context: provides
frontend/src/App.jsx - Registration page → Session context: uses
frontend/src/pages/RegisterPage.jsx - Email verification → Session context: uses
frontend/src/pages/VerifyEmailPage.jsx - Login page → Session context: uses
frontend/src/pages/LoginPage.jsx - Recovery page → Session context: uses
frontend/src/pages/RecoveryPage.jsx - Banking dashboard → Session context: uses
frontend/src/pages/Dashboard.jsx - Banking dashboard → Biometric modal: renders
frontend/src/pages/Dashboard.jsx - Device sync → Session context: uses
frontend/src/pages/DeviceSyncPage.jsx - Sync claim → Session context: uses
frontend/src/pages/SyncClaimPage.jsx - Authentication routes → Passkey enrollment: dispatches
backend/routes/auth.js - Authentication routes → Passkey login: dispatches
backend/routes/auth.js - Authentication routes → Account recovery: dispatches
backend/routes/auth.js - Authentication routes → Device pairing: dispatches
backend/routes/auth.js - Dashboard routes → Account security: dispatches
backend/routes/dashboard.js - Dashboard routes → Transfer authorization: dispatches
backend/routes/dashboard.js - Passkey enrollment → User records: creates
backend/controllers/registerController.js - Passkey enrollment → Passkey devices: creates
backend/controllers/registerController.js - Passkey enrollment → Challenge cookies: stores challenge
backend/controllers/registerController.js - Passkey enrollment → Recovery codes: generates code
backend/controllers/registerController.js - Passkey enrollment → JWT service: verifies token
backend/controllers/registerController.js - Passkey login → User records: reads and updates
backend/controllers/loginController.js - Passkey login → Passkey devices: checks credentials
backend/controllers/loginController.js - Passkey login → Challenge cookies: reads challenge
backend/controllers/loginController.js - Passkey login → JWT service: issues tokens
backend/controllers/loginController.js - Account recovery → User records: updates recovery
backend/controllers/recoveryController.js - Account recovery → Passkey devices: replaces devices
backend/controllers/recoveryController.js - Account recovery → Recovery codes: checks codes
backend/controllers/recoveryController.js - Account recovery → Email delivery: sends alerts
backend/controllers/recoveryController.js - Device pairing → User records: reads and updates
backend/controllers/syncController.js - Device pairing → Passkey devices: manages devices
backend/controllers/syncController.js - Device pairing → Pairing tokens: manages tokens
backend/controllers/syncController.js - Account security → User records: updates settings
backend/controllers/settingsController.js - Account security → Email delivery: sends email
backend/controllers/settingsController.js - Transfer authorization → User records: checks authorization
backend/controllers/transactionController.js - Transfer authorization → Bank accounts: reads and updates
backend/controllers/transactionController.js - Transfer authorization → Transaction records: records transfer
backend/controllers/transactionController.js - Authentication routes → Email validation: validates address
backend/routes/auth.js - Authentication routes → Email delivery: sends verification
backend/routes/auth.js - Authentication routes → Verification records: checks token
backend/routes/auth.js - Passkey login → Email validation: validates address
backend/controllers/loginController.js