AWS Builder Center
Weekend Creative Challenge: MoodVerse — Turn a Mood into a Poem with Amazon Bedrock

Weekend Creative Challenge: MoodVerse — Turn a Mood into a Poem with Amazon Bedrock

Meet MoodVerse, a serverless AI-powered web app that turns your mood and a spark word into a unique 6–10 line poem. Built with Amazon Bedrock Nova Lite, AWS Lambda, API Gateway, and AWS Amplify, the app demonstrates how generative AI and serverless AWS services can come together to create a simple, playful, and creative experience. This project was built as part of the Weekend Creative Challenge to explore creative expression with AWS.

Vision & What the App Does

What if you could turn a simple feeling into a tiny piece of creative writing?
That was the idea behind MoodVerse, a lightweight AI-powered web application built for the Weekend Creative Challenge. The goal was simple: take a user's mood and an optional spark word, then transform those inputs into a short, playful poem.
MoodVerse supports moods such as cheerful, cozy, mysterious, adventurous, dreamy, and silly. Users can also provide an optional "spark word" to give the poem an additional creative direction.
The creative output is a freshly generated 6–10 line poem, created on demand using Amazon Bedrock's Nova Lite model. The intention isn't to produce technically serious poetry. Instead, MoodVerse is designed to be quick, fun, and expressive — something that can turn a few seconds of interaction into a small moment of creativity.
Even if the user doesn't provide a spark word, the application keeps things interesting by selecting a random whimsical word such as lighthouse, marshmallow, or comet. This means every request can result in something slightly different.
The overall experience is intentionally simple: choose a mood → optionally add a spark → generate a poem → enjoy the result.

How I Built It

For this challenge, I decided to use a serverless architecture based on Amazon API Gateway, AWS Lambda, and Amazon Bedrock. I had already worked with these services during an earlier AWS workshop, so I could spend more time experimenting with the application experience and AI integration rather than learning the fundamentals of each service from scratch.
One of my first decisions was choosing Amazon Bedrock Nova Lite as the foundation model. Since the application generates relatively short pieces of text, I didn't need a large model with extensive reasoning capabilities. Nova Lite provided a good balance between response speed, capability, and cost-conscious development.
For the API layer, I chose an API Gateway HTTP API rather than a REST API. The HTTP API provided the functionality I needed with a simpler configuration and lower overhead.
For the frontend, I used AWS Amplify. Instead of manually configuring S3 static website hosting, Amplify allowed me to connect the frontend repository and automatically build and deploy the application. This made it much easier to iterate quickly during the challenge.

The Biggest Challenge: CORS

Interestingly, the hardest part of the project wasn't getting the AI model to generate poems. It was getting the browser to communicate correctly with the backend.
The frontend was hosted on an Amplify domain while the API Gateway endpoint was hosted on a different domain. Initially, requests from the browser failed with a generic "Failed to fetch" error, which later exposed itself as a CORS policy issue.
I debugged the problem layer by layer.
First, I verified that the Lambda route matched exactly what the frontend was calling. A route mismatch was initially masking itself as a CORS-related problem.
Next, I configured API Gateway's CORS settings and explicitly allowed the  Content-Type  header. The default configuration wasn't allowing the required header.
I also learned an important lesson about deployment: changing the CORS configuration isn't enough — the API must be redeployed to the appropriate stage before the changes become active.
Finally, I removed a manually created  OPTIONS  route that was conflicting with API Gateway's built-in HTTP API CORS handling. Once API Gateway was allowed to manage the preflight requests itself, the communication worked as expected.
My debugging workflow was also important. Instead of immediately changing frontend code, I first tested the API independently using a POST request. I then used CloudWatch Logs to determine whether requests were actually reaching Lambda. This helped me isolate whether the problem was in the frontend, API route, CORS configuration, or deployment state.

AWS Services Used & Architecture Overview

MoodVerse uses four AWS services:
  • AWS Amplify — Hosts the frontend and provides Git-based build and deployment automation.
  • Amazon API Gateway — Provides the public HTTP API endpoint and handles CORS.
  • AWS Lambda — Runs the Python backend without requiring server management. It receives the mood and spark word, constructs the prompt, calls Amazon Bedrock, and returns the generated poem.
  • Amazon Bedrock — Provides access to the Nova Lite foundation model that generates the poem.
The request flow is straightforward:
Amplify Frontend → API Gateway → Lambda → Amazon Bedrock Nova Lite
The generated poem then travels back through the same chain to the browser.
This architecture keeps the application lightweight and fully serverless. There are no servers to provision or manage, and the backend only runs when a user requests a poem.

What I Learned

This challenge helped me learn several things that go beyond simply connecting an AI model to a web application.
The first was Amazon Bedrock's Converse API. This was new to me, and I liked the idea of having a unified interface for interacting with different foundation models. It also makes experimentation easier because changing between compatible models doesn't require completely redesigning the application's request and response logic.
I also gained a much better understanding of CORS and API Gateway's built-in CORS support. Previously, I thought of CORS mostly as a frontend configuration issue. This project showed me how API configuration, browser preflight requests, HTTP methods, headers, routes, and deployment stages all interact.
Another major lesson was debugging systematically. When several cloud services are connected together, it is easy to make random changes and hope something works. Instead, I learned to verify each layer independently:
Frontend → API endpoint → Lambda → Bedrock → response
CloudWatch Logs were especially useful for confirming whether a request actually reached Lambda.
Finally, I gained more experience with AWS Amplify's Git-based deployment workflow. For a small application developed over a weekend, automated frontend deployments made iteration considerably faster.

Final Thoughts

MoodVerse started with a simple creative idea: turn a feeling into a poem. Building it gave me an opportunity to combine generative AI with a practical serverless architecture while keeping the user experience intentionally simple.
The project also reinforced something I enjoy about cloud development: even a small application can involve several interesting engineering challenges when you connect frontend, APIs, serverless compute, and generative AI together.
If you'd like to try MoodVerse, you can access the live application here:
#creative-expression #AWS #AmazonBedrock #Serverless #AWSLambda #APIGateway #AWSAmplify #GenerativeAI #CloudComputing
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article