XpertBid – Marketplace & Auctions.
Integrations
PayFast · Google Maps APIs · Third-party WhatsApp messaging service
01 // Overview
Overview.
XpertBid is a Pakistan-focused marketplace where people can auction items, sell products, and post buying requests that sellers compete to fulfil. I joined as a frontend developer, building the UI for the storefront and the admin panel. As I grew into backend work with Laravel, I took on server-side development as well. When the senior developer moved the platform from Next.js + Laravel to Laravel + Inertia.js + React, I built the current version on that stack.
02 // Architecture & Modules
Core Modules & Features.
Core modules
1. Auction Management System
- Verified users create auctions through a dedicated listing form.
- Live bidding with a full bid history for every product.
- A “My Bids” area where users see each bid as active, won, or lost.
- Email and WhatsApp notifications for every bid event: outbid, won, or lost.
- After winning, the user completes checkout within 24 hours. If they don’t, the win passes to the second-highest bidder.
2. Normal Products
- Sellers create a listing with a title, description, and images.
- Buyers complete a simple one-time checkout.
3. Business Products
- Store-oriented inventory with stock management, SKUs, and barcodes.
- Buyers can purchase multiple units based on available quantity.
4. Reverse Marketplace
- Buyers post a request for what they need.
- Sellers bid on it, and the buyer chooses which offer to accept.
- Targeted notifications: when a request is created, only sellers whose preferences match its category, product, and location get an email or WhatsApp message.
- After an offer is accepted, the XpertBid team handles the deal manually. In-app checkout is not part of this module yet.
5. 1 Rupee Auction (recently added)
Platform features
- Location search and map preview using Google Maps APIs.
- Secure local payments through PayFast.
- Referral system, user profiles, user verification, and order management.
- Notification management so users control which alerts they receive.
Admin panel
- Role-based access with dedicated roles such as Main Admin, SEO Handler, Listing Handler, and Order Handler.
- Marketing notifications: send emails and WhatsApp messages to registered users, for example to announce an offer.
- Product scrapers built in Laravel that read HTML attributes from Daraz, OLX, and PropertyFinder to import listings without manual data entry.
03 // Highlights
Highlights.
- Rebuilt on Laravel + Inertia.js + React with a server-rendered, single-page feel.
- Five product flows (auctions, standard products, business products, reverse marketplace, 1 Rupee auction) on one shared backend.
- Notification system that targets the right sellers instead of broadcasting to everyone.
Architecture Case Study
Case Study: One Login Across Three Sites.
The problem
Once the property and build frontends launched as separate apps on subdomains, a user who logged in on xpertbid.com appeared logged out on the other two, and the reverse. Browsers don’t let different origins share localStorage, and the main site and the new frontends authenticate in different ways, so a shared login needed a deliberate design.
The architecture
- Main site (Laravel + Inertia): a standard Laravel session cookie, scoped to the parent domain so all subdomains can see it.
- Next.js satellites (property and build): Laravel Sanctum bearer tokens stored in localStorage.
- Auth calls from the satellites go through a same-origin Next.js proxy route that forwards them to the Laravel API, which avoids CORS problems.
How the sync works
- Silent cookie SSO (main site to satellite): when a user opens a satellite, it quietly asks the main site for a token, sending the session cookie along. If the user is logged in, Laravel checks the request origin against an allowlist and returns a fresh Sanctum token, so the user is logged in instantly with no redirect.
- One-time auth bridge (satellite to main site): when a user logs in on a satellite, the backend creates a random 64-character token, stored in cache for only 2 minutes. The browser visits a bridge URL on the main site, the token is consumed in a single read, and the main site session is created.
- Moving between sites: when a logged-in user clicks through to another XpertBid site, a fresh bridge link is generated. If the destination is another satellite, the main site passes along a new token so the user lands already logged in.
- Google login: handled by the main site, which then redirects back to the satellite with a new token.
Logout and session health
- Global logout: logging out on any site deletes the user’s Sanctum tokens and ends the main session, so the other sites log the user out too. A short guard prevents a satellite from immediately re-logging the user in after logout.
- Tab switching: satellites re-check login status when the browser tab regains focus, throttled to avoid excess requests. They clear the token only on a real 401, not on a network error. The main site refreshes its auth data on focus as well.
- Keep-alive: the main site pings the server every 10 minutes so an active user’s 120-minute session doesn’t expire while idle.
Security choices
- Bridge tokens are random, short-lived, and single-use.
- Cross-origin requests are checked against an allowlist of trusted origins.
- Separate token names per frontend make tokens easy to revoke.
Result
Users log in once and stay logged in across xpertbid.com, property.xpertbid.com, and build.xpertbid.com, and logging out of any one signs them out of all three.