Skip to main content

From a Simple Thought to a Real Application in Minutes – The Vibe Coder Way

Bedtime stories have always been a cherished tradition, helping children wind down and drift off into a peaceful sleep. However, a kid of my relative faced a unique challenge means he always wanted a fresh, unique story every single night. No repeats, no recycling old tales. This challenge turned into an opportunity for me to combine my passion for software engineering with my love for creativity. As a software engineer, I thought: Why not automate the process of generating unique, interactive bedtime stories?

Instead of manually inventing new stories every night, I decided to build a web application that could generate unique stories on demand by using AI, personalized and interactive to engage children. The goal was to give children the power to shape their own bedtime stories. Here’s how I went from a simple idea to a fully functional application using rapid prototyping, pair programming, and cutting-edge technologies like Gemini API, React, and Tailwind CSS.

Conceptualising the Solution

The Idea

The idea was simple yet ambitious: create a web application that generates unique, interactive bedtime stories, where the child can influence the story’s plot. Instead of manually coming up with new bedtime stories each night, I wanted the app to automatically generate fresh stories using AI technology. The goal was to allow the child to customize their own bedtime adventure by making simple choices that would change the narrative, making bedtime both engaging and fun.

  1. From where story will come: To generate these stories, I decided to use Gemini AI (by Google). This advanced language model is designed to generate natural and engaging narratives. I set up predefined prompts that would feed into Gemini, allowing it to create stories based on dynamic inputs. The AI processes the user-provided keywords and turns them into a coherent, personalized tale. Additionally, for voice interactions, the Gemini API supports processing spoken words, enabling the system to translate voice input into a coherent story. This flexibility is essential for creating an interactive and personalized experience.

  2. How to develop the web app in lesser time: To tackle the challenge of building the web app in a short amount of time, I used Cursor IDE for collaboration. Cursor is an AI-powered coding assistant that helps developers write code faster by providing real-time suggestions, code completion, and bug fixes. It significantly reduced development time because I could focus more on the application’s core features, while Cursor handled most of the boilerplate coding and repetitive tasks. Moreover, using tools like React and Tailwind CSS helped me rapidly prototype the front end with minimal custom styling, allowing for a quick turnaround.

Planning the Solution

Choosing the Right Technologies

To bring this idea to life quickly, I knew I needed to select the right technologies. I needed tools that could help me develop fast while still providing flexibility and scalability. Here’s how I approached the tech stack:

  • Gemini AI for Story Generation: I chose Gemini AI because it offered powerful and dynamic storytelling capabilities, including support for natural language processing. It would generate the interactive, personalised stories that we needed.

  • React for Front-End Development: I selected React due to its component-based architecture, which allows for reusability and easy updates. It also provides excellent support for dynamic content like interactive stories.

  • Tailwind CSS for Styling: Tailwind’s utility-first CSS framework is perfect for rapid prototyping. It enabled me to style the application quickly, focusing on layout and design without having to write much custom CSS.

  • Cursor IDE for Collaboration: Pair programming played a key role in speeding up the development process. Using Cursor IDE, I was able to develop the website in couple of minutes.

Pair Programming with AI

One of the best strategies I used in this project was pair programming, but with a twist. Instead of a human partner, I used Cursor IDE, an AI-powered coding assistant.

Cursor helped me write 80% of the code, making development much faster. While there were some bugs, fixing them was easy because Cursor provided real-time feedback.


How Cursor Mimics Traditional Pair Programming

Using Cursor felt like working with a human pair programmer. Here’s a detailed look at how I used it in my project:

1. Starting the Task: Defining the Goal and Initial Prompt

In this phase, I started by clearly defining the task I wanted to solve. For instance, I needed to fetch a story from the Gemini API. This initial definition helped Cursor understand the task and generate relevant code from the start.

  • Prompt Example: “Create a function for calling the Gemini API for story generation. The function should take a prompt string as input, include the API key, and return the generated story text.”

2. Iterative Refinement: Reviewing, Questioning, and Guiding Cursor

Once the initial code was generated, I reviewed it and suggested improvements. This back-and-forth interaction is key to achieving high-quality results.

  • Example Prompt for Refinement: “Can you add error handling to this function to catch cases where the Gemini API returns an error code? Also, implement a retry mechanism in case of temporary network issues.”

3. Finalizing the Solution: Testing, Polish, and Acceptance

Once I was happy with the code generated, I tested it thoroughly to ensure it worked as expected. This stage was essential for ensuring the app was both functional and reliable.

  • I ran various tests to check if the story generation function worked with different inputs and also ensured that it could handle errors effectively.

Tips for Effective AI Pair Programming

To get the best results with Cursor, follow these tips. Remember, AI is a tool, and like any tool, its effectiveness depends on how you use it!

  • Be Clear with Prompts

    • Why it matters: Ambiguous prompts lead to vague, unhelpful code. Think of Cursor as a very literal (and fast!) programmer. The more detail you provide, the better it can understand your intent for the bedtime story app.

    • ✅ Create a React component that displays the story text generated by the Gemini API. Use Tailwind CSS for styling, centering the text and using a pleasant font size for children.

    • ❌ Create a component which will display the story.

  • Fix Mistakes Instead of Getting Frustrated

    • Why it matters: AI isn’t perfect. It can generate code with errors or misunderstand your intent. Getting frustrated won’t help! Instead, treat errors as opportunities to refine your prompts and help Cursor learn how you want the bedtime stories to be. Debugging and iterating is a key part of the process.
  • Ask Cursor to Review Your Code

    • Why it matters: Code review is a critical part of software development. Cursor can act as a quick and readily available code reviewer, catching potential issues early on, especially in the context of the bedtime story app.

    • ✅ After writing the function that calls the Gemini API to generate the story segments, you paste the code into Cursor and ask: “Can you review this code for potential API rate limiting issues or error handling when the Gemini API is unavailable? Are there ways to improve the efficiency of the API calls?”

    • ❌ You write the code to call the Gemini API and immediately deploy it without any review.

  • Know When to Work Without AI

    • Why it matters: While Cursor is excellent for coding tasks, it’s not a substitute for human creativity and problem-solving, particularly when it comes to the overall user experience and story design of the bedtime story app.

    • ✅ You decide to use Cursor to generate the UI elements for the “Create with Keywords” form and the voice input functionality, but you design the overall flow of the story, the types of choices presented to the child, and the general narrative structure.

    • ❌ You ask Cursor to design the entire app, including the narrative structure of the stories, the types of interactions, and the overall look and feel, without any human oversight.


Technical Details

How the Story Generation Works

The core of the application lies in its ability to generate interactive stories. Using the Gemini API, the app takes in user input—either through typing or voice—and generates a story based on that input. There are two primary methods for generating stories:

  1. Create with Keywords:
    • The user (child or parent) inputs a few keywords, such as the child’s name, the type of story, and the language.
    • These keywords are sent to the Gemini API, which processes the data and returns a fully-generated story.
    • The story can be read aloud or displayed on the screen, and it’s tailored to the child’s preferences.
    • image
    • image
  2. Tell Your Story (Voice Mode):
    • This feature uses voice recognition to allow the child to describe what they want in the story. They can say things like, “I want a story about a dragon and a king in a forest,” and the system will convert the voice input into a story.
    • The Gemini API processes the spoken content and creates a personalized story based on the child’s voice input.
    • image
    • image

      Once the child interacts with either mode, the system generates an interactive story that culminates in a decision point. At these moments, the child is asked to make a choice that will affect the story’s direction. For example, the story might say, “The dragon offers you two choices: do you want to fight it or talk to it?” Depending on the child’s choice, the story continues accordingly.

Conclusion

What started as a simple idea to help a kid has evolved into a fully functional web application that creates unique, interactive stories. It’s incredible to see how technology, creativity, and a touch of innovation can come together to create something truly engaging. By leveraging Gemini AI, React, Tailwind CSS, and the AI-powered assistance of Cursor, I was able to quickly prototype and build a solution that’s not only fun and interactive but also scalable.

The process was a reminder of how powerful collaboration—whether with a human partner or an AI—can be when it comes to transforming an idea into something real. With rapid prototyping and a willingness to iterate, I was able to turn a problem into a delightful solution, and it reinforced the importance of acting on ideas quickly.

At the end of the day, what really excites me about this project is how it brings joy and creativity into children’s bedtime routines, turning a simple moment into an adventure. It’s proof that, when we combine technology with a sense of purpose, we can make a lasting impact—no matter how big or small the idea may seem at the start.

Web URL: https://ai-story-teller-six.vercel.app/

Explore Other Resources

February 14, 2024 in Case Studies, Product Engineering

CLAS – A system that integrates Hubspot, Stripe, Canvas

About This Project Ziplines is a series A-funded ed-tech startup with one goal—helping students attain the real-world skills they need to thrive in careers they love by partnering with universities.…
Read More
April 4, 2025 in blog

Gentle Introduction to Elasticsearch

Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents. Elasticsearch is developed…
Read More
April 4, 2025 in blog

How to fix “OAuth out-of-band (OOB) flow will be deprecated” error for Google apps API access.

Migrate your OAuth out-of-band flow to an alternative method. Google has announced that they will block the usage of OOB based OAuth starting from January 31, 2023. This has forced…
Read More