Blueprint · Commerce

Restock waitlist

A waiting list for things a small shop has sold out of. People ask to be told when a thing comes back. When three come back, the stock goes to people in the order they asked. Each unit is held long enough for the person to act, is offered to nobody behind them until that time ends, and is never offered to the same person twice.

L2–L4

Level range

7

Sprints

35

Tasks

Backend and frontend

Built as

By the last sprint

What you’ll build

A waiting list for sold-out stock. Shoppers join the line and can leave it. When three come back in, the first three in line each get one held for them and are told once. A hold nobody claims passes to the next person by itself.

What you’ll learn

A skill in every sprint

You show you have it in a pull request your team reviews, then explain it in a walkthrough.

01

Stock that cannot go negative

You can decrement stock on a sale and prove that a hundred simultaneous orders for ten items produce ten sales and ninety refusals.

02

An order that moves through states

You can move an order through its states, refuse a transition that should not happen, and show the history of how it got where it is.

03

Notifications people do not mute

You can notify a user when an event concerns them, show an unread count that survives a refresh, and honour a preference that says stop.

04

Background jobs

You can hand work to a worker, tell the user it is in progress, and show the result when it lands — and say what happens to that work if the process dies halfway.

05

Email verification

You can issue a verification link, activate the account when it is followed, and explain what the link contains and why it cannot simply be a user id.

06

Going live

Somebody who has never met you can open a URL and use the product — and you can say what is different about the copy running there, where its secrets come from, and what you do when a release turns out to be wrong.

The roadmap

7 sprints, 35 tasks

Every sprint has a goal and a set of tasks. Open a sprint to see the tasks you will pick up.

  1. Sprint 01

    The shelf

    The shop has things with a count, and a thing at zero shows as sold out, not missing.

    5 tasks
    1. Give the shop owner a sign-in that shoppers cannot use
    2. Let the shop owner add things to the shelf with a count
    3. Show shoppers what is in stock and what is sold out
    4. Let a shopper buy one unit, and lower the count
    5. Make sure two shoppers buying the last unit at once gives one sale
  2. Sprint 02

    A place in the line

    A shopper asks to be told when a sold-out thing comes back, and can stop waiting whenever they like.

    5 tasks
    1. Let a shopper join the line for a sold-out thing without an account
    2. Keep each email address in a line only once
    3. Let a shopper leave the line with one button and no account
    4. Define the states of a place, and stop an ended place coming back
    5. Show the shop owner who is waiting for each thing
  3. Sprint 03

    Three units, fifty people

    Stock that comes back is held for the people at the front of the line, and nobody else can buy a held unit.

    5 tasks
    1. Record each delivery of stock as an event
    2. Hold one unit each for the first people in line when stock arrives
    3. Stop shoppers buying a unit that is held for somebody else
    4. Let the person holding a unit reserve it
    5. Put leftover stock on sale when more arrives than people waiting
  4. Sprint 04

    Telling them once

    The person whose unit is held gets one email, and it is still true when they open it.

    5 tasks
    1. Email each person whose unit is held, saying when the hold ends
    2. Send no email to people further down the line
    3. Make sure a second delivery does not email the same person twice
    4. Show what is true now when somebody opens an old email
    5. Show the shop owner who was emailed and when
  5. Sprint 05

    Nobody is watching

    A hold nobody uses ends by itself and passes to the next person in line, with nobody pressing anything.

    5 tasks
    1. End a hold by itself when its time runs out
    2. Pass a freed unit to the next person in line
    3. Make repeated background work send one email and create one hold
    4. Show the shop owner when the background work stops or fails
    5. Decide fairly when somebody reserves at the second their hold ends
  6. Sprint 06

    An address that is really theirs

    A place in the line is only offered a unit once its owner has confirmed they can read the email address they gave.

    5 tasks
    1. Offer units only to places whose email address has been confirmed
    2. Count each person's position from when they asked, not when they confirmed
    3. Help a shopper whose confirmation email has not arrived
    4. Make confirmation links impossible to guess or reuse
    5. Let somebody who never asked stop the emails
  7. Sprint 07

    Where the shop actually is

    The shop is on the internet at its own address, and the line keeps moving while the laptop is shut.

    5 tasks
    1. Put the shop online so a stranger can use it
    2. Move every setting and secret out of the code and into the environment
    3. Send real emails that reach the inbox and link to the live shop
    4. Keep the line moving on the live shop with nobody signed in
    5. Make a bad release easy to undo without losing open holds
The reading

Read before you build

Senior engineers read the docs before they touch the code. Every Blueprint comes with short documents on the product and its world, the kind a team hands a new hire. Read them well and you ask sharper questions and walk into every review prepared.

What you are building

The product, the two kinds of people who use it, and the three parts that make it hard.

How a restock waitlist actually works

What a waiting list gives a shop, the three ways to hand out stock that comes back, and why the hold time and the number of holds must be chosen together.

More commerce Blueprints

More to build

Not the one for you?

Every Blueprint is planned the same way, across health, shopping, money, education and more.

Browse all Blueprints
Ready?

Build restock waitlist.

Start your free week. Adaeze runs your kickoff, and Lars reviews every pull request.

Start today, for free