This demo shows the real-time layer of a peer-to-peer payment app. The page shows two simulated phones side by side. Pick a different user on each one, and you can send money, request money, and chat between them without opening a second tab. The money is not real: balances are kept in the browser, and you can top up or log out to reset them. A real app would move the money in its own backend.
The app is built with Next.js and the PubNub Chat SDK. The two users talk in a direct (1:1) channel. Payments are messages on that channel, with the amount and a transaction ID in the message metadata, so payments and chat share one history. The sample users and their phone numbers are stored in App Context, and each login gets an Access Manager token. The push notifications in the demo are simulated in the page. The source code is open on GitHub.