Launch
Waitlist referral codes and queue position
The Waitlist kit stores a unique refCode and computes position by counting earlier signups.
The Waitlist / Launch Kit stores each signup like this:
model Signup {
email String @unique
refCode String @unique
referredBy String?
createdAt DateTime @default(now())
}
refCode is randomBytes(4) hex, so it is short and unique. referredBy stores another signup’s code when the visitor arrived with one. It does not store a user id.
Position is the count of signups whose createdAt is earlier, plus one. The first person is position 1. The kit’s count sentence is the stored number plus the word “people”, including when the count is 1.
Settings.launched is a single boolean row. It does not email the list by itself. Export stays in the small admin. The flow is also written up in building a waitlist with referrals in Next.js.