DEV Community

Cover image for Building VerseCraft AI: Turning Ideas and Emotions Into Original Poems | 10 Days of Building AI Agents on AWS | Day 4
abdullah haroon
abdullah haroon

Posted on

Building VerseCraft AI: Turning Ideas and Emotions Into Original Poems | 10 Days of Building AI Agents on AWS | Day 4

Building VerseCraft AI: Turning Ideas and Emotions Into Original Poems

10 Days of Building AI Agents on AWS | Day 4

Tag: #creative-expression

VerseCraft AI transforms simple ideas, emotions, memories, and thoughts into original poems using generative AI.

The project combines Groq with a serverless AWS architecture to explore how a focused creative experience can bring together AI, web development, and cloud services.

Vision and What the App Does

What if you could turn a simple thought, feeling, memory, or idea into a poem in seconds?

That was the idea behind VerseCraft AI, a simple AI-powered creative writing application.

Instead of asking users to write a complete poem themselves, VerseCraft lets them provide a simple idea and choose a mood. The application then transforms that input into an original poem.

For example, a user can enter:

"A lonely person watching the rain from a rooftop at midnight."

They can then select a mood such as:

  • Emotional
  • Romantic
  • Sad
  • Inspirational
  • Dark
  • Peaceful
  • Funny

After clicking Generate Poem, VerseCraft creates a title and an original poem inspired by the user's idea and selected mood.

The goal was not to build a complicated AI platform.

I wanted to create one focused creative experience that is simple to understand, enjoyable to use, and produces something people can share.

The generated poem is displayed in a clean, artistic interface with options to copy the poem and generate another one.

The application is designed to make creative writing feel accessible, even when someone does not know where to start.

How I Built It

I decided early that I wanted to keep the application focused and avoid unnecessary complexity.

There are no:

  • User accounts
  • Databases
  • Payment systems
  • Complicated dashboards

The entire application revolves around one simple interaction:

Idea → Mood → AI → Poem

The frontend was built using HTML, CSS, and JavaScript.

I wanted the interface to feel more like a small digital writing studio than a traditional AI dashboard, so I focused on a minimal design with a black, white, and yellow or gold visual theme.

AI Generation with Groq

For AI generation, I used the Groq API.

The backend receives the user's idea and selected mood and sends them to the AI with a carefully designed prompt.

The prompt instructs the model to generate:

  • A suitable title
  • An original poem
  • A structured response that the frontend can display cleanly

The generation flow is:

User Idea → Selected Mood → Backend → Groq AI → Generated Poem

One important decision was to keep the Groq API key completely away from the frontend.

The browser communicates with the backend API instead of communicating directly with Groq.

This prevents the API key from being exposed in client-side JavaScript.

Serverless Backend

The backend uses Node.js running on AWS Lambda.

When a user requests a poem:

  1. The user enters an idea and selects a mood.
  2. The frontend sends the request to API Gateway.
  3. API Gateway invokes AWS Lambda.
  4. Lambda processes the input.
  5. Lambda securely calls the Groq API.
  6. Groq generates the poem.
  7. Lambda returns the structured result.
  8. The frontend displays the poem.
User
  │
  ▼
Frontend
  │
  ▼
API Gateway
  │
  ▼
AWS Lambda
  │
  ▼
Groq API
  │
  ▼
Poem JSON
  │
  ▼
Frontend displays poem
Enter fullscreen mode Exit fullscreen mode

AWS Services Used and Architecture

VerseCraft AI uses several AWS services:

  • Amazon S3 for storing and hosting the static frontend files, including HTML, CSS, and JavaScript.
  • Amazon CloudFront for delivering the frontend globally through a CDN and providing HTTPS.
  • Amazon API Gateway for providing the public API endpoint used by the frontend.
  • AWS Lambda for running the serverless Node.js backend that communicates with Groq.
  • AWS IAM for providing permissions and execution roles required by AWS services.
  • AWS CloudFormation for defining and provisioning infrastructure using YAML.

The overall architecture is:

                         USER
                           │
                           ▼
                    ┌──────────────┐
                    │  CloudFront  │
                    │ HTTPS / CDN  │
                    └──────┬───────┘
                           │
                           ▼
                    ┌──────────────┐
                    │      S3      │
                    │ HTML/CSS/JS  │
                    └──────────────┘

       User clicks "Generate Poem"
                           │
                           ▼
                    ┌──────────────┐
                    │ API Gateway  │
                    │POST /generate│
                    └──────┬───────┘
                           │
                           ▼
                    ┌──────────────┐
                    │    Lambda    │
                    │   Node.js    │
                    └──────┬───────┘
                           │
                           ▼
                    ┌──────────────┐
                    │   Groq API   │
                    │ Generative AI│
                    └──────┬───────┘
                           │
                           ▼
                       POEM JSON
Enter fullscreen mode Exit fullscreen mode

CloudFormation ties the AWS infrastructure together and makes deployment reproducible.

Instead of manually creating every AWS resource, the infrastructure can be provisioned from a YAML template.

This serverless architecture also means there is no always-running application server to maintain.

The backend runs when requests arrive, making the architecture a good fit for a focused creative application.

Why I Kept It Simple

A key decision behind VerseCraft AI was to focus on one experience and do it well.

It would have been easy to add:

  • User profiles
  • Saved poem collections
  • Social features
  • Multiple dashboards
  • Complex AI settings
  • Payment systems

But none of those were necessary for the core idea.

The most important workflow is simply:

A person has an idea. AI helps turn that idea into something creative.

Keeping the application focused allowed me to concentrate on the experience and the underlying serverless architecture.

What I Learned

Building VerseCraft AI gave me the opportunity to combine several areas I had been learning separately into one complete application.

Connecting AI to a Frontend

It is easy to call an AI API from a simple script.

Building the complete flow is different.

I had to think about:

  • Browser requests
  • API design
  • Request formats
  • Error handling
  • Structured AI responses
  • Backend security

The complete flow became:

Browser → API Gateway → Lambda → Groq → Lambda → Browser

Serverless Backend Development

I learned more about how AWS Lambda and API Gateway can create a backend without maintaining a traditional server.

The application only runs backend code when a request arrives.

Infrastructure as Code

Using CloudFormation made me think about AWS infrastructure as a complete system rather than a collection of resources manually created through the AWS Console.

Defining resources, permissions, dependencies, and outputs in YAML makes deployments easier to reproduce.

Simple AI Experiences Can Still Be Useful

One of my biggest takeaways was that a creative AI application does not need to be complicated to be useful.

The most important part of VerseCraft AI is the experience:

Give someone a blank box, let them express an idea, and turn that idea into something creative.

Final Thoughts

VerseCraft AI is a small experiment in combining creative expression, generative AI, and serverless AWS infrastructure.

The core idea is simple:

Idea → Mood → AI → Poem

Sometimes, a focused application can create a better experience than a feature-heavy platform.

VerseCraft AI gives users a simple starting point. They bring an idea, feeling, memory, or even just one sentence, and the AI helps transform it into something creative.

Try VerseCraft AI

Live App:
Open VerseCraft AI

If you have an idea, a feeling, a memory, or simply a sentence in your head, give it to VerseCraft AI and see where it takes you.

Top comments (0)