Overview
The Card Genie is a business I run myself, through my own limited company. You upload a photo of a person or a pet, pick an occasion and describe a scene, and the site turns it into a card: a still image, or a 5, 10 or 15 second video. The recipient gets a link, or a printed A5 card with a QR code inside that plays the video. The same codebase also handles event invitations with RSVPs and wedding stationery, in 28 locales with regional pricing.
The problem
Generative image and video models are good enough to make a card someone would actually want, but each call costs real money, the models fail or refuse in ways you can't predict, and anything with a free preview is open to abuse. The hard part wasn't calling a model. It was making that pipeline cheap enough, safe enough and reliable enough to put in front of paying customers.
The approach
Image generation runs through a fallback chain on fal.ai (Nano Banana Pro edit, then Nano Banana 2, then Seedream), and video goes to a primary image-to-video model with a second as fallback. A content refusal from the provider is detected and not retried. Text goes through two moderation stages before any image call: a fixed denylist, then a Claude Haiku classifier whose verdict is forced through tool use, so a malformed reply blocks the request instead of letting it through. Every paid call reserves budget first against a site-wide daily cap, with a separate per-IP cap on free previews and Upstash rate limiting in front, and cost is logged per model. Claude Sonnet handles the creative side: suggesting scene descriptions, rewriting prompts and, behind a feature flag, planning multi-clip video storyboards. For print, the artwork is outpainted into the bleed area and rendered to a 300 DPI PDF, Stripe webhooks drive fulfilment, and Prodigi prints and posts the card.
Results
Live at thecardgenie.com and taking orders, with Stripe checkout, a Pro subscription, and Prodigi print fulfilment. There are 264 Vitest test files, run in CI alongside type-checking and lint. I also ran a full security review of the codebase and worked through its findings in dedicated fix commits, covering database access rules, request handling and the moderation classifier.
What I'd do next
Build an evaluation set for the image pipeline, so changes to prompts or the model chain are judged on a fixed batch of inputs rather than by eye, and add a CSP nonce so inline scripts can be locked down.



