How to Build an Event Ticketing App
Ticketing is an inventory problem with a deadline. Hold seats during checkout, confirm on the payment webhook, and give the door team a scanner that works on bad Wi-Fi.

Key takeaways
- Never sell from a count you read a moment ago. Reserve tickets with a short hold, then confirm the order only when the payment webhook arrives.
- A ticket is a row with an unguessable code. The QR just carries that code; the scanner marks it used once.
- The door is the hardest moment: plan the check-in screen for speed, duplicates and a slow connection.
An event ticketing app needs four things to work: ticket types with a fixed number available, a checkout that holds tickets for a few minutes and confirms them only after payment succeeds, tickets delivered as QR codes, and a check-in screen that scans each code once at the door. Get the hold and confirm step right and you never oversell; get the door screen right and the night goes smoothly. Everything else is presentation.
When building your own beats a ticketing platform
Ticketing platforms are convenient and charge per ticket for it. Building your own makes sense when you run events regularly (a venue, a club night, a conference series, a sports league), when per-ticket fees add up, or when you want the buyer list, branding and flow to be yours. For a single one-off event, a platform is usually the better call. Startbase Cloud payments run through your own Stripe account, money lands there directly, and Startbase adds no fee of its own; Stripe's processing fees still apply.
The data model
- events: title, description, venue name and address, start and end times with a time zone, cover image, status (draft, on sale, sold out, past, cancelled) and the organizer.
- ticket_types: event id, name (General, VIP, Early bird), price in cents, currency, quantity available, sale start and end, and a per-order maximum.
- orders: buyer email and name, event id, status (pending, paid, expired, refunded), total, the Stripe checkout session id, and a hold expiry time.
- order_items: order id, ticket type id, quantity.
- tickets: one row per admission, created when the order is paid: order id, ticket type, attendee name, a long random code, and checked-in time and by whom (empty until scanned).
- staff: who may scan tickets for which event.
Store money as whole cents, never decimals, and store times with their time zone. "Doors at 8" means nothing to a buyer in another city without it.
Inventory: how not to oversell
The classic bug: two buyers both see "1 left", both pay, and you have one seat. The fix is to treat availability as a calculation the server does at the moment of reserving, not a number the app displayed earlier.
- 01Available for a ticket type equals quantity minus tickets in paid orders minus tickets in pending orders whose hold has not expired.
- 02When a buyer clicks Checkout, a server function checks availability and creates a pending order with a hold of about ten minutes in one database transaction, locking the ticket type row so two requests cannot both pass the check.
- 03It then creates the Stripe checkout session and sends the buyer to it.
- 04Stripe calls your webhook when payment succeeds. The webhook marks the order paid, creates the ticket rows and sends the email. Only the webhook does this, never the "thank you" page, because buyers close tabs.
- 05A scheduled job every few minutes marks unpaid orders past their hold as expired, which returns those tickets to the pool.
In Startbase Cloud, the checkout and webhook run as edge functions, where your Stripe keys stay server-side, and the cleanup runs as a job on pg_cron (schedules are in UTC). With Stripe Connect the app can start a checkout with the createCheckout helper and no keys in your code; if you wire Stripe yourself, you save the secret key and the webhook signing secret in Secrets. The payments docs cover both paths.
Tickets, QR codes and delivery
A QR code is just a picture of text. The text should be the ticket's random code (at least 20 characters from a secure random source), not an order number someone can count through. Anyone with the code can get in, so the security lives in the scanner: it looks the code up, checks it belongs to tonight's event and has not been used, and marks it used in one step.
Deliver tickets two ways: an email sent from the webhook with a link to a ticket page, and the ticket page itself, which shows one QR per admission with the attendee name and event details. Startbase Cloud apps can send email through the platform sender with no setup, within a daily limit per project; for a large on-sale, connect your own sending domain so tickets arrive from your brand at volume. See Emails.
The door: check-in that survives a queue
The check-in screen runs on a staff phone in a dark doorway with a line of impatient people. Design for that:
- Full-screen camera scanner with a huge green or red result and a sound, readable at arm's length.
- Clear reasons on red: already checked in (and at what time, by which staff member), wrong event, refunded, not found.
- Manual search by name or email for people whose phone died.
- A live count: checked in versus sold, so the organizer knows when the room is full.
- Weak connection tolerance: preload tonight's ticket codes when the screen opens so a scan can be judged instantly, then confirm with the server. If two doors scan the same code, the server decides and the second one shows "already checked in".
All the screens of version one
- 01Event page: details, map link, ticket types with prices and "only a few left" once stock is low.
- 02Checkout: quantity per type, buyer name and email, then Stripe.
- 03Confirmation and ticket page: QR codes, add to calendar, venue directions.
- 04Organizer dashboard: create events and ticket types, sales by type, buyer list with CSV export, refunds.
- 05Check-in scanner for staff.
What to leave out of version one
- Reserved seating maps. Picking specific seats is a different, much harder product; general admission and zones cover most events.
- Ticket transfers and resale between buyers.
- Promo codes beyond one simple discount code type.
- Multi-organizer marketplaces with payouts to each organizer.
- Wallet passes.
A brief you can paste
Build a ticketing app for my monthly comedy nights. I create events with title, description, venue, start time with time zone and cover image, and ticket types (name, price, quantity, sale window, max 6 per order). Buyers do not need an account: they pick quantities, enter name and email, and pay with Stripe. When they click checkout, a server function checks availability and creates a pending order that holds the tickets for 10 minutes; a job every 5 minutes expires unpaid holds. Only the Stripe webhook marks orders paid, creates one ticket per admission with a long random code, and emails a link to the ticket page showing a QR per ticket. Staff accounts get a full-screen scanner: big green or red result, the reason when red (already used with time, wrong event, refunded), manual search by name, and a checked-in versus sold count. Organizer dashboard: sales per ticket type, buyer list with CSV export, refund button.
Run the whole flow in Stripe test mode before going live, including a buyer who abandons checkout (the hold should expire and stock should come back). If you also take bookings for classes or appointments rather than one-off events, the booking system guide covers time slots and calendars, and the bookings use case shows the range of what people build. For budget ranges, see what a booking app costs.
Frequently asked questions
How do ticketing apps prevent overselling?
They reserve tickets with a short hold when checkout starts, checking availability on the server inside a transaction, and confirm the order only when the payment provider reports success. Expired holds release tickets back to the pool.
How do QR code tickets work?
Each ticket has a long random code stored in the database, and the QR code encodes that code. At the door, a scanner looks it up, checks the event and whether it was already used, and marks it checked in.
Can people buy tickets without creating an account?
Yes, and for events it usually converts better. Collect a name and email at checkout and send the tickets by email with a link to a ticket page.
Who receives the money when I sell tickets through my own app?
With Startbase Cloud payments, money goes to your own Stripe account. Startbase does not hold it and adds no fee of its own; Stripe charges its usual processing fees.
