How devdreamer26/serverless-wallet-transfer-engine-using-aws-lamda works
This is a serverless wallet backend for authenticated balance checks, transfers, and IAM-protected administrative top-ups. A client request enters API Gateway; user routes are authorized by the JWT authorizer, which supplies trusted identity and scopes for the balance or transfer handler. Transfers require an idempotency key and use a four-item atomic DynamoDB transaction for wallet updates, reservation, and ledger logging. The README documents these route and authorization relationships; source excerpts show handler-to-storage calls. API Gateway and DynamoDB are represented as external services.
Main entry points: balance.py Balance handler · transfer.py Transfer handler · admin_topup.py Admin top-up · db.py Wallet data access
Components 10
API security
- API Gateway
- JWT authorizer
src/authorizer/app.py
Wallet operations
- Balance handler
src/handlers/balance.py - Transfer handler
src/handlers/transfer.py - Admin top-up
src/handlers/admin_topup.py - Response formatter
src/shared/utils.py
Ledger storage
- Wallet data access
src/shared/db.py - DynamoDB
- Wallet errors
src/shared/errors.py
Other components
- Client
Connections 17
- Client → API Gateway: sends request
README.md - API Gateway → JWT authorizer: authorizes user routes
README.md - JWT authorizer → API Gateway: injects identity
README.md - API Gateway → Balance handler: routes balance
README.md - API Gateway → Transfer handler: routes transfer
README.md - API Gateway → Admin top-up: routes top-up
README.md - Balance handler → Wallet data access: reads wallet
src/handlers/balance.py - Transfer handler → Wallet data access: executes transfer
src/handlers/transfer.py - Wallet data access → DynamoDB: reads and transacts
src/shared/db.py - Admin top-up → DynamoDB: credits wallet
src/handlers/admin_topup.py - Balance handler → Response formatter: formats response
src/handlers/balance.py - Transfer handler → Response formatter: formats response
src/handlers/transfer.py - Admin top-up → Response formatter: formats response
src/handlers/admin_topup.py - Balance handler → Wallet errors: handles wallet errors
src/handlers/balance.py - Transfer handler → Wallet errors: handles wallet errors
src/handlers/transfer.py - Admin top-up → Wallet errors: handles wallet errors
src/handlers/admin_topup.py - Wallet data access → Wallet errors: raises domain errors
src/shared/db.py