Skip to content
Ruby Foundry

SamplesDemo project

Inventory sync

Online store and register share one stock count.

For: A small yarn shop.

Build on topIntegrationsIn the works

Live demo coming soon. The demo is built and working; the screenshots on this page are from it, with made-up data.

Before

Before: at 4 PM on a Saturday the website says Moss Green DK has 4 left and is still taking orders, while the register says 1 left after three sold at the counter.
Open full size: Before: The website says 4 left. The register says 1.

The website says 4 left. The register says 1.

After

After: the online store, the register and the sync log side by side, with the log showing “Register sold 1 × Moss Green DK → Online store 5 → 4” applied in 11 ms.
Open full size: After: A sale at the register reaches the online store in about a second.

A sale at the register reaches the online store in about a second.

The problem

Fernwick Yarn Co. sells hand-dyed yarn in small batches, online and over the counter, and the two don’t talk to each other.

  • Someone copies the day’s register sales into the website by hand every evening.
  • Until they do, the website sells skeins the counter already sold. On a busy Saturday that meant two orders for yarn that was gone, two refunds, and two apology emails.
  • Nobody notices an item running low until a customer asks for it, and by then the next dye lot is a week away.

The shop doesn’t want a new system. It likes its online store and its register; it wants them to agree.

How we approached it

We leave both systems as they are and build the connection between them, and we’d run it as a one-week project:

  • Days 1–2: matching and the connection. We match every product in the online store to the same product at the register and list the few that don’t match for the owner to fix. Then we set up the two-way connection: each system tells us the moment it sells something, and we apply the change to the other.
  • Days 3–4: when things go wrong. A service is briefly down, a message arrives twice, both places sell the last skein in the same second. Each case gets a test, and the log says plainly what happened.
  • Day 5: alerts and handover. Low-stock alerts by email and text, the log the owner can check, and two guides.

One rule held throughout: a sale is applied as “one fewer”, never as “now there are 5”. Two sales at the same moment both count, and a message sent twice changes nothing.

In the demo, the online store and the register are stand-ins we built, and Fernwick and its stock are made up. For a real shop, Shopify and Square (or whichever tools the shop uses) plug in behind one adapter each.

What it does

  1. Nothing lost when one side is down

    Take the online store offline and keep selling at the register. Each change is held and retried, and the owner gets a “Sync delayed” email if it lasts.

  2. Caught up the moment it's back

    When the online store answers again, every held change goes through at once, in order, and the log says so.

  3. Low stock, before it runs out

    When an item reaches the level the owner picked, an email and a text: “3 skeins left (you asked to hear at 3). At this pace, sold out in about 5 days.”

  4. Both counts at a glance

    The Stock page shows each item in both places, whether they're in sync or waiting, its alert level, and how many days are left at the current pace.

  5. A log of what moved and when

    Every sale, every change applied to the other side with its old and new count, every retry and alert, so “why does the website say 3?” has an answer.

  6. The online store on a phone

    In the demo, the shop's online store is a stand-in we built. Buy a skein here and watch the register's count drop.

Technology used

Technology used in Inventory sync
Next.js and TypeScriptThe owner's screens, the connection, and the server code behind them, in one widely known framework.
Webhooks with signaturesHow each system says “I sold something”, the same way Shopify and Square do. Unsigned, altered, or replayed messages are refused, and a message sent twice is applied once.
PostgreSQLBoth systems' counts, the queue of changes still to apply, and the log, so a change is never half-applied.
A retrying queueChanges wait and retry when a system is down (after 5 seconds, 20 seconds, a minute, then every 5 minutes) and all go through the moment it answers again.
An OutboxThe alerts exactly as sent. Switching on real email and texts (for example Resend and Twilio) is one small, contained change.
Automated testsDozens of checks on the sync: outages, duplicates, the last skein sold twice, two workers at once, plus a robot that sells, takes the store down, and reads the alerts in a real browser.

Built to be handed over

Every project ends with two short guides, written for people rather than machines. The owner's guide explains, in plain words, how to run the software day to day. The engineer onboarding guide lets any developer you hire later find their way around the code, the hosting, and the data in an afternoon. You keep the code, so you are never stuck with us.

For this project, the owner's guide includes lines like this:

“Under Received, type how many arrived, for example 12, and tap Receive stock. The online store's count goes up by the same amount.”

What a project like this looks like

Scope

  • Every product matched between your online store and your register
  • A two-way connection that applies each sale to the other side within seconds
  • Held and retried changes when one side is down, so nothing is lost
  • Low-stock alerts by email and text, and a log of every change
  • An owner's guide and an engineer onboarding guide

From first call to finish

  1. A free 30-minute call
  2. A written, fixed quote
  3. A kickoff call within a week of signing
  4. 1 week of building, with a written update each week
  5. Launch and handover
  6. 30 days of fixes included

Typical total

about $4,500

Your own quote is written for your project and fixed before we start.