https://github.com/anchit1909/storycraft-ai
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.
https://github.com/anchit1909/storycraft-ai
amazon-s3 aws aws-lambda aws-polly awscdk dynamodb event-driven-architecture eventbridge nextjs openai serverless sns typescript
Last synced: about 2 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/anchit1909/storycraft-ai
- Owner: Anchit1909
- Created: 2024-01-16T19:58:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-11T11:14:37.000Z (about 1 year ago)
- Last Synced: 2025-01-10T04:28:04.486Z (4 months ago)
- Topics: amazon-s3, aws, aws-lambda, aws-polly, awscdk, dynamodb, event-driven-architecture, eventbridge, nextjs, openai, serverless, sns, typescript
- Language: TypeScript
- Homepage:
- Size: 3.59 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
StorycraftAI - AWS Serverless Stories Generator
Generate unique stories for a personalized bedtime experience.
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

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).5. 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
- Typescript
- [NextJS](https://nextjs.org/)
- [AWS](https://aws.amazon.com/)
- [Tailwind CSS](https://tailwindcss.com/)
- [OpenAI](https://openai.com/blog/openai-api)## Screenshots
### Home Page
### Story Page
## Author
- Anchit Sinha ([@anchit1909](https://twitter.com/anchit1909))