Member-only story
Emulate User Activity with Bots
In our sales events platform, Auctibles, sellers have the exciting opportunity to create various events. These range from a sale event at a fixed price to live auctions, where buyers bid the price up, providing a dynamic and engaging experience.
The Technology
We use the Laravel framework in the context of the TALL stack: Tailwind, Alpine.js, Laravel, and Livewire.
Why Emulation?
For a demo environment, it’s crucial that we accurately emulate buyers’ activity for a seller. This includes sending buy orders and chat messages. The purpose of the emulation is to allow the seller to get a feeling of how the event with multiple buyers will be observed from the event control screens. This includes changing the quantities of items still available, dynamic price changes, and chat messages from buyers.
Ordinary Buyers
The buy screen is a Livewire component. Clicking the BUY button sends a broadcast event: LiveBuy,
LiveBid
,...
Similarly, buyers send chat messages via a broadcast event ChatMessage.
Bots for Emulation
We emulate buyers’ activity via a bot. The bot is a ReactPHP server that periodically sends the same broadcast events that ordinary buyers send.