Skip to content
Zohaib Ahmed

Case study · Booking marketplace

SportBook

Players find, book and pay for sports courts online, venue owners are paid out automatically — and the same slot can never be sold twice.

Type
Booking marketplace
Role
Lead back-end developer (team of two)
Stack
Next.js, MongoDB, Stripe Connect, Firebase

SportBook is an online booking marketplace for indoor sports venues — cricket, futsal, badminton and more. Players see live availability, book a court and pay in one flow; venue owners manage their grounds and receive payouts automatically; and admins verify every venue before it goes live. I built it with one other developer, leading the back end, payments and booking logic.

The problem

Most indoor sports venues still take bookings by phone or WhatsApp. Players can't see what's free without asking, owners juggle paper calendars and cash, and two people can easily end up booked into the same slot.

An online marketplace fixes that only if it can be trusted with money: every slot must be sold exactly once, every payment must turn into a booking — or a refund — and each owner must receive their share without manual work.

The solution

I built SportBook as a Next.js application with its own API, MongoDB for data, Firebase for sign-in and Stripe Connect for payments. Each payment is split automatically: 90% goes to the venue owner and 10% to the platform.

When a player picks a slot, it's held for five minutes while they pay. The database itself rejects a second hold on the same court and time, so double bookings are impossible even when two people click at once. Stripe confirms every payment directly to the server, so a booking is still created if the player closes the browser — and if a slot is somehow taken in the meantime, the payment is refunded automatically.

I then prepared it for production: every API request is verified on the server, sensitive endpoints are rate-limited, owners' ID and business documents are stored privately and shown to admins through short-lived links, errors are reported to Sentry, and automated tests run on every push.

Key features

  • Live court availability with 5-minute holds during checkout
  • Online payments with automatic 90/10 owner payouts (Stripe Connect)
  • Automatic refunds when a paid slot can't be confirmed
  • Optional same-day dynamic pricing for peak hours, weekends and weather
  • Slot recommendations that adjust weekly from what players actually book
  • Player–owner messaging, reviews, favourites and a help chatbot
  • Map search for nearby venues
  • Admin verification of venues and owners, with revenue analytics

The result

The booking and payment flow is covered by automated tests that run on every push — including one that sends two bookings for the same slot at the same moment and confirms only one succeeds. Payments can't be lost between Stripe and the database, refunds can't be issued twice, and owners are paid without anyone moving money by hand.

Tech stack

  • Next.js

    Web app and REST API

  • MongoDB

    Grounds, bookings, slot holds and messages

  • Stripe Connect

    Checkout, owner payouts and refunds

  • Firebase

    Sign-in and private document storage

  • Vitest + GitHub Actions

    Automated tests on every push

  • Sentry

    Error monitoring for payments and webhooks

Need something similar?

These services cover the work behind this project.

More case studies

Have an idea? Let's make it real.

One message is all it takes to get started.