DEV Community

Sam Dreams Maker
Sam Dreams Maker

Posted on

Building a Marketplace for Self-Published Authors: Architecture Decisions

Most writing platforms treat publishing as an afterthought. Write your story, export a file, figure out distribution yourself. I wanted TaleForge to close that loop — write, publish, and sell in one place.

The Marketplace Model

The marketplace needed to support several publishing models:

  • Free publications (exposure-focused)
  • Paid publications (fixed price via Stripe)
  • Freemium (first N chapters free, rest behind paywall)
  • Tips (readers can tip authors they appreciate)

The freemium model turned out to be the most popular. It mirrors how web novel platforms like Royal Road and Tapas work: hook readers with free chapters, convert them on quality.

Stripe Integration

Payments run through Stripe Connect (Custom accounts). Each author is a connected account. When a reader buys a book:

  1. Payment goes to the platform's Stripe account
  2. Platform takes a cut (15%)
  3. Rest is transferred to the author's connected account

The webhook handling was surprisingly tricky. Stripe sends events to your webhook URL, but if your domain redirects (e.g., example.com → www.example.com), the webhook gets a 307 redirect and fails silently. Lesson learned: always use the canonical URL.

// Webhook route - must return 200 quickly
export async function POST(req: Request) {
  const body = await req.text();
  const sig = req.headers.get('stripe-signature')!;

  const event = stripe.webhooks.constructEvent(
    body, sig, process.env.STRIPE_WEBHOOK_SECRET!
  );

  switch (event.type) {
    case 'checkout.session.completed':
      await handlePurchase(event.data.object);
      break;
    case 'customer.subscription.created':
      await handleSubscription(event.data.object);
      break;
  }

  return new Response('OK', { status: 200 });
}
Enter fullscreen mode Exit fullscreen mode

The Discovery Problem

A marketplace is useless if readers can't find stories. I built several discovery mechanisms:

Search: Full-text search across titles, descriptions, and author names. Autocomplete suggestions as you type. Advanced filters by genre, length, rating, language, and price.

Discovery pages: Curated sections — trending (based on recent reads/purchases), new releases, top-rated, completed works, and staff picks.

Personalized recommendations: Based on reading history and genre preferences. Nothing fancy — collaborative filtering would be overkill at this scale. Simple "readers who liked X also liked Y" logic.

Genre browsing: 15+ genre categories with chip-style filters.

Publication Workflow

The publish flow needed to be simple but flexible:

  1. Author marks a project as "ready to publish"
  2. Sets metadata: description, genre, tags, cover image, pricing
  3. Cover editor with cropping (2:3 ratio for book covers) and templates
  4. Preview how it looks in the marketplace
  5. Publish — immediately live

Updates sync automatically. Edit a chapter → the published version updates. No re-publishing needed.

What Worked

  • Freemium model: Higher conversion than fixed pricing. Readers who sample 3+ chapters buy at ~20% rate.
  • Cover editor: Authors without design skills can create decent covers. The 2:3 crop ratio and templates help a lot.
  • Reading progress: Saving where readers left off increases return visits.

What Didn't

  • Social features before content: I built reviews, reading lists, and follow systems before there was enough content to make them useful. Social features need critical mass.
  • Too many export formats: Supporting EPUB, DOCX, PDF, Fountain, manga PDF, webtoon PDF, and ZIP was technically fun but most users only need 1-2 formats.

Open Source?

The codebase isn't open source (yet), but I've shared the technical architecture freely. If you're building something similar, the key insight is: treat the marketplace as a first-class feature, not a bolt-on. Your data model, your editor, your export pipeline — they should all be designed with publishing in mind from the start.

Check it out at tale-forge.com — the book editor is free.


TaleForge by Dreams-Makers Studio

Top comments (0)