-
Notifications
You must be signed in to change notification settings - Fork 56
Feature: Real-Time Stock Updates using WebSockets #178
Copy link
Copy link
Closed
Labels
HardSSoC26backendFor changes related to the Express server, API routes, or MongoDB modelsFor changes related to the Express server, API routes, or MongoDB modelsenhancementNew feature or requestNew feature or requestfrontendFor any changes in the React UI, components, or Vite setupFor any changes in the React UI, components, or Vite setup
Description
Metadata
Metadata
Assignees
Labels
HardSSoC26backendFor changes related to the Express server, API routes, or MongoDB modelsFor changes related to the Express server, API routes, or MongoDB modelsenhancementNew feature or requestNew feature or requestfrontendFor any changes in the React UI, components, or Vite setupFor any changes in the React UI, components, or Vite setup
Description
Right now, if two users are looking at the same product and one buys the last item, the other user's screen will still show "In Stock" until they manually refresh the page.
Your task is to implement WebSockets (Socket.io) to push real-time stock updates to all connected clients.
Requirements
Socket.ioalongside our Express server.stockUpdateevent containing theproductIdandnewStock.ProductPageandProductCardcomponents.stockUpdateevents and dynamically update the UI (e.g., changing from "In Stock" to "Out of Stock" instantly without a refresh).