Quatre Gats Editorial

An online bookshop and publishing platform with rock-solid checkout, built so two customers can never accidentally buy the last copy of the same book.

Live, deployed on KubernetesDevelopmentHosting

Overview

An independent Catalan publisher's online bookshop and editorial studio: books, manga, and comics for sale, alongside editorial services and a community creative-writing forum. One connected system: a storefront for customers, a back office for staff, and secure payments throughout.

The problem

Selling physical books online means checkout has to work flawlessly even when many customers are buying at once, since two people can't both successfully order the last copy of the same book. On top of that, the catalog needed to work seamlessly in Catalan, Spanish, and English, alongside a lighter editorial and community section.

The solution

We built checkout so stock is safely reserved the moment an order starts, guaranteeing a book is never sold twice, even during a rush. Payments run securely through Stripe, and every order is double-checked before it's confirmed as paid, so a hiccup in the payment process can never accidentally charge or ship an order twice. The entire catalog, books, categories, and content, was built multi-language from day one, so browsing in Catalan, Spanish, or English is seamless.

Architecture

Three Kubernetes deployments (backend, storefront, admin), exposed directly via LoadBalancer, with a separate Job handling database migrations gated behind safe-by-default flags.

Technologies

Backend

Go 1.23chi routerdatabase/sql (raw SQL)MySQLgolang-jwtbcrypt

Payments

Stripe Checkout + webhooks

Frontend

ViteReact 18TanStack QueryTailwind CSS

Infrastructure

DockerKubernetes

Engineering challenges

Preventing overselling under concurrent checkout

Stock is checked and row-locked (SELECT ... FOR UPDATE) inside the same transaction that creates the pending order, and the eventual stock decrement includes a WHERE stock >= ? guard: two independent safeguards against the same race condition.

Idempotent, signature-verified payment webhooks

The Stripe webhook verifies the event signature before doing anything, and checks whether the order is already marked paid before reprocessing, so a duplicate webhook delivery can't double-fulfil an order.

Multi-locale content as first-class schema, not JSON blobs

Books, authors, categories, news, and forum posts each have a dedicated per-locale translation table rather than a single JSON column per entity: more migration overhead, but queryable and indexable per locale.

Results

  • Checkout is built to never oversell: even if hundreds of people try to buy the same book at once, only one order goes through.
  • The whole catalog already works in three languages, so expanding into new markets or languages later is a quick change, not a data migration.
  • Built to grow: the storefront, back office, and underlying systems can all scale independently as the business expands.

Want something like this?