How rushikeshg25/bidrealm works
Main Components
• Next Client – This is the front‑end application (built with Next.js) located under apps/client. It handles UI, user authentication (via Lucia), bid/auction interactions, and image uploads (using UploadThing).
• Express WS Server – Representing the WebSocket server (likely implemented in apps/server) that manages real‑time communication for auctions and bids. Its source files (like Auction.ts, AuctionManager.ts, and WebSocket utilities) indicate the business logic and connection management.
• PostgreSQL DB – While not a “running” component in the file tree, the packages/db directory (with its Prisma schema and migrations) shows that Postgres is used as the main database for persisting auctions, bids, and related user data.
• Redis Message Queue – As described in the README under “Message Queue,” this component is used for queuing email notifications, ensuring that notifications are processed asynchronously.
• Email Notification Worker – Found in apps/email-notification-server. It listens to the Redis message queue and uses NodeMailer to send email notifications (like winning, outbid, or auction end events).
Relationships and Interactions
• The Next Client communicates with the Express WS Server through WebSocket connections for real‑time updates.
• The Express WS Server handles business operations (e.g., auction creation, bid placement) and interacts with the PostgreSQL DB (via Prisma ORM) to persist data.
• Upon key auction events, the Express WS Server (or related backend logic) places messages in the Redis queue.
• The Email Notification Worker monitors the Redis queue, processes the messages, and sends emails using NodeMailer.
• Additionally, authentication flows, API requests, and image uploads involve the Next Client and backend coordination.
Architectural Patterns and Technologies
• The project employs real‑time communication using WebSockets, implementing a reactive UI.
• There is a separation of concerns where the client, WebSocket server, and background workers (email notifications) are modularized (visible in apps/client, apps/server, and apps/email‑notification‑server).
• Turborepo is used to manage the monorepo, organizing the apps and shared packages (such as db, env, eslint, and typescript-config).
• Use of Prisma ORM integrates the Postgres DB, and the file tree shows migration and seeding files in the db package.
• The use of services like Redis (for queuing) and UploadThing (for image uploads) should also be highlighted.