Project
KBM Website and Sprint Registration
I connected a Next.js registration flow to Paystack webhook signature checks and server-side reference verification. Resend delivers confirmation after the payment service records the successful transaction.
How it’s built View architectureHow it’s built
KBM Website and Sprint Registration · Sanity-driven Next.js marketing site and Paystack sprint registration for KBM
This is the public website for Know the Blocks Maven plus the separate sign-up app for its paid Sprint. The site runs on Next.js with a Sanity page builder of 32 section types, 17 public pages and 10 API routes for contact, newsletter, donations and Paystack. The sprint app takes payment for three plans and records it in MongoDB with an atomic upsert so the callback and webhook send confirmation emails through Resend only once.
- page-builder section types
- 32
- public pages
- 17
- API routes
- 10
- sprint payment plans
- 3
- lines of TypeScript in the main site
- 16,566
Technology and what it does here
- Next.js (App Router)
- Main site on Next 16.2.2 per package-lock; sprint app on Next 14.2.35
- Sanity
- Page builder, documents and singletons; Studio embedded at /studio; 14 seed scripts
- Paystack
- Donations and sprint payments: verify on callback, HMAC-SHA512 webhook signature check
- MongoDB (Mongoose)
- Payment, SprintLead and Enquiry models; atomic findOneAndUpdate upserts
- Resend
- Payment confirmations, contact, newsletter double opt-in and scheduled reminder broadcasts
- Tailwind CSS + Radix/shadcn
- Styling and UI components
- Framer Motion
- Section animations
- Zod + React Hook Form
- Form validation
- Vitest + Playwright
- Unit tests (3 test files) and e2e config
- Vercel
- Hosting (vercel.json); Edge middleware rate-limits /api to 10 requests per minute per IP
Implementation details
- Sprint payments use an upsert that only sets emailsSent=false on insert, then a second atomic claim, so the callback and webhook racing never send duplicate emails.
- Webhooks are authenticated with crypto.createHmac('sha512', secret) over the raw body against x-paystack-signature.
- The CMS page document lets editors compose pages from 32 section blocks.
- The training landing page schedules milestone reminder emails through a cron route and Resend audiences.
System architecture
The Next.js site uses Sanity for content and a dedicated registration flow for paid Sprint signups.
Technologies
- Next.js
- Sanity
- Paystack
- Resend
