COMING SOON Backend API integration with Node.js + MongoDB Atlas — see roadmap →
Backend integration · in active development

The engine behind
every Tickitz API call.

Node.js powers the backend API, MongoDB Atlas stores the data, and the Tickitz SDK keeps client integration simple — here's exactly how it is built.

<5ms Cold start (Node backend)
300+ Global performance points
99.99% Uptime SLA
E2E Encrypted at rest + transit

Four layers.
One coherent system.

The backend is split into well-defined layers — each one responsible for a specific concern, deployable and scalable independently.

Backend API layer

A modern Node.js API backend that handles queue orchestration, booking state, and MongoDB persistence with the official driver. Easy to self-host or deploy to any Node host.

  • Express-compatible REST layer
  • MongoDB driver for atomic queue operations
  • API key authentication middleware
  • Configurable rate limiting and caching

MongoDB Atlas storage

All stateful data — events, customers, bookings, queue entries, tickets, and audit logs — lives in MongoDB Atlas with multi-region replication and automatic failover.

  • Persistent event and booking state
  • Queue position and TTL metadata
  • Full audit trail for compliance
  • Atlas Search for analytics queries

Queue engine

The beating heart of the system. Fairness-ordered waiting rooms with bot-resistant tokens, session-locked inventory, and configurable hold TTLs — all processed atomically via MongoDB transactions.

  • First-in first-served position tracking
  • Atomic inventory locks — zero oversell
  • HMAC-signed queue tokens
  • Automatic expiry and re-release

Tickitz SDK

The SDK wraps the backend API so developers never touch raw fetch calls. Full TypeScript types, managed polling loops, webhook verification helpers, and auto-retry on transient failures.

  • Works in Node.js, browser, and server-rendered runtimes
  • Queue polling loop built-in
  • Typed methods with IntelliSense support
  • Available on npm as @tickitz/sdk

How the layers
connect.

Your app talks to the SDK. The SDK calls the Node.js backend. The backend reads and writes MongoDB and emits webhooks back to your server. Each layer has a single responsibility and a clean boundary.

  • Vercel hosts the static website, docs, and SDK demo pages
  • Node.js backend handles queue orchestration, booking confirmation, and MongoDB persistence
  • MongoDB Atlas stores all stateful data with multi-region replication and atomic transactions
  • Optional cache stores queue state and API key lookups for sub-millisecond reads
system architecture tickitz.io
client Your application any runtime
SDK · HTTPS
backend Node.js API server api.tickitz.io / self-hosted
MongoDB driver
cache Optional cache in-memory / CDN / Redis
MongoDB driver
db MongoDB Atlas multi-region · M10+
HMAC webhooks
webhook Your webhook endpoint booking · queue · fraud

Six steps from
zero to production.

Stand up a Node.js backend, install the SDK, configure your keys, and start calling the API. The queue and booking workflows are handled server-side with MongoDB persistence.

01

Install the SDK

Install the official package from npm. Works in Node.js, browser apps, and server-rendered environments.

npm install @tickitz/sdk
02

Configure the client

Pass your API key — generated in the Tickitz dashboard — to the constructor. Point the SDK at your backend API endpoint.

new Tickitz({ apiKey: process.env.TICKITZ_API_KEY, baseUrl: process.env.API_URL })
03

Create an event

Define tiers, capacity, and schedule. Tickitz persists the event in MongoDB Atlas and returns a live public URL.

tickitz.events.create({ ... })
04

Handle the queue

For high-demand drops, customers join the waiting room. The SDK manages the polling loop — you just handle position updates in your UI.

tickitz.queue.join({ eventId, items })
05

Confirm and issue

Once inventory is locked, confirm the booking against your Stripe payment intent. Tickets are auto-issued and QR codes generated instantly.

tickitz.bookings.confirm(bookingId)
06

Receive webhooks

Register your endpoint in the dashboard. The backend delivers HMAC-signed events — booking confirmations, fraud alerts, queue readiness — with automatic retries.

queue.ready · booking.confirmed

Node.js-first API,
with MongoDB persistence.

The Tickitz backend runs on Node.js, exposes REST endpoints for queue operations and bookings, and uses the official MongoDB driver for atomic state transitions. Authentication, queue locking, and webhook delivery all live in the same server layer.

API key auth Rate limiting Cache-friendly layer Request logging Telemetry hooks CORS handling
server.ts
// Node.js backend — queue join handler
import express from "express";
const app = express();

app.post("/queue/join", async (req, res) => {
    // 1. Authenticate API key
    const apiKey = req.headers.get("x-api-key");
    const org = await env.KV.get(`key:${apiKey}`);
    if (!org) return new Response("Unauthorized", {
      status: 401
    });

    // 2. Parse and validate body
    const body = await req.json();
    const { eventId, customerId, items } = body;

    // 3. Atomic queue insert via MongoDB
    const entry = await db.queue.insertOne({
      eventId, customerId, items,
      token: signToken(customerId, env.SECRET),
      joinedAt: new Date(),
    });

    // 4. Return position
    return Response.json({
      token: entry.token,
      position: await db.queue.countDocuments({
        eventId, joinedAt: { $lt: entry.joinedAt }
      }),
    });
  }
};

One cluster.
All your data.

Atlas provides the persistence layer for every object in the Tickitz system. Multi-document transactions prevent race conditions during queue confirms and booking creation. Indexes are tuned for high-concurrency event drops.

  • Multi-document ACID transactions for atomic booking confirmation
  • TTL indexes auto-expire pending queue entries — no cron job needed
  • Change streams power real-time dashboard analytics
  • Compound indexes on eventId + joinedAt for O(1) position queries
  • Multi-region replication to US-East, EU-West, AP-Southeast
schema.ts
// MongoDB collection schemas

// events collection
interface EventDoc {
  _id:       ObjectId;
  orgId:     string;
  title:     string;
  slug:      string;    // unique index
  status:    "draft" | "live" | "ended";
  tiers:     TierDoc[];
  capacity:  number;
  soldCount: number;   // atomic $inc
  startsAt:  Date;
}

// queue collection — TTL index on expiresAt
interface QueueDoc {
  _id:          ObjectId;
  eventId:      string;
  customerId:   string;
  token:        string;   // HMAC-signed
  joinedAt:     Date;     // compound index
  status:       "waiting" | "ready" | "expired";
  expiresAt:    Date;     // TTL index
  bookingId?:   string;
}

// bookings collection
interface BookingDoc {
  _id:          ObjectId;
  eventId:      string;
  customerId:   string;
  status:       "pending" | "confirmed" | "refunded";
  totalCents:   number;
  fraudScore:   number;
  tickets:      TicketDoc[];
}

What happens
inside every call.

From SDK method call to confirmed booking, here is every hop your request makes — and how the system ensures consistency even under concurrent load at event drop time.

Request lifecycle docs →
request trace — bookings.confirm live
SDK POST /v1/bookings/confirm · idempotency-key attached +0ms
CF API key validated from KV cache +2ms
CF Rate limit check passed (org quota) +3ms
DB Begin multi-document transaction +6ms
DB events.$inc soldCount · check capacity +8ms
DB bookings.status → "confirmed" · tickets issued +10ms
DB Transaction committed +11ms
WH booking.confirmed webhook queued +12ms
SDK 200 OK · booking + tickets returned +14ms

What's shipped
and what's next.

The backend integration is being built in phases. Here is exactly where each piece stands — and what is coming next in the queue.

Get notified when it ships →
SDK core — events, bookings, customers
Full TypeScript SDK with typed methods for event creation, booking lifecycle, and customer management. Published on npm as @tickitz/sdk.
✓ shipped
Tickets module + QR check-in
Auto-issuance on booking confirmation, HMAC-signed QR payloads, hosted PNG image URLs, and the atomic scan endpoint for gate staff.
✓ shipped
Node.js backend API endpoints
Migrating all API routes from the prototype server to Node.js. Auth middleware, rate limiting, and queue state orchestration are in active development.
⬤ in progress
MongoDB Atlas integration
Schema design, indexes, TTL configuration, and multi-document transaction wiring for the queue and booking confirm flows.
⬤ in progress
Webhook delivery engine
HMAC-signed delivery with exponential backoff over 72 hours, all 14 event types, configurable per-endpoint event filters.
· planned
Fraud detection + dashboard API
Composite risk scoring pipeline, configurable thresholds per event, and the analytics/stats endpoints for programmatic dashboard access.
· planned

Ready to integrate?

The SDK is live on npm today. Backend API endpoints are in active development — get notified the moment they ship.

npm install @tickitz/sdk