DEV Community

Cover image for Building a real-time bidding system with Socket.io and React Native 🤩

Building a real-time bidding system with Socket.io and React Native 🤩

Nevo David on November 15, 2022

What is this article about? Goin’ Once, Goin’ Twice, Sold to the lady with the red dress 💃🏻 You have probably heard that many times in m...
Collapse
 
nevodavid profile image
Nevo David

Image description

Collapse
 
nevodavid profile image
Nevo David

How are you today?

Collapse
 
nevodavid profile image
Nevo David

Have you worked with React Native before?

Collapse
 
michelegardner14 profile image
Michele Gardner

Using React Native and Socket.IO to build a real-time bidding system lets users and servers instantly engage, hence producing a dynamic and engaging auction environment. This method lets bids be changed live, therefore guaranteeing that every player sees the most recent offers right away. Whereas Socket.IO effectively maintains real-time, bidirectional communication, React Native offers a versatile framework for creating cross-platform mobile apps. For markets or auction sites where speed and immediacy are critical, this kind of system improves user involvement and openness. Using this technology creates a flawless, responsive bidding and tendering experience available on several devices.

Collapse
 
r4e profile image
Richie Permana

How would you handke the concurrent event when users is bidding at the exact same time and price? 😆

Collapse
 
imsuvesh profile image
Suvesh K

On server check the price before updating, incoming bid must be greater that current price.
If both users bid at same time who's request comes first will update the price and second will see error to increase bid.

Collapse
 
r4e profile image
Richie Permana

Thanks for the reply. Really love the discussion!

But anyway, I get your point but actually....it's not that simple. Well, your point technically, yes, but actually no. Sometimes, the implementation is much harder than you think.

For me, my approach is using Redis to solve this problem instead of DB transactions.

Collapse
 
jcmaciel profile image
José Carlos Maciel

Hi, I got "Network request failed", can you help me?

Collapse
 
user1111333 profile image
Sacred (void*)

Some browsers/platforms reject non-secure websocket(ws://) connections/handshakes.
Fix is easy tho, as adopting https, and the same story for WS, using wss://...

Collapse
 
jcmaciel profile image
José Carlos Maciel

Thanks!!

Collapse
 
asubodh profile image
Subodh Aryal

🚀

Collapse
 
nevodavid profile image
Nevo David

🤩

Collapse
 
wilmela profile image
Wilmela

Nice

Collapse
 
nevodavid profile image
Nevo David

Thank you Wilmela! 🤩

Collapse
 
william123 profile image
William

Great article, really makes building a bidding app look super fun with Socket.io and React Native!