How riyazlive04/kuttystorynew works
KuttyStory sells personalized AI storybooks: a caregiver selects a story, uploads a child’s photo, reviews a free preview, then buys a PDF or printed book. The web storefront calls a FastAPI API; jobs are rendered asynchronously and stored for polling and fulfillment. The map includes catalog, payment, admin, and print-production capabilities alongside that main flow. Relationships are grounded in the README and SOURCE INDEX references; several internal calls and unsampled subsystems are not directly shown, so those links are omitted.
Main entry points: tasks.py Render Tasks · api.ts API Client · db.py PostgreSQL · jobs.py Job API
Components 20
Storefront
- Storefront
apps/web/src/app/(storefront)/page.tsx - Personalization
apps/web/src/components/PersonalizeWizard.tsx - Preview and Cart
apps/web/src/app/(storefront)/preview/[jobId]/page.tsx - Checkout
apps/web/src/app/(storefront)/checkout/page.tsx - API Client
apps/web/src/lib/api.ts
API and Commerce
- Story Catalog
apps/api/app/routers/stories.py - Job API
apps/api/app/routers/jobs.py - Orders
apps/api/app/routers/orders.py - Payments
apps/api/app/routers/payments.py - PostgreSQL
apps/api/app/db.py - Razorpay
Personalization and Rendering
- Celery and Redis
apps/api/app/worker.py - Render Tasks
apps/api/app/tasks.py - Face Personalization
apps/api/app/generation_engine.py - ComfyUI GPU
apps/api/app/comfyui.py - Text Composition
apps/api/app/text_layer.py
Fulfillment
- PDF Production
apps/api/app/pdf_service.py
Administration
- Admin CMS
apps/api/app/routers/admin.py - Runtime Settings
apps/api/app/app_settings.py
Other components
- Caregiver
Connections 24
- Caregiver → Storefront: browses stories
- Storefront → Story Catalog: loads catalog
- Storefront → Personalization: starts personalization
- Personalization → API Client: submits photo
- API Client → Job API: creates render job
- Job API → PostgreSQL: stores job
apps/api/app/routers/jobs.py - Job API → Celery and Redis: enqueues render
- Celery and Redis → Render Tasks: runs tasks
apps/api/app/worker.py - Render Tasks → PostgreSQL: updates progress
apps/api/app/tasks.py - Render Tasks → Face Personalization: renders pages
apps/api/app/tasks.py - Face Personalization → ComfyUI GPU: requests generation
apps/api/app/comfyui.py - Render Tasks → Text Composition: composes text
apps/api/app/tasks.py - Preview and Cart → API Client: polls job
- Preview and Cart → Checkout: continues purchase
- Checkout → API Client: places order
- API Client → Orders: creates order
- Orders → PostgreSQL: stores order
apps/api/app/routers/orders.py - Checkout → Payments: starts payment
- Payments → Razorpay: creates and verifies
- Payments → PostgreSQL: marks paid
apps/api/app/routers/payments.py - Render Tasks → PDF Production: stitches book PDF
apps/api/app/tasks.py - Job API → PDF Production: builds downloads
apps/api/app/routers/jobs.py - Admin CMS → PostgreSQL: manages catalog
apps/api/app/routers/admin.py - Admin CMS → Runtime Settings: updates settings
apps/api/app/routers/admin.py