Skip to content
All work

Charter

Configurable booking infrastructure

An open-source booking engine for tourism businesses. Configurable schemas let them offer very different services and take bookings online. Charter was the foundation of Corfu Travel Guide.

My role
Product design, architecture and development
Technology
TypeScript, React, Next.js, NestJS, MongoDB, Stripe
  1. Administrator
  2. Service schemaFields and pricing type
  3. OperatorTourism business
  4. Management appNext.js
  5. ServiceDetails and prices
  6. Booking formBuilt from the schema
  7. BookingPriced by the API
  8. StripePay now or save a card
  9. Payment updateWebhook
  • Managing services
  • From schema to booking
  • Payment
The schema was set up once. It then determined what operators filled in, what customers were asked and how the price was calculated.

The problem

A boat trip, a hire car and a restaurant table can all be booked, but they need different information and different pricing. A boat trip might charge by age, while a hire car might have several price tiers.

Booking software built for one kind of service doesn’t adapt well to the others. Building each one separately means repeating the same work on bookings, payments and administration.

The solution

In Charter, an administrator defined a schema for each type of service. It set the details operators provided, the questions customers answered, how prices were calculated and when payment was taken.

Operators created services from those schemas, and the customer-facing site built its booking forms from them. Corfu Travel Guide was built on Charter.

Technical challenges

Balancing flexibility and structure

If everything is configurable, the system ends up as a programming language with a worse editor. Charter offered a limited set of field types, content sections and booking questions. That was enough for varied services while keeping the data predictable.

Supporting different kinds of pricing

Prices could be paid on site, fixed, per person, split between adults and children, based on age groups or arranged in tiers. Each strategy had its own typed data and form. The API calculated the amount to charge from the saved booking and service.

Handling payment now or later

Some services took payment when the customer booked, while others charged later. Charter used Stripe payment intents to charge straight away, or setup intents to save a card for later. Stripe webhooks kept the booking’s payment status up to date.

Letting operators manage their own listings

Sending every small change through an administrator would have slowed everyone down. Charter had separate administrator and operator roles, with a more limited version of the management app where operators could update their own services.

Architecture

Charter had a NestJS API and two Next.js apps: one for managing services and one for customers. Shared TypeScript packages defined the data used by all three.

MongoDB suited the schema-based data, because services of different types stored different fields. Shared types set the structure for schemas, pricing and bookings.

The booking engine was separate from any one website. The API could support several instances, and Corfu Travel Guide was one customer-facing site built on it.

A service schema

{
  name: 'Boat trip',
  pricingStrategy: 'perAgeCohort',
  shouldPayNow: false,
  fields: [
    { key: 'departure', type: 'time', label: 'Departure time' },
    { key: 'duration', type: 'timeframe', label: 'Duration' },
  ],
  contentSections: [
    { key: 'included', type: 'bullets', title: 'What’s included' },
  ],
  additionalBookingFields: [
    { key: 'canSwim', type: 'boolean', title: 'Can everyone swim?' },
  ],
}
A simplified example based on Charter’s schema type. The boat trip values are examples.

My contribution

I designed and built Charter, including its schema model, API, management app, customer-facing app and payment process.