
Weekend Creative Challenge: Inkling
Inkling is an AI-powered, cozy digital literary workspace. It uses Amazon Bedrock and AWS Lambda to act as your imaginative co-author, generating original stories and poems based on your chosen mood and theme. Deployed Project AWS Amplify Link : https://main.d2skrf9bjoodwf.amplifyapp.com/ https://main.d2skrf9bjoodwf.amplifyapp.com/
Vision & What the App Does
Inkling is an AI-powered, cozy digital literary workspace. The vision behind Inkling was to move away from the generic, highly-sterilized "chat UI" that dominates modern AI applications, and instead create an environment that feels like sitting down at a classic writer’s desk.
The application is a customized story and poem generator that acts as an imaginative co-author. Users can enter a name or dedicatee, a theme or topic (like "a rainy afternoon in a bookshop"), and select from a curated list of seven distinct emotional moods (such as Whimsical, Adventurous, Cozy, Mysterious, Funny, Romantic, or Bittersweet). They can also fine-tune the format, length, tone, style, and perspective.
Upon clicking "Create," Inkling leverages the Amazon Nova 2 Lite model to generate a completely original, beautifully formatted piece of writing. The output is streamed into a clean, LeetCode-style dual-pane reading workspace using classic serif typography (Cormorant Garamond), ensuring the final creative output takes center stage in a distraction-free environment. It even includes text-to-speech functionality to read the poem or story aloud!
How You Built It
Building Inkling was a fascinating exercise in balancing a premium frontend experience with a completely serverless backend.
The Frontend: I decided early on to eschew heavy frameworks like React or Next.js. I wanted the app to be lightning-fast, highly portable, and deeply rooted in fundamental web technologies. I built the frontend entirely in Vanilla HTML, CSS, and JavaScript. A key decision was structuring the UI into a 100vh CSS Grid workspace with independent scrollable panes, ensuring the "creation controls" on the left always remain accessible while reading long-form stories on the right. Implementing the custom "typewriter" reveal animation in Vanilla JS without dropping frames required careful timing logic based on text length and punctuation delays.
The Backend: For the backend, I needed a way to securely format prompts and communicate with Amazon Bedrock without exposing AWS credentials in the browser. I chose Python for the backend logic because
boto3 makes interfacing with Bedrock incredibly straightforward. The main challenge was configuring the CORS headers correctly in a serverless environment so that the browser wouldn't block the preflight OPTIONS request. I solved this by explicitly returning wildcard headers in the Lambda response and configuring the Function URL settings to match.AWS Services Used / Architecture Overview
Inkling relies entirely on the AWS Free Tier for its architecture, embracing a 100% serverless model:
- Amazon Bedrock (Nova 2 Lite): This is the core creative engine. I used the
amazon.nova-2-lite-v1:0foundation model via the Converse API. Nova 2 Lite proved to be incredibly fast and highly capable of following nuanced stylistic instructions (like adhering to a "whimsical" mood vs a "bittersweet" one).
- AWS Lambda: The bridge between the user's browser and Bedrock. I deployed a Python 3.12 Lambda function that sanitizes the incoming POST payload, constructs the system prompt instructing the model on how to write, and handles the
boto3invocation.
- Lambda Function URLs: Instead of standing up a full API Gateway, I utilized a Lambda Function URL for direct, secure HTTPS invocation from the frontend.
- AWS IAM: A custom inline policy (
bedrock:InvokeModel) was attached to the Lambda execution role, ensuring the principle of least privilege.
- AWS Amplify Hosting (or S3): Used to globally deploy and host the static HTML, CSS, and JS assets directly from the GitHub repository.
What You Learned
This challenge was an incredible opportunity to dive deeper into the Amazon Bedrock ecosystem. I learned:
- The Converse API: I discovered that the
bedrock-runtimeConverse API is much cleaner for managing system prompts and user messages than older, model-specific payload formats.
- Prompt Engineering for Mood: I learned how sensitive foundation models are to subtle prompt adjustments. Simply appending "Write in a deeply melancholic, bittersweet tone" drastically altered the vocabulary and pacing of the output compared to a "funny" tone.
- Serverless Simplicity: I realized how powerful Lambda Function URLs are for simple web apps. By bypassing API Gateway, I drastically reduced deployment complexity and overhead for a weekend project.
Challenges Overcame
- The Javascript Race Condition: I built a custom typewriter animation for the text reveal. However, if a user generated a short poem while a long story was still typing, the characters would interleave into gibberish! I solved this by tracking the active
setTimeoutID and instantly clearing it whenever a new generation begins.
- Serverless Timeouts & Token Limits: Generating a 6-paragraph story requires nearly 3000 tokens. I had to increase the Bedrock
maxTokenslimit to its absolute maximum (5120) and bump the AWS Lambda timeout past the default 3 seconds to ensure stories never got cut off mid-sentence.
Link to App or Repo
Live App (AWS Amplify): https://main.d2skrf9bjoodwf.amplifyapp.com/ Source Code (GitHub): https://github.com/Pixel-Stock/Inkling
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article