Skip to content

StorycraftAI is an an automated Event Driven AI bedtime story generation application using serverless technologies (AWS Lambda, EventBridge Scheduler), OpenAI for generating stories, DALL-E for images, and AWS Polly for text to speech, delivering unique stories, configured by parents, daily for a personalized bedtime experience.

Notifications You must be signed in to change notification settings

Anchit1909/storycraft-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StorycraftAI - AWS Serverless Stories Generator

StorycraftAI - AWS Serverless Stories Generator

Generate unique stories for a personalized bedtime experience.

Anchit Sinha Twitter follower count StorycraftAI repo star count

Introduction · Features · How It Works · Tech Stack · Screenshots · Author


Introduction

StorycraftAI is an an automated Event Driven AI bedtime story generation application using serverless technologies (AWS Lambda, EventBridge Scheduler), OpenAI for generating stories, DALL-E for images, and AWS Polly for text to speech, delivering unique stories, configured by parents, daily for a personalized bedtime experience.

Features

  • EventBridge Scheduler to generate new story every bedtime.
  • Event architecture using Amazon EventBridge to fan out processing of images, audio and emails.
  • New unqiue story every night using ChatGPT, DALL-E for images and Amazon Polly for Audio.
  • Deployment with AWS CDK.

How it works

Architecture diagram

  1. Every day at a configured time an EventBridge Schedule is trigger which triggers a Lambda function.

  2. The create-story lambda function takes characters and scenes from the Amazon DynamoDB tables and uses ChatGPT (OpenAI API) to create the story. The story is stored with a 2 day TTL in DynamoDB.

  3. An Amazon EventBridge Pipe is configured to listen to all New items created inside the table using streams and triggers an Amazon EventBridge event (StoryCreated).

  4. EventBridge routes the StoryCreated event to three targets:

  • SNS for email
    • SNS for email: SNS is used in this example to notify the user that a new story has been created.
  • AWS Lambda function for Audio generation
    • Lambda for Audio: Amazon Polly is created to create audio for the story that has been generated. The audio file is stores into S3 with a signed URL (for 2 days).
  • AWS Lambda function for image generation.
    • Lambda for image generation: This function takes the story and scene and creates an image for the story using DALL-E (OpenAI API). This image is stored inside S3 with a signed URL (2 days).
  1. The frontend application is running on AWS App Runner and is hosting a NextJS SRR application. When the user goes to the URL in the Email (through SNS topic), the story is loaded and displayed.

Tech Stack

Screenshots

Home Page

Home Page

Story Page

Company Details Page

Author

About

StorycraftAI is an an automated Event Driven AI bedtime story generation application using serverless technologies (AWS Lambda, EventBridge Scheduler), OpenAI for generating stories, DALL-E for images, and AWS Polly for text to speech, delivering unique stories, configured by parents, daily for a personalized bedtime experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published