Skip to content
Shahab Hassan
All projects

Marketplace with live callsWeb Development · 2024

Buylio

A marketplace for tech products and services, where sellers can also sell their time as a live call.

A wall of Buylio screens: product listings, a service page with tiered packages, an order timeline, seller settings, and the product and service category directories
01Overview

Overview

Buylio is a multi vendor marketplace built for the tech world, and it works two ways at once. On one side it is a normal online store: buyers browse gadgets, accessories, components, software licences and digital tools, add them to a cart, pay by card and get them shipped with tracking. On the other side it is a freelance platform: buyers hire people for development, design, consulting and mentoring.

What makes it different is how the services are sold. A seller builds up to three packages for a listing, and each package can be one of five things: a piece of work to be delivered, a video call, an audio call, a live chat session, or a set number of questions answered. So a seller is not limited to selling deliverables. They can sell an hour of their time, and the call itself happens inside Buylio with a countdown running.

A buyer can search and filter listings, read reviews, save things to a wishlist, bookmark sellers they like, and message any seller directly. If they cannot find what they need, they post a requirement and wait for sellers to send offers back. Once they have ordered, they track the shipment on product orders, or submit their requirements, review what gets delivered and ask for revisions on service orders. They can accept or reject a delivery, ask to cancel, and raise a dispute if it goes wrong.

A seller upgrades from their buyer account, sets up a profile, and lists products with stock, discounts, shipping fees and up to five photos, or services with their package structure. While they set a price, a live calculator shows what they will actually take home after commission. They ship orders with tracking numbers, deliver work, answer revision and extension requests, and run their live sessions. Their earnings dashboard shows available balance, pending withdrawals and history, with the payout fee previewed before they withdraw to Stripe Connect, Wise or PayPal. A paid membership lowers their commission and unlocks buyer requirements, and they can pay to boost individual listings higher in search. If they need time off, they mark themselves unavailable and their listings hide automatically.

The live session engine is the hardest part of the build. When a call package is bought, the purchased duration becomes a countdown in seconds held on the server. Both people join a Socket.IO room, a server side timer ticks down once a second and broadcasts the time left, and the video and audio travel directly between the two people over WebRTC, with only the connection setup relayed through the socket, so the server never carries the media itself. Either side can ask to finish early or to reschedule, which pauses the clock and freezes the remaining time until the new slot. At zero the session closes itself, records the earnings, updates the sold counters and emails both parties. If the server restarts mid session, it re-arms the timers for every session that was still running, so a deploy never costs anyone the time they paid for.

Payments run on Stripe Payment Intents, with every price, fee, discount and tax figure resolved from the database rather than trusted from the browser, and stock held the moment an order is created and released if the payment fails. Webhooks are signature verified and handle failed payments and chargebacks, seller transfers carry an idempotency key so a retry cannot pay someone twice, and a database level partial unique index stops a duplicate withdrawal request from being created at all. Fees are set separately for buyers, free sellers and paid sellers, and again for products and for services, with tax covering all 13 Canadian provinces plus an international default.

Eight scheduled jobs handle the parts nobody should have to chase: overdue order sweeps, three day auto approval of deliveries the buyer never answered, discount, membership and boost expiry, seller availability windows, and cleanup of orders left unpaid after 30 minutes. Around all of it sits real time chat with file attachments, read receipts and presence, roughly 60 branded email templates, and an admin panel of more than 20 pages covering six analytics modules, revenue, orders, disputes, payout queues, fee configuration, coupons, categories, email campaigns and employee accounts with per page permissions.

02Features26

Features

  • Buyers browse and search products and services by category, price and rating
  • Listing pages with photo galleries, discount badges, seller details and reviews
  • Cart and card checkout with coupon codes and tax worked out at checkout
  • Shipping with tracking numbers and a shipment tracking page
  • Sign up by email, or with a Google Account
  • Wishlist, bookmarked sellers and a recently viewed list
  • Direct chat between any buyer and seller, with file attachments up to 10 MB
  • Reviews and ratings on products, services and sellers
  • Any buyer can upgrade their account and start selling
  • Sellers list products with stock, discounts, shipping fees and up to five photos
  • A live calculator shows sellers their take home amount while they set a price
  • Service listings with up to three packages: Basic, Standard and Ultimate
  • Each package can be a deliverable, video call, audio call, live chat or Q&A
  • Video and audio calls run inside the platform, directly
  • Sessions are timed by the server and can be paused, rescheduled or ended early
  • Buyers post what they need and sellers send offers back
  • Sellers send a formal offer in chat that the buyer accepts into checkout
  • Service orders with requirements, revisions, extensions and delivery approval
  • Deliveries approve automatically if the buyer does not respond within 3 days
  • Either side can request a cancellation for the other to accept or reject
  • Seller earnings dashboard with payouts to Stripe Connect, Wise or PayPal
  • Paid membership for lower commission, and paid boosts to rank higher in search
  • Sellers can mark themselves unavailable and their listings hide automatically
  • PDF invoices, packing slips and account statements, plus CSV export
  • Around 60 branded emails covering every event on the platform
  • Admin panel of 20 plus pages with six analytics modules, revenue and disputes
03Challenges & solutions7

Challenges and solutions

  1. 01
    Challenge

    A live paid session has to be metered accurately, and a server restart in the middle of one could not be allowed to lose people's money.

    Solution

    Kept the remaining duration in seconds on the session record and ticked it down with a server side interval rather than trusting either browser. On boot the server re-arms timers for every session that was mid flight, so a deploy or a crash resumes the session instead of losing it.

  2. 02
    Challenge

    Video and audio calls needed to work without paying for a media server.

    Solution

    Ran the media peer to peer over WebRTC and used Socket.IO only to relay the offer, answer and ICE candidates, with a waiting room state while the other side connects. The server carries the signalling and the timer, never the video itself.

  3. 03
    Challenge

    Products and services behave nothing alike, but both had to feel like one marketplace.

    Solution

    Built two separate order pipelines with their own status machines, product orders with cart level sub orders that ship independently, and service orders with a 25 event history, then shared everything around them: chat, disputes, payouts, reviews and the admin panel.

  4. 04
    Challenge

    Marketplace payouts fail in expensive ways, and a retried transfer can pay a seller twice.

    Solution

    Made transfers idempotent with a key derived from the withdrawal id, and added a partial unique index at the database level so a duplicate withdrawal request cannot even be created.

  5. 05
    Challenge

    Prices sent from the browser can be edited, and money bugs are the worst kind to ship.

    Solution

    Never trusted client amounts. Every price, fee, discount and tax figure is resolved from the database at checkout, stock is reserved when the order is created and restored if payment fails or times out, and Stripe webhooks are signature verified against the raw request body.

  6. 06
    Challenge

    Search ranking had to reward paying sellers without burying everyone else.

    Solution

    Wrote the ranking as an aggregation pipeline that sorts boosted listings first, then paid members, then free listings, and hides listings from sellers who have marked themselves unavailable.

  7. 07
    Challenge

    Every order event needed to reach the user in the app and by email, without being wired up by hand each time.

    Solution

    Routed everything through one notification call that writes the in app record and sends the email together, backed by around 60 branded templates, so a new event cannot ship with only half its notifications working.


04The product31 screens

Buylio screens