Overview
GreenZTL (greenz.com) is a web-novel reading and publishing platform. Readers discover and read serialised novels. Writers publish them and earn from premium chapters, subscriptions, pre-orders and tips. Everything runs on leaves, the platform’s own currency: 100 leaves equal $1.
I built it at tarunSoft as the main developer, writing most of the code across the reader site, the writer studio and the API. The platform has three parts:
- The reader site, for discovering, reading and paying (Next.js)
- Greenz Studio, where writers publish, monetise, track earnings and get paid; staff use it to run the platform (Next.js)
- The API, behind both (NestJS, Prisma, MySQL, Redis)
![]()
The challenge
A paid fiction platform is really an economy, and an economy has to be exact:
- Several ways to pay for the same thing. A premium chapter can be unlocked one at a time with leaves, through a subscription to the novel, or by backing a pre-order campaign. Writers decide which apply.
- Writers get paid real money. Earnings come from purchases, subscriptions, tips and campaigns, minus a platform fee. They have to be correct to the leaf, explainable, and never taxed twice when a fee changes.
- Reading is the product. Readers spend hours in the chapter view, so it has to be comfortable, fast and personal.
- Writers publish on a schedule. Chapters are released at set times, imported from Google Docs, and announced to the community on Discord.
The solution
Discovery for readers
The home page leads with a featured slider, then trending lists (popular, trending and new, by
period), recently released chapters, categories, editor’s picks and fan favourites. Readers can
filter novels by genre and tag, search from anywhere with ⌘K, keep a library, and choose
whether to see 18+ content.
![]()
![]()
Each novel page shows ratings, genres and tags, a synopsis, the release status, the latest chapters split into free and premium, and buttons to read or tip the writer.
![]()
A reader built for long sessions
The chapter reader is where readers spend their time:
- Reader settings follow you across devices: font, size, line height, paragraph spacing, hiding the interface or images, and immersive story blocks (styled RPG, chat and notification blocks).
- Paginated or infinite reading. In infinite mode the next chapter appends as you scroll, and the URL follows along. Readers can also choose page mode, with ebook-style columns.
- Read-ahead preloading. At about 90% through a chapter, the next one loads quietly, so there’s no wait at the boundary.
- Auto-scroll with smart pacing that slows for long paragraphs.
- Footnotes, glossary terms and character references open as hover cards on desktop, and as bottom sheets on phones.
- Auto-unlock: premium chapters can unlock themselves as you reach them, with a small toast. If you can’t afford one, the reader falls back to the normal unlock card.
![]()
Leaves: one currency for everything
Readers buy leaf packs or a recurring leaf membership with Stripe, with bonus leaves on bigger packs. They spend leaves to:
- unlock a premium chapter, which they keep forever
- subscribe to a novel’s tier, renewed from their wallet with a grace window
- back a pre-order campaign, refunded if it doesn’t reach its goal
- tip a writer
Unlocks can’t charge twice or overdraw the wallet. If a writer raises a tier’s price, existing subscribers keep their old price until they accept the change.
![]()
Greenz Studio, for writers and staff
Writers sign up, verify their email, and publish straight away; there’s no waiting for approval. They can also sign in with Google or Discord. From the studio they can:
- write chapters in a rich editor, with immersive blocks, footnotes, glossary terms and character references
- import chapters from Google Docs or Drive
- schedule releases and bulk-publish
- choose how premium chapters unlock (leaves, subscription or both), set prices, and decide whether the first or last chapters are premium
- create subscription tiers and pre-order campaigns, both reviewed by staff
- set SEO per novel and per chapter
- see analytics, subscribers and earnings (gross, platform fee and net, with monthly statements)
- request withdrawals to bank, PayPal or Wise
![]()
The chapters view works across every novel at once. A pipeline shows how many chapters are drafts, in review, need changes or are published, and a single table can be filtered by status and access and bulk-edited.
![]()
Analytics tracks views, reads, average completion and read time, plots engagement over time and ranks the best-performing chapters. Subscribers works like a small reader CRM, with retention, churn and leaves spent per reader.
![]()
![]()
Earnings separates gross, the platform fee and net. It shows what the platform still owes the writer and where the money came from, and the writer can withdraw from there. Promotions let writers attach chapter-end cards and widgets that point readers to their other series.
![]()
![]()
Payout details are encrypted at rest, and only a masked label is shown back. Requests move from pending to approved to paid, and staff settle them. Staff also run the leaf economy (conversion rate, platform fee, minimum withdrawal, leaf plans), suspend or reinstate writers, message writers from a shared inbox with templates, run site-wide promotions, and manage writer referral rewards through Discord.
![]()
Events and community
Readers can browse and register for events, such as a “Share Your Story” event on the site or a feedback session on Discord. The platform also connects to Discord for roles and announcements.
![]()
Under the hood
- NestJS 11 API with 50+ feature modules, and Prisma 6 on MySQL with 113 models. A strict validation pipe means every request body is checked against a DTO.
- Earnings are always derived from the underlying records (purchases, subscription charges, tips and campaign contributions), never kept as a balance someone edits by hand. A settled payout locks in its fee rate, so later fee changes never alter it.
- Background work with BullMQ and Redis: scheduled chapter releases, Google Docs imports and image optimisation run as queue jobs, triggered by cron.
- Real-time notifications over a Socket.IO gateway.
- Integrations: Stripe (packs, memberships, webhooks), Discord (bot, roles, webhooks), Google Docs and Drive, email with Handlebars templates, and Sharp for images.
- The browser never calls the API directly. Each Next.js app proxies
/apito the backend and stores access and refresh tokens AES-256-GCM-encrypted in httpOnly cookies, refreshing them transparently. - Audited money actions. Payout and payment-detail actions are logged, and revealing a writer’s encrypted payout details is itself an audited admin action.
- Tests at every level: Jest for the API, Vitest and Testing Library for both web apps, and Playwright end-to-end flows across the reader site, the studio and the API.
- Deployment: Docker Compose with MySQL 8 and Redis 7, behind Caddy for automatic TLS and a content security policy.
Key features
- Reader site with discovery,
⌘Ksearch, a library and an 18+ filter - Reader settings that follow you, paginated or infinite reading, read-ahead and auto-scroll
- Footnotes, glossary terms, character references and immersive story blocks
- Leaf economy: packs, memberships, chapter unlocks, novel subscriptions, pre-orders and tips
- Stripe payments and auto-unlock
- Writer Studio: editor, Google Docs/Drive import, scheduling, tiers, campaigns and SEO
- Analytics, subscribers, earnings statements and withdrawals
- Staff tools: economy settings, writer moderation, inbox, promotions and referrals
- Discord integration and events
- Encrypted payout details, and audited admin actions