How khushi6659/nyranet-pay works
UPI Offline Mesh is a Spring Boot demo of offline payments carried by a simulated device mesh and settled by a backend after a bridge regains connectivity. The user workflow is to compose and encrypt a payment, gossip its packet across virtual devices, upload it through a bridge, reject duplicates or invalid packets, and settle the payment into account balances and a transaction ledger. The README documents these relationships; source excerpts were not provided, so implementation-level call ownership could not be verified.
Main entry points: MeshSimulatorService.java Mesh simulator · templates Dashboard · BridgeIngestionService.java Bridge ingestion · SettlementService.java Settlement service
Components 18
Payment Mesh
- Payment instruction
src/main/java/com/demo/upimesh/model/PaymentInstruction.java - Mesh packet
src/main/java/com/demo/upimesh/model/MeshPacket.java - Mesh simulator
src/main/java/com/demo/upimesh/service/MeshSimulatorService.java - Virtual device
src/main/java/com/demo/upimesh/service/VirtualDevice.java
Backend Ingestion
- Hybrid encryption
src/main/java/com/demo/upimesh/crypto/HybridCryptoService.java - Server keys
src/main/java/com/demo/upimesh/crypto/ServerKeyHolder.java - Bridge ingestion
src/main/java/com/demo/upimesh/service/BridgeIngestionService.java - Ingest API
src/main/java/com/demo/upimesh/controller/ApiController.java - Idempotency claims
src/main/java/com/demo/upimesh/service/IdempotencyService.java
Settlement Ledger
- Settlement service
src/main/java/com/demo/upimesh/service/SettlementService.java - Accounts
src/main/java/com/demo/upimesh/model/Account.java - Account repository
src/main/java/com/demo/upimesh/model/AccountRepository.java - Transaction ledger
src/main/java/com/demo/upimesh/model/Transaction.java - Transaction repository
src/main/java/com/demo/upimesh/model/TransactionRepository.java
Demo Interface
- Dashboard
src/main/resources/templates - User controls
src/main/java/com/demo/upimesh/controller/UserController.java - Admin controls
src/main/java/com/demo/upimesh/controller/AdminController.java
Other components
- Demo user
Connections 20
- Demo user → Dashboard: operates
README.md - Dashboard → User controls: drives demo
README.md - User controls → Mesh simulator: injects payment
README.md - Mesh simulator → Payment instruction: builds
README.md - Mesh simulator → Hybrid encryption: encrypts with
README.md - Hybrid encryption → Server keys: uses server key
README.md - Mesh simulator → Mesh packet: wraps ciphertext
README.md - Mesh simulator → Virtual device: hands packet
README.md - Virtual device → Virtual device: gossips packet
README.md - Dashboard → Mesh simulator: runs rounds
README.md - Dashboard → Ingest API: uploads packets
README.md - Ingest API → Bridge ingestion: routes ingest
README.md - Bridge ingestion → Idempotency claims: claims hash
README.md - Bridge ingestion → Hybrid encryption: decrypts packet
README.md - Bridge ingestion → Settlement service: settles valid payment
README.md - Settlement service → Account repository: updates accounts
README.md - Account repository → Accounts: persists balances
README.md - Settlement service → Transaction repository: writes ledger
README.md - Transaction repository → Transaction ledger: persists entry
README.md - Admin controls → Dashboard: supports admin view