How bhavesh-girase/bidrush works
BidRush is a real-time auction platform. Users authenticate, browse listings, submit bids, and see live auction and wallet updates; sellers manage auctions and balances, while administrators oversee users, auctions, and bids. The backend combines Redis-based atomic bidding with PostgreSQL persistence, RabbitMQ workers, scheduled auction lifecycle changes, and Stripe/Cloudinary integrations. The graph reflects documented and excerpted relationships; unsampled routes and subsystems are included only where their existence or capability is supported, without guessing their internal calls.
Main entry points: index.js HTTP server · auctionController.js Auction management · bidController.js Bid handling · statusconsumer.js Status worker
Components 31
Client experience
- Web app routes
frontend/src/App.jsx - Auth state
frontend/src/context/AuthContext.jsx - Auction experience
frontend/src/pages/AuctionDetail.jsx - Admin dashboard
frontend/src/pages/admin/AdminDashboard.jsx - HTTP client
frontend/src/services/api.js - Socket client
frontend/src/hooks/useSocket.js
API and domain
- HTTP server
backend/index.js - Auth routes
backend/src/routes/auth.js - Authentication
backend/src/controllers/authController.js - Auction routes
backend/src/routes/auction.js - Auction management
backend/src/controllers/auctionController.js - Bid routes
backend/src/routes/bid.js - Bid handling
backend/src/controllers/bidController.js - Wallet and payments
backend/src/controllers/walletController.js - Stripe webhook
backend/src/controllers/stripeWebhook.js - Media uploads
backend/src/routes/upload.js - Auction scheduler
backend/src/jobs/auctionSchedular.js
Realtime and async
- Socket events
backend/src/webSocket/socketServer.js - Atomic bid cache
backend/src/cache/Functions/functions.js - Bid persistence worker
backend/src/queues/bids/bidconsumer.js - Status worker
backend/src/queues/status/statusconsumer.js - Email worker
backend/src/queues/email/emailConsumer.js
State and integrations
- PostgreSQL
backend/src/config/db.js - Auction repository
backend/src/repositories/auctionRepository.js - User repository
backend/src/repositories/userRepository.js - Bid repository
backend/src/repositories/bidRepository.js - Redis cache
backend/src/config/redis.js - RabbitMQ broker
backend/src/config/rabbitmq.js
Other components
- Users and admins
- Stripe
- Cloudinary
Connections 48
- Users and admins → Web app routes: use
frontend/src/App.jsx - Web app routes → Auth state: provides auth
frontend/src/App.jsx - Web app routes → Auction experience: routes to
frontend/src/App.jsx - Web app routes → Admin dashboard: routes to
frontend/src/App.jsx - Auth state → HTTP client: requests auth
frontend/src/context/AuthContext.jsx - Auth state → Socket client: subscribes via
frontend/src/context/AuthContext.jsx - Auction experience → HTTP client: requests data
frontend/src/pages/AuctionDetail.jsx - Auction experience → Socket client: receives events
frontend/src/pages/AuctionDetail.jsx - Admin dashboard → HTTP client: requests data
frontend/src/pages/admin/AdminDashboard.jsx - Admin dashboard → Socket client: receives events
frontend/src/pages/admin/AdminDashboard.jsx - HTTP client → HTTP server: HTTP requests
- Socket client → Socket events: connects
frontend/src/hooks/useSocket.js - HTTP server → Auth routes: mounts routes
backend/index.js - HTTP server → Auction routes: mounts routes
backend/index.js - HTTP server → Bid routes: mounts routes
backend/index.js - HTTP server → Socket events: initializes
backend/index.js - HTTP server → Bid persistence worker: starts worker
backend/index.js - HTTP server → Status worker: starts worker
backend/index.js - HTTP server → Email worker: starts worker
backend/index.js - HTTP server → Auction scheduler: starts scheduler
backend/index.js - HTTP server → Stripe webhook: routes webhook
backend/index.js - HTTP server → Wallet and payments: mounts routes
backend/index.js - HTTP server → Media uploads: mounts routes
backend/index.js - Auth routes → Authentication: dispatches
backend/src/routes/auth.js - Auction routes → Auction management: dispatches
- Bid routes → Bid handling: dispatches
- Authentication → User repository: queries users
backend/src/controllers/authController.js - Authentication → PostgreSQL: reads tokens
backend/src/controllers/authController.js - Authentication → Redis cache: reads balances
backend/src/controllers/authController.js - Auction management → Auction repository: manages records
backend/src/controllers/auctionController.js - Auction management → Redis cache: reads cache
backend/src/controllers/auctionController.js - Auction management → Atomic bid cache: uses cache functions
backend/src/controllers/auctionController.js - Auction management → Socket events: emits updates
backend/src/controllers/auctionController.js - Auction management → Status worker: publishes status
backend/src/controllers/auctionController.js - Auction management → Email worker: queues email
backend/src/controllers/auctionController.js - Bid handling → Atomic bid cache: validates atomically
backend/src/controllers/bidController.js - Bid handling → Bid repository: queries bids
backend/src/controllers/bidController.js - Bid handling → Auction repository: updates auctions
backend/src/controllers/bidController.js - Bid handling → User repository: updates balances
backend/src/controllers/bidController.js - Bid handling → RabbitMQ broker: publishes bid
- Bid handling → Socket events: emits bid events
backend/src/controllers/bidController.js - Atomic bid cache → Redis cache: executes scripts
backend/src/cache/Functions/functions.js - Bid persistence worker → RabbitMQ broker: consumes bids
backend/src/queues/bids/bidconsumer.js - Bid persistence worker → PostgreSQL: persists bids
backend/src/queues/bids/bidconsumer.js - Status worker → RabbitMQ broker: consumes statuses
backend/src/queues/status/statusconsumer.js - Status worker → PostgreSQL: updates records
backend/src/queues/status/statusconsumer.js - Status worker → Redis cache: updates cache
backend/src/queues/status/statusconsumer.js - Status worker → Socket events: emits updates
backend/src/queues/status/statusconsumer.js