Skip to main content
← Back to Projects

AI Tooling

The Card Genie

My own AI greeting-card business. Upload a photo, describe a scene, and it comes back as a personalised image or video card, sent online or printed and posted. Chained image and video models, a moderation layer, and hard daily spend caps on every paid call.

Next.js 16React 19TypeScriptSupabaseStripefal.aiClaude APIProdigiVitest
The Card Genie homepage with the headline 'Turn any photo into a show-stopping card', Create a card and Create an invitation buttons, and a photo of a woman holding up a printed card next to a phone playing its video
Homepage: a photo goes in, a card and a video come out.
Example design page showing a 3D-render wizard card made from a customer photo, the prompt that produced it, a 'Make this style with your photo' button, and a price table for image and video cards sent online or posted
Each example shows the source photo and the words that made it, then reruns the recipe on yours.
First step of the card creator, asking 'What's the occasion?' with a search box and illustrated tiles for Birthday, Wedding, Engagement, New baby, Christening and more
Creator step one: the occasion sets the style, mood and motion of the card.
Mobile homepage with the headline 'Turn any photo into a magical card' and full-width Create a card and Create an invitation buttons
Mobile homepage.

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.

More Projects