How chauhansahab2525/offlinepay works
OfflinePay simulates an offline payment lifecycle: a sender creates an encrypted packet, phones forward it over a TTL-limited mesh, and a bridge uploads it to the backend for validation, duplicate detection, and settlement. The repository also exposes REST and dashboard capabilities, PIN checks, and a transaction ledger. Relationships below follow the README’s documented flow; source excerpts were not provided, so implementation-level calls and wiring are not verified.
Main entry points: MeshPacket.java Encrypted packet · MeshSimulatorService.java Mesh forwarding · VirtualDevice.java Phone device · BridgeIngestionService.java Bridge upload
Components 23
Payment ingress
- Encrypted packet
src/main/java/com/demo/upimesh/model/MeshPacket.java - Packet encryption
src/main/java/com/demo/upimesh/crypto/HybridCryptoService.java - Mesh forwarding
src/main/java/com/demo/upimesh/service/MeshSimulatorService.java - Phone device
src/main/java/com/demo/upimesh/service/VirtualDevice.java - Bridge upload
src/main/java/com/demo/upimesh/service/BridgeIngestionService.java
Backend processing
- Spring backend
src/main/java/com/demo/upimesh/UpiMeshApplication.java - REST API
src/main/java/com/demo/upimesh/controller/ApiController.java - Packet validation
src/main/java/com/demo/upimesh/service/BridgeIngestionService.java - PIN verification
src/main/java/com/demo/upimesh/security/PinService.java - Duplicate detection
src/main/java/com/demo/upimesh/service/IdempotencyService.java - Payment settlement
src/main/java/com/demo/upimesh/service/SettlementService.java - Payment instruction
src/main/java/com/demo/upimesh/model/PaymentInstruction.java - Application configuration
src/main/java/com/demo/upimesh/config/AppConfig.java - Server key holder
src/main/java/com/demo/upimesh/crypto/ServerKeyHolder.java
Accounts and ledger
- Transaction record
src/main/java/com/demo/upimesh/model/Transaction.java - Transaction repository
src/main/java/com/demo/upimesh/model/TransactionRepository.java - Account
src/main/java/com/demo/upimesh/model/Account.java - Account repository
src/main/java/com/demo/upimesh/model/AccountRepository.java - MySQL ledger
User interfaces
- Dashboard controller
src/main/java/com/demo/upimesh/controller/DashboardController.java - Live dashboard
src/main/resources/templates/dashboard.html - Demo flow
src/main/java/com/demo/upimesh/service/DemoService.java
Other components
- Sender
Connections 12
- Sender → Encrypted packet: creates
README.md - Encrypted packet → Mesh forwarding: forwards via
README.md - Mesh forwarding → Phone device: gossips through
README.md - Phone device → Bridge upload: reaches
README.md - Bridge upload → Spring backend: uploads to
README.md - Spring backend → Packet validation: validates
README.md - Packet validation → Duplicate detection: checks duplicates
README.md - Duplicate detection → Payment settlement: allows settlement
README.md - Packet encryption → Encrypted packet: encrypts
README.md - Payment settlement → Transaction record: records payment
README.md - Transaction record → MySQL ledger: stored in
README.md - Dashboard controller → Live dashboard: serves
README.md