A few weekends ago we built Stax — a multi-seller template marketplace where any signed-in user can become a seller, upload Notion/Figma/Webflow/code templates, set their own price, and start collecting payouts. The platform takes a 5% cut on every paid sale.
Live demo →
Here's the architecture and the tradeoffs.
The hard parts of a marketplace (and how we skipped most of them)
A "real" marketplace needs all of this on day one:
- Authentication for both buyers and sellers
- Payment routing — money has to land on the seller's account, minus your cut
- KYC for anyone receiving payouts
- File delivery with access control
- A discount/promo engine
- A review system
We use Whop for four of them, which collapsed weeks of plumbing into a single SDK:
- Whop OAuth for sign-in (handles credentials, recovery, sessions).
- Whop for Platforms for connected accounts and payment splits via application_fee_amount on each checkout. No Stripe Connect setup, no manual payouts.
- Whop hosted KYC for seller verification.
- Whop Promo Codes API — sellers issue their own codes, scoped to their templates, redeemed at the embedded checkout.
That leaves files + reviews + UI to build ourselves.
Stack
- Next.js App Router + Turbopack, deployed on Vercel
- Neon Postgres via the Vercel integration (auto-populated DATABASE_URL)
- Prisma 7 with @prisma/adapter-pg
- UploadThing for file uploads (preview images on public routes, downloadables gated)
- iron-session for encrypted cookie sessions (no Redis)
- Zod for env + input validation
- Tailwind (CSS-first config, @theme blocks, no config file)
The payment flow
This is the part that usually takes weeks. With Whop for Platforms:
- Seller signs in → clicks "Become a seller" → app creates a connected company under our parent Whop platform company → Whop redirects them through hosted KYC.
- Seller publishes a template → app creates a Whop product on the seller's connected company → creates a checkout configuration with application_fee_amount (our 5% cut).
- Buyer pays via embedded checkout. Whop processes payment, deducts the fee, routes the rest to the seller's connected balance.
- Whop fires payment.succeeded to our company-level webhook (with connected-account events on). Handler verifies signature, checks idempotency, creates a Purchase record.
- Sellers manage payouts in an embedded Whop payout portal on their dashboard.
Free templates skip checkout entirely — a server API route creates the Purchase directly.
Deploy-first workflow
We push to Vercel before we write real code. Reasons:
- OAuth needs a real callback URL, so the production domain has to exist
- Neon auto-populates connection strings across all environments through the Vercel integration
- Whop sandbox (sandbox.whop.com) gives us test accounts and test payments so iteration stays safe
A small vercel.ts build config runs prisma generate && prisma db push && next build on every deploy — Prisma 7 doesn't run generate automatically anymore.
Code + tutorial
- Repo + full step-by-step tutorial → original post on whop.com
- Building a SaaS instead? Skip the scaffolding with npx create-whop-kit my-app — it sets up whopio/whop-saas-starter with auth, pricing, billing portal, and subscription tiers already wired.
If you've shipped a marketplace before and want to skip Stripe Connect entirely, this stack is worth a look.
_
Originally published on Whop: https://whop.com/blog/build-a-template-marketplace/_
Top comments (0)