FanficWizard: a production AI writing tool — free tier, paid credits, content safety — live in three days
An AI fanfic generator with streaming output, a free tier that's hard to farm, credit-paid chapters that continue a story, two-layer content safety and three payment providers. Built on my own reusable template with Claude Code, from first commit to live site in three days.
- Role
- Solo — product, SEO, design, full-stack and AI engineering, payments, operations
- Stack
- Next.js 16React 19TypeScriptTailwind CSS 4PostgreSQL (Neon)Prisma 7Better AuthZodVitestCloudflare TurnstileWaffo · PayPal · StripeVercelClaude Code
Overview
- Challenge: ship a real paid AI product, not a demo: free usage that can't be farmed, model spend that can't run away, content rules strict enough for payment providers, and a way to get paid as a solo developer.
- Solution: FanficWizard, an AI fanfic generator. Free short scenes need no sign-up. Credits buy full chapters that continue a story. It runs on Novalith, my reusable template for AI tool sites.
- Results: started October 23, 2026 and live at fanficwizard.com on October 25; 327 automated tests passing; three payment providers verified end to end in test mode. Too new for traffic or revenue numbers.
FanficWizard home page: the tool is the page
The challenge
Fanfic writers get stuck on a scene; readers want the one prompt nobody has written for their favourite pairing. The free tools they find write short, lose the characters' voices, and forget the setup after a couple of continuations.
Making that a product brings the questions every AI feature in production faces:
- Free usage has to be generous enough to try, but a script mustn't be able to burn the model budget.
- Model spend needs a hard daily ceiling, based on real token usage rather than an estimate.
- Content rules have to hold on both the request and the generated text, because payment providers won't accept a tool that writes explicit content. FanficWizard stays at a Teen rating and never writes romantic or sexual content involving minors.
- Getting paid as a solo developer means no single payment platform can be relied on.
- Being found by search engines and AI assistants, with near-zero fixed cost until it earns money.
What I built
The home page is the tool. Fandom, characters or pairing, an optional premise, up to three tropes, tone, point of view and length. The story streams in as it is written and ends with an AO3-style title, rating, summary and tags.
| Free | With credits | |
|---|---|---|
| Account | None | Google sign-in |
| Allowance | 3 scenes a day | 1 credit per chapter |
| Length | Short scene, ~500 words | Full chapter, ~1,500 words |
| Model tier | Cheaper model | Stronger writing model |
| Continue the story | — | Chapter by chapter from the story library |
Stories that stay consistent. Paid chapters are saved to a story library. "Continue this story" sends the model the author's character notes, a running summary of the story so far and the end of the previous chapter, plus an optional direction for what happens next.
Example fanfics on the home page, written with original characters only
More tool pages from configuration. Besides the home page there is a reader-insert generator, a fandom directory and fandom landing pages. Each has its own form, prompt, model tier, credit cost and FAQ, and the same engine runs them all.
An admin for running it. Today's spend against the cap, every generation with a plain-English reason when it failed or was blocked, safety blocks, revenue by traffic source, AI provider health and the credit ledger. Payment methods and AI providers can be switched on and off without a deploy.
Technical highlights
| Production concern | How FanficWizard handles it |
|---|---|
| Adding a tool | One engine, one config per page: fields, prompt template, model tier, credit cost and FAQ. A new tool page is a config entry, validated with Zod at build time |
| Waiting for output | Results stream as they are written; a visitor can stop; a result cut off by the output limit is detected and labelled |
| Free-tier abuse | 3 free generations a day per salted IP hash and per account, behind Cloudflare Turnstile; the IP is read only from the trusted proxy, so it can't be spoofed; failed requests don't count |
| Unsafe content | Two layers (OpenAI Moderation and a classifier on the cheap model) check the request before writing and the result about every 400 words while it streams. A hit, an error or a timeout all block. Blocked text isn't saved and credits are refunded. Logs record only the stage, layer and category, never the text |
| A model provider going down | Ordered OpenAI-compatible providers: if one fails before the first token, the next takes over; three failures in a row open a circuit breaker for five minutes, shared across server instances; on/off and order are set in the admin |
| Runaway cost | Spend is reserved at the highest candidate price before the call, then recorded from the provider's actual token usage; a site-wide daily cap and a separate cap for free usage |
| Payments | Waffo, PayPal and Stripe. Credits are granted only from signature-verified webhooks, and only once per checkout; refunds and chargebacks take credits back; test keys can't grant credits on the live site; each provider has an admin switch; the first traffic source is stored with the order |
| Search and AI answers | Server-rendered pages with SoftwareApplication and FAQPage structured data generated from config; FAQs written as the questions people ask AI assistants ("Is there a free AI fanfic generator with no sign-up?"); robots.txt lets AI search crawlers in; a build check enforces all of it |
| Leaking secrets or prompts | Content-Security-Policy and security headers; the build fails if a secret appears in public files; a stream that starts repeating the system prompt is stopped |
Built on my own template. Novalith holds everything above. Sign-in, credits, payments, admin and the story library are modules that can be removed, and a script proves it by deleting each one and rebuilding. Engine changes go into the template. The FanficWizard repository holds the configuration, copy, brand assets and a few small layout tweaks, so the next site starts from the same base.
Shipped in three days, then fixed what only production showed
FanficWizard went from first commit to a live site in three days (October 23–25, 2026). The way of working was the same as on client projects: a short product spec, one written instruction per feature, Claude Code doing the implementation, and one gate, npm run verify (lint, type check, tests, license policy, build with a secret scan, SEO check), that has to pass before anything ships.
| Date | What happened |
|---|---|
| Oct 23 | Template imported, site configuration and copy written; template fixes and security hardening |
| Oct 24 | End-to-end run against real models: free streaming, the daily limit, an explicit request refused, Google sign-in, a paid chapter saved to the library |
| Oct 25 | Live on fanficwizard.com; Waffo and PayPal payments, admin switches, traffic attribution and provider failover added to the template; Stripe the same day |
| Oct 27–28 | New admin, reader-insert and fandom pages, Google One Tap; all three payment providers verified in test mode |
Four problems only appeared against real services:
- A model provider wasn't available for my account. The fix was not to depend on one: the site talks to any OpenAI-compatible provider, and the template gained ordered providers with automatic failover, a circuit breaker and admin switches.
- The moderation call was hard-coded to the official endpoint. It became a configurable base URL, checked with a small script before it was switched on.
- Paid chapters were cut off by a 2,400-token output limit. I raised the limit to 3,200, told the model to wrap up in time, and added detection: the provider's "stopped at length" signal is recorded, and the reader sees that the text may end mid-sentence.
- The template's tests assumed the demo site's content, so a new site failed them. The tests now use their own fixtures and pass on any site.
Quality & testing
| Check | Result |
|---|---|
| Automated tests | 327 passing (Vitest) — content policy, streaming, provider failover and circuit breaker, free quota, credit ledger, payment webhooks for each provider, security headers, SEO |
| Release gate | npm run verify: lint, type check, tests, license policy, production build, secret scan, SEO check |
| Removable modules | A script deletes each optional module and rebuilds the site |
| Real models | Free streaming, daily limit, explicit request refused, sign-in, paid chapter saved to the library |
| Payments | Waffo, PayPal and Stripe in test / sandbox mode: checkout → webhook → credits granted → refund takes them back |
Results & limits
| Area | Where it stands |
|---|---|
| Status | Live since October 25, 2026; payments are open in production |
| Traffic and revenue | Too early: no traffic, user or revenue figures yet, and no real orders so far. I'll add numbers when there are some |
| Model failover | Built and tested in the template; the live site currently runs on a single provider, with a backup ready to add as a config entry |
| Prices | Credit packs are priced from estimated model costs and will be reset against measured costs |
| Export | Copy text with the AO3-style block; EPUB is not built |
How I delivered it
| Step | What was produced |
|---|---|
| Requirements | Product spec: users, free vs paid, pricing assumptions, content rules, launch checklist |
| SEO / GEO | Keyword choice, page titles, FAQs written as real questions, structured data |
| UI | Tool-first home page, streaming result panel, pricing, library, admin |
| Architecture | Config-driven tool engine on Novalith; removable modules; PostgreSQL |
| Build | One written instruction per feature, implemented with Claude Code |
| Testing | Unit tests, the verify gate, real-model runs, payment tests in sandbox mode |
| Launch | Vercel, custom domain, Google Search Console, GA4 and Microsoft Clarity |