
Weekend Creative Challenge: Roast Generator
Roast Generator is a serverless AI web app that writes short, funny, PG-13 roasts on demand. You give it a target, pick a comedic style, dial in the heat level, and get back a two or three sentence roast. It runs on AWS Lambda behind a Function URL, with a static frontend hosted on Amazon S3.
Vision and what the app does
Roast Generator is a tiny, joyful, serverless web app that writes short AI roasts on demand. You type in a target ("my code", "my roommate", "Mondays", "myself"), pick a comedic style, choose a heat level, and the app fires back a two or three sentence roast that is meant to make you laugh, not hurt anyone's feelings. The whole thing is lighthearted, PG-13, and clearly a joke.
The creative twist is the combo of two dials. Style can be Gen-Z chaos (lowercase, chaotic energy, occasional emoji), Shakespearean (thee and thou and dramatic flourish), or Corporate HR (overly formal performance-review energy). Heat can be Mild (gentle teasing), Spicy (sharp and witty), or Savage (maximum comedic damage, still PG-13). Same target, nine very different vibes. Roasting "my code" in Shakespearean Savage reads completely differently from roasting it in Gen-Z Mild, and that mix-and-match is where the fun lives. It is a small idea, but it turns out to be genuinely entertaining to share with friends and teammates.
How I built it
I kept the scope intentionally small so I could actually finish in a weekend. No framework, no build step, no database. Just a static HTML page for the UI and one Python Lambda function for the brains.
The development flow was straightforward. I started by sketching the interaction: an input field, two dropdowns, one big button, and one result card. That became the entire UI in a single index.html file with vanilla HTML, CSS, and JavaScript, styled with a dark ember-red gradient so it feels like a roast without being over-designed. Next, I wrote the Lambda handler in Python 3.12. It parses the JSON body, looks up the selected style and intensity in two prompt dictionaries, composes a single-shot prompt, and calls a chat-completions endpoint using only urllib from the Python standard library. No third-party dependencies, no zip package, no layers. I can paste the file straight into the Lambda code editor. Instead of putting API Gateway in front of Lambda, I enabled a Lambda Function URL, which gives me an HTTPS endpoint and built-in CORS with a single toggle. Finally, I deployed the frontend as a static website on Amazon S3.
The biggest lesson along the way was that prompt design is the whole product. The first version returned rambling paragraphs with preambles like "Sure, here is a roast:". I fixed it by tightening the prompt to explicitly ask for two to three sentences, no preamble, no quotation marks, and by embedding the style and intensity descriptions inline. Output quality jumped immediately. I also hit the classic CORS preflight wall on the first request, which I solved by enabling CORS on the Function URL with Allow methods POST and Allow headers Content-Type. Secrets are kept clean by storing the API key only in Lambda environment variables, with an env.example file documenting the variable and .gitignore excluding any real .env.
AWS services used and architecture overview
The stack uses AWS Lambda on the Python 3.12 runtime as the stateless brain of the app, invoked through a Lambda Function URL that provides a public HTTPS endpoint with built-in CORS and no API Gateway required. The static frontend is hosted on Amazon S3 using static website hosting, with a bucket policy that allows public read access to the index.html file. IAM provides the default Lambda execution role, and Amazon CloudWatch Logs captures every invocation and every error, which was invaluable while I was tuning the prompt.
The end-to-end flow is simple. The browser loads the static page from S3. When the user clicks the button, the page sends a POST request with the target, style, and heat to the Lambda Function URL. Lambda builds a prompt from those inputs, calls the model provider, and returns the roast as JSON. The page then renders it in the result card. The whole system is stateless. There is no database because there is nothing worth persisting for a joke generator, and skipping DynamoDB kept the Free Tier footprint tiny.
What I learned
This challenge pushed me into corners of AWS I had read about but never actually used end to end. Lambda Function URLs are underrated. For a small public endpoint, they remove an entire service from the diagram without giving anything up for a demo like this. S3 static website hosting is still an incredibly fast way to ship a frontend when you do not need a build pipeline. Prompt engineering is the actual product surface: two dictionaries and one carefully worded instruction do more for the user experience than any amount of frontend polish. Using only the Python standard library (urllib instead of requests) makes Lambda deployment radically simpler, with no zip, no layer, and no dependency drift. And keeping the blast radius small (no database, no auth, no framework) let me actually ship in a weekend instead of getting stuck configuring things.
If I keep going, the natural next steps are swapping the model call over to Amazon Bedrock with a Nova model via the Converse API so the stack becomes fully AWS-native, adding a "share this roast" image export using Lambda and S3, and putting basic rate limiting in front of the Function URL. For now, though, it does exactly one creative thing and it does it well, which was the whole point.
Links
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article