Inspiration
A meaningful digital gift can begin with a small detail: a favorite place, a personal interest, or an imagined adventure. I built StoryLight Commerce to turn those details into a personalized storybook, connecting AI creation, PayPal checkout, and digital delivery in one experience.
What it does
StoryLight turns a name and a few story ideas into a personalized mini-adventure. Users choose a world and mood, explore inspiration cards, and generate a story preview with DeepSeek.
After reviewing the preview, users can approve a $5.00 USD PayPal Sandbox test order. Once the server verifies the completed payment, the full storybook becomes available through a page-turning reader, an illustrated PDF, and a text download.
The demo also includes a sample storybook that visitors can explore without payment. Four reusable AI-generated world illustrations provide the artwork; images are not generated separately for each story.
How I built it
The hosted application uses Cloudflare Workers and D1 for its backend and persistent storage. DeepSeek generates personalized story text, and PayPal Sandbox handles order creation and payment capture.
The server checks the payment status, amount, currency, and association with the correct story before releasing the book. A successful browser redirect alone cannot unlock delivery. API secrets remain on the server.
PDFKit prepares the illustrated PDF. The public MIT-licensed repository also includes a Node.js and SQLite implementation, setup instructions, and a clearly labeled local simulation mode.
Codex assisted development and debugging. OpenAI image generation was used to create the reusable world illustrations.
Challenges I faced
The main challenge was connecting creative generation with reliable payment and delivery. Checkout can be interrupted, browser redirects can fail, and generated text needs validation before it becomes a usable book.
I added saved order state and recovery in the same browser, server-side payment verification, and a reader and PDF layout that present the story consistently. Account setup and repeated human-verification challenges also made real sandbox testing slower than expected.
Accomplishments
I verified a hosted flow using a real DeepSeek response and a $5.00 USD PayPal Sandbox capture, followed by storybook reading and PDF preparation.
The project grew from a text download into an illustrated experience with inspiration cards, world selection, mood choices, dynamic covers, and page turning.
The demo video combines actual story-generation footage with clearly labeled material from earlier sandbox tests. All payments use test funds.
What I learned
An AI commerce experience needs more than generated content and a payment button. Payment state must be verified on the server, interrupted sessions need a recovery path, and digital delivery needs to be useful enough to complete the experience.
Testing the full journey revealed issues that isolated API checks could not show.
What's next
I would like to add cross-device order recovery, clearer storage controls, and more illustration choices. Live payments, refunds, and webhook-based fulfillment remain future work.