How arch-host/digitalbank works
DigitalBank is an Express/MongoDB banking API whose main workflow is customer registration and bank account opening, followed by authenticated account access and transfers with transaction history and status checks. The graph includes the route-to-service layers, customer and transaction persistence, and NIBSS integration. Source excerpts and the index support the key calls; the README documents the broader capabilities and MongoDB architecture. Some wiring is documented rather than visible in the sampled source.
Main entry points: App.js Express application · auth.service.js Registration and login · transaction.service.js Transfer and history · nibss.client.js NIBSS client
Components 20
API entry and routing
- Auth routes
Routes/auth.routes.js - Account routes
Routes/account.routes.js - Transaction routes
Routes/transaction.routes.js - Error handler
Middleware/errorHandler.js - Express application
App.js - Server startup
server.js
Customer identity and access
- Customer
Model/customer.js - JWT authentication
Middleware/auth.js - Auth controller
Controller/auth.controller.js - Registration and login
Services/auth.service.js
Accounts and transfers
- Transaction
Model/transaction.js - Account controller
Controller/account.controller.js - Account operations
Services/account.service.js - Transaction controller
Controller/transaction.controller.js - Transfer and history
Services/transaction.service.js
Persistence and bank integration
- NIBSS client
Services/nibss.client.js - MongoDB connection
Config/db.js
Other components
- Customer
- MongoDB
- NIBSS sandbox
Connections 26
- Server startup → Express application: starts
server.js - Server startup → MongoDB connection: connects
server.js - Express application → Auth routes: mounts
App.js - Express application → Account routes: mounts
App.js - Express application → Transaction routes: mounts
App.js - Express application → Error handler: handles errors
App.js - Customer → Express application: uses API
README.md - Auth routes → Auth controller: routes to
Routes/auth.routes.js - Account routes → JWT authentication: authenticates
Routes/account.routes.js - Account routes → Account controller: routes to
Routes/account.routes.js - Transaction routes → JWT authentication: authenticates
Routes/transaction.routes.js - Transaction routes → Transaction controller: routes to
Routes/transaction.routes.js - Auth controller → Registration and login: calls
Controller/auth.controller.js - Account controller → Account operations: calls
Controller/account.controller.js - Transaction controller → Transfer and history: calls
Controller/transaction.controller.js - JWT authentication → Customer: loads customer
Middleware/auth.js - Registration and login → Customer: checks and saves
Services/auth.service.js - Registration and login → NIBSS client: verifies and opens
Services/auth.service.js - Account operations → NIBSS client: requests account data
Services/account.service.js - Transfer and history → Transaction: records and queries
Services/transaction.service.js - Transfer and history → NIBSS client: enquires and transfers
Services/transaction.service.js - Customer → MongoDB: persists in
README.md - Transaction → MongoDB: persists in
README.md - NIBSS client → NIBSS sandbox: calls bank API
Services/nibss.client.js - Registration and login → MongoDB: checks duplicates
README.md - Transfer and history → MongoDB: stores pending first
README.md