Build a launch page with a waitlist
Visitors join with their email and land on their place in line with a link to share; everyone who joins with the link and confirms their email moves them up. Admins sign in with an emailed link, see sign-ups per day, export the list as CSV, and invite the next N people.
What you'll build
What it shows: Public pages with no accounts, records with a unique field, aggregates, a job that works through a list in batches and is safe to retry, and email through the team's own Resend account.
Before you start
- The CLI:
npm i -g @inferencebureau/apps, thenib-apps loginonce. - Resend, for place links, sign-in links and invites.
Create the app from the recipe
One command creates the app on Inference Bureau and downloads its files into ./my-waitlist. Web is the default platform, so the recipe id is all it takes.
ib-apps create my-waitlist --recipe waitlistTour what the recipe loaded
The recipe replaces the starter, keeping the coding-agent guidance. Here's where each piece lives.
| Where | What's there |
|---|---|
signup/actions/join.ts, web/lib/waitlist.ts | join puts an email at the back of the list with the next join number and the referrer of the link it came by (/r/<code> keeps it in a cookie). The email is unique, so joining twice sends a fresh place link instead of a second row. |
signup/actions/confirm.ts, recount.ts | The place link carries a random token whose hash is on the record, so the place page needs no account. Opening it from the email confirms the address and queues recount for the referrer, who moves up REFERRAL_BONUS places per confirmed referral. |
web/lib/reports.ts, web/app/admin/export.csv/ | Someone's place is an aggregate count of who's ahead; the admin's figures are aggregates too, and the CSV streams every sign-up a page at a time. |
adminSession/actions/, web/lib/admin.ts | Admins are the addresses in ADMIN_EMAILS. They sign in with a link good once, for 15 minutes; every admin page and server action checks the session. |
wave/actions/, api/actions/sendInvites.ts | Invite the next N starts a wave and queues sendInvites: 25 invites per job from the top of the list, then the next batch under the same concurrency key. Each send carries an idempotency key, so a retried job never emails anyone twice. |
tests/waitlist.test.ts | The actions and the job, with Resend stubbed: referrals that count only once confirmed, batches in place order, a refused address, an outage that retries, a stopped wave. |
// api/actions/sendInvites.ts (excerpt): a wave's next batch, from the top of the list at that moment.
const { records } = await api.signup.findMany({ filter: { status: { equals: "waiting" } }, sort: [...PLACE_ORDER], first: Math.min(BATCH, left) });
for (const signup of records) {
if (signal.aborted) return;
const result = await sendInvite(signup, signal); // Resend, with idempotency-key invite/<signup id>
if (result.ok) await api.signup.run("markInvited", { id: signup.id, params: { wave: id } });
else await api.signup.run("markInviteFailed", { id: signup.id, params: { wave: id, error: result.error } });
}
const { record: after } = await api.wave.run("tally", { id });
if (after!.status === "running") await api.enqueue("sendInvites", { wave: id }, { concurrencyKey: INVITES_KEY, retries: 10 });Check what it set on the app
Nothing to do here: this is what the recipe configured, so you know where to look in Settings later.
ADMIN_EMAILSSet its keys
On Settings → Environment variables, for development first:
| Name | Where it comes from |
|---|---|
ADMIN_EMAILS | the addresses that may sign in to /admin, comma-separated |
INVITE_URL | optional: where the invite's button goes, such as your product's sign-up page |
Finish setup
- Set
ADMIN_EMAILSon Settings → Environment variables: who may open/admin - Connect Resend in Settings → Integrations, so place links and invites go out
- Change the launch page's words in
web/lib/site.ts, then join from the app's address and sign in at/admin
In development without Resend, every email goes to Logs and the pages show its link, so you can try it before connecting anything.
Run it
ib-apps dev syncs both ways while you work and runs the development server.
cd my-waitlist
ib-apps devTry it end to end
Make it yours
The launch page's copy is in web/lib/site.ts, and each email's wording and look is a React Email template in web/emails/.
ib-apps domains add launch.example.com; see Custom domains.
ib-apps test runs its tests, then ib-apps deploy sends development to production; set the keys on production first. See Deploys.