AWS Builder Center
Weekend Creative Challenge: Plot Twist

Weekend Creative Challenge: Plot Twist

Plot Twist is a small creative storytelling app that turns a simple idea into a short story and lets you transform it with increasingly unexpected twists. Built with HTML, CSS, JavaScript, AWS Lambda, Lambda Function URLs, and AWS Amplify.

i love competitive programming and system design
I built Plot Twist, a small interactive storytelling app designed around one simple idea: start with a strange thought and see how far you can take it.
The user enters a story idea such as "a bottle becomes alive", chooses a genre, selects a story length, and adjusts a chaos level. Plot Twist then generates a short creative story based on those choices.
The interesting part is what happens after the first story. Instead of treating the generated story as the final result, Plot Twist lets the user mutate it. Buttons such as Make It Darker, Make It Funnier, Add a Plot Twist, Make It Absurd, Turn It Into Sci-Fi, and Change the Ending let the user take the same idea in completely different directions.
I wanted the app to feel less like filling out a form and more like playing with an idea. A normal story generator gives you an output and stops. Plot Twist gives you an output and asks, "What happens if we make this worse?"
The result is a small creative playground where a single sentence can become several completely different stories.

How I Built It

This challenge was particularly interesting for me because I started with very little application-development experience. My previous experience was mainly with HTML and CSS, so I deliberately kept the frontend simple rather than introducing a large framework.
The frontend uses HTML, CSS, and vanilla JavaScript. The interface contains the story input, genre selector, length selector, chaos slider, generation controls, and story mutation controls.
I separated the application into a frontend and backend instead of putting everything in the browser. The browser sends a JSON request to the backend containing the story idea and the user's creative choices.
One of the first useful lessons was that the exact shape of the request matters. My Lambda function expects the field  storyIdea , rather than simply  idea . When I initially tested the public endpoint with the wrong field name, Lambda correctly returned:
 Please provide a story idea. 
That was a simple bug, but it taught me an important backend concept: the frontend and backend need an explicit request contract.
Another challenge was getting the browser to communicate with Lambda. My PowerShell tests could successfully call the Lambda Function URL, but the browser initially showed "Failed to fetch." The backend itself was working; the problem was the browser's cross-origin security model. I configured CORS on the Lambda Function URL and made sure the frontend request matched the allowed method and headers.
I also learned the difference between testing a Lambda directly in the AWS console and testing it through its public HTTP endpoint. The latter requires handling the HTTP request body correctly, including parsing JSON sent through the Function URL.
Once the Lambda endpoint worked independently, I connected the frontend using  fetch()  and tested the complete flow from the browser to AWS and back.

AWS Services & Architecture

The application intentionally uses a small serverless architecture.

AWS services used

  • AWS Amplify — hosts the public Plot Twist frontend.
  • AWS Lambda — runs the server-side story-generation and transformation logic.
  • Lambda Function URL — provides the HTTPS endpoint that the frontend calls.

Architecture

USER | v AWS Amplify Hosting HTML / CSS / JS | | HTTPS POST v Lambda Function URL | v AWS Lambda | v Plot Twist Story Engine | v JSON Story Response | v Browser UI updates
The frontend is deliberately static. It does not contain AWS credentials or server-side secrets.
When the user clicks Generate Story, JavaScript sends the selected story idea, genre, length, chaos level, and transformation to the Lambda Function URL. Lambda processes the request and returns a JSON response containing the story.
The mutation buttons use the same architecture, but send the current story together with a transformation instruction. This keeps the application simple and stateless while still allowing the user to repeatedly change the creative output.
The public application is deployed with AWS Amplify, while the backend runs through AWS Lambda. This gave me a practical introduction to deploying both sides of a web application using AWS without needing to manage a traditional server.

What I Learned

The biggest thing I learned during this challenge was that building an application is not just about writing code. The pieces have to communicate correctly.
I learned how a browser sends HTTP requests using  fetch() , how JSON request bodies are structured, how a Lambda function receives an HTTP event, and how the response travels back to the browser.
I also got my first practical experience with AWS Lambda and Lambda Function URLs. Before this challenge, AWS services felt like something I would need to understand completely before using. Building Plot Twist showed me that I could start with one small service, understand its input and output, and gradually connect more pieces.
CORS was another important lesson. I had encountered the term before, but debugging an actual browser request made the concept much clearer. I learned that a backend can work perfectly when called from PowerShell while still failing when called from a browser because browsers enforce additional cross-origin rules.
The challenge also changed how I approach debugging. Instead of changing several things at once, I tested the system layer by layer:
Lambda logic ↓Lambda Function URL ↓PowerShell HTTP request ↓Browser fetch() ↓Amplify deployment
That made it much easier to identify whether a problem was in my application code, the HTTP request, AWS configuration, or the browser.
Most importantly, Plot Twist gave me my first experience taking a project from a local HTML/CSS/JavaScript prototype to a publicly deployed application.

Try Plot Twist

If you try it, start with something simple like:
A student discovers that his laptop is secretly alive.
Then generate the story and start mutating it.
#creative-expression
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