Vibe Coding Tutorial: Build a Thumbnail Image Generator with Nano Banana Pro
Build and test a blog thumbnail generator that turns a title, a summary, and a style choice into an image.
Watch on YouTube ↗Follow the walkthrough
1. Define the request
Specify the three user inputs and what the generated thumbnail should look like before wiring up the generation service.
Watch at 00:00:012. Plan the interface and backend
Use the PRD as context for the implementation model. The demonstration separates a React form from the Express backend that sends the image request.
Watch at 00:01:563. Reproduce failures in the browser
Run the form and identify the failing element or console error. Pass the observed failure to the agent, then try the same interaction again.
Watch at 00:04:044. Cap live generation during QA
Limit the test agent to three image-generation requests, as Amir does in the recording. Inspect the front-end and backend results and use the failed cases to drive fixes.
Watch at 00:08:24
The acceptance check is a successful request from the form through the backend to an image the user can see.
Read the transcript
In this video today, we're going to be using Nano Banana Pro to create an image generator for blog posts. And essentially what we're going to do is use a simple React application that lets you put a title, the post summary, and choose a style guide to generate this image. We're going to use replicate to connect to the Google image API and also use test sprite to do endto-end testing for the front end and the back end. All right. So, whenever I like to um start
an app, I always want to kind of have a plan around what I'm going to be building, what it's going to do, and then get into building the actual PRD and then the plan for to building it itself. So, uh we're going to have a blog post image generator. Uh we're going to put a title in there or summary explaining the blog post and then have Nano Banana Pro to generate an image for based on the style. It's going to have a simple front end. It's going to be built
in React. We're going to use Node.js JS or express uh to essentially uh have the server to call the image generation service and then um this API is going to be uh hitting replicate to actually generate the image. So it's going to be really simple. You put in a title, we hit the API service and then get an image back in response and then we're going to test all of this using uh test sprite. And I'll talk about what test sprite is and how it can fit into your
blab coding workflow. All right, now let's jump into cursor. So what I have here is essentially a PRD. I have already prompted this to actually create the PRD. So how it works is essentially you know we have our front end stack here, our backend, the external service, we have the browser. It'll make an API request through the express server to the replicate API and then return an image to show you what that looks like. And then we're going to have antenn.
So, first thing I always like to do is go into a plan mode and hook up GPT 5.1. Now, I've mentioned this before. I think certain models that are thinking models are actually really great when it comes to planning and then you switch to something like compo composer uh one which is cursor's uh frontier model to actually be able to execute um and build the scaffolding for the code itself. So, we have this PRD and we're going to go um tell the agent based on this PRD,
please generate a plan to build this app. So, what we have here is we're going to get it to actually execute and build together a plan and then we're going to use a plan to um build the application. All right, looks like we have our plan already built out or is being built out as we speak. So once it's done, we're going to switch to composer one. It's already pre-selected. And then we're going to go and proceed with the build. And it's
done now and let's proceed with the build. So just I want to clarify that um I already have got my API token for replicate which essentially hosts this image service. Uh let's go ahead and build this plan and see how it uh works out. So it's going to review the project structure. It's going to start installing the packages. We have a client side and then the back end. We have the EMV example. So, we're actually going to uh put our token
EMV in here. So, let's just throw this in there. I'll drop that in there as well. So, the EMV example is just how it's built out, but we're going to actually create um our own EMV file. And I'll obviously rotate this key afterwards, but this is for demonstration purposes. So, we have the app build. And then once it's done building, we're going to say now run the server I want to test it out in the the browser.
And you can actually add the browser. Let's go. And if you hold option or the I guess the alt key, you're able to key your message. Cue your message here so that you can follow up afterwards. Cool. Have it fully built out. Now we're going to say um we're going to write maybe top 10 productivity tips. Oh, interesting. So actually uh the text is white which is a a bug. So you can actually use the highlight feature within cursor to uh go ahead and u make the changes. So it's
actually going ahead and testing it. So let's pause right there. Oh, there's a bug happening. Let's pause it right there and just say that the the text here and the text here and the text here are the input text field is white. Please ensure it's black. Type in top 10 productivity. And then we're just going to pause it right here.
and see see what happens. Top 10 productivity tips for getting work done. This blog post uh covers tips on how to focus. We'll do retro poster style. Cool. Let's go and Oh, it failed to fetch. So how I would debug in this situation here is I would actually open up the console log and notice that okay why aren't we able to generate an image? So there's connection being uh that there's a connection not
being made to the backend servers. So in this instance here I will post this log and say I have an issue generating image check the browser console log for reference. So we can go replicate docs start for NodeJS. So what's really cool with documentation is you can actually copy the page as markdown and then drop it in here. So I'll say for reference here are the docs and then also you can know if you really wanted to you can actually paste the
URL. Cool. So let's see how it works out and what the bug is. All right let's try again. So, we're going to do top 10 productivity tips to get work done. This article creates 10 tips while focusing on work retro style. Okay, cool. Let's see what happens. Ready? Now, we have the image retro style pulser. it actually generated the text and the image for it that you can
use as a thumbnail to um for your blog post. Now what if we want to actually test this for a production version? So with a lot of vibe coding apps um so often times we'll miss certain issues or bugs and not run the required tests. We need to ensure that this is actually secure or vibe secure. So what I want to talk about is test sprite. So with test sprite, you can actually use their MCP that and the internal dashboard to be able to run both front-end and backend
tests for your application. It lets you even run schedule tests that you can run on a weekly basis or a daily basis to go through certain test cases that it has created for you. It's fully agentic and validates and lets you ship your co code a lot faster. The pricing is actually very fair. Um, as you're aware with cursor, you do have bugbot, but the only issue is that it's an add-on. The free plan is quite limited and the paid plan is an add-on with um some constraints
around how many uh PR reviews it can run when you push your code, but this you can actually run both in a local or production environment and have it be scheduled. U the cool thing is the starter plan is actually free for the first month and then it's $19 and the credits are quite fair. What's also interesting is that actually there's a great community around it that you can join on Discord to get questions or answers that you need around it. So,
let's talk about how you can actually get set up and how I'm going to be using the MCP to run test cases. So, what you're going to do is you're going to go to your dashboard and click on the MCP quick install. So, it's this button right here in your dashboard and you're going to click on create an API key. I've gone ahead already created one for my MCP and then we're going to do the install MCP setting which is add to cursor. It's going to open up cursor.
This is super convenient because you don't have to do any manual configuration. All you got to do is put your API key. We're going to say using the test sprite MCP, please generate a front-end test plan and um make sure you limit the image generation requests to only three. Uh I don't want to use too many image requests. Now, what does this actually mean? So, in instances where you're connected to a third-party API, so in this instance, I'm using Nano
Banana Pro and it's quite expensive. If I'm running a test and it's going to be testing it 50 times using different scenarios, that's going to be quite expensive that I'm going to have to pay for. So I actually want to give it constraints and guard rails to say only do these two three cases. Now this is a little bit different on a case by case for demonstration purposes. I want to just show you like two or three test cases when it's making a request. But
you can obviously go very extensive and choose what makes the most sense for you. So what's going to happen is it's going to call the MTP now and actually generate a test plan. Now what may happen is once it generate the press test plan it's going to ask you to actually provide a PRD. I've gone ahead and exported the original PRD that we had. So we're going to say we want the front end the entire codebase. No authentication needed. This is the local
port. The PRD is updated. Now it's going to close this and in cursor we're going to see the actual test plan. It created the code summary as well and then it's going to now run the actual test plan. So it has all the features what it does based on the PR we generated and then it's going to go ahead and create that test plan for us. So we'll pause right here and it's now running the test generation and execution command. So we'll go back to our dashboard and we're
going to see if we refresh here a new uh test plan being generated. So let's look at what's going on here. This is essentially within the MCP test. So right here and it's all in progress. So if I actually go back to replicate. So let's look at it here right here. It should shortly run some image requests. So we're actually seeing the tests pass and fail in real time. So we had actually uh what you can see is a video of the actual agent going in and testing
it and then the recording coming back and showing you what that looks like. So let's see what it does. Pretty cool. And yeah, so it was able to actually see a real time prompt review update. That's a feature we had where it shows you the prompt review in in real time essentially. So we can now see if it fails a test. So in this instance, loading states displays uh display and submit button disabled. So what's this bug here? This tests to verify that the
image generation request is processing and loading spinner message are displayed and the submit button is disabled to prevent submissions after it has failed. It didn't show. So now it shows that this test actually failed. We can also see on the back end it's making the requests through replicate to show actually uh the images being generated. So all the tests. So this is exactly what I was talking about earlier where you want to make sure that it's not just
like sending you a lot of requests and then costing you a lot of money. Uh just something to keep in mind for kind of any external API service that you're using. All right. So we've gone ahead and finished the test. It does take a little bit of time to go through but actually it does save you a lot of time in the future. So in this instance about four five passed and then 10 failed. So for example like some error handling on the API side. Um there was an issue with
I think it trying to make multiple image requests. So I think here um it it actually tried to check for responsive display on the devices and it didn't work as intended. So it wasn't able to actually get that um pass that test through. So let's look at some uh some of the issues. So like here for example it tried to actually generate an image request and looks like it wasn't working when I was clicking it. So let's go back to cursor and see what cursor has
provided for us. So it says summary the test gen pler rated it was about 15 tests five passed 10 failed. There's some critical issues here and you can see the report on what worked and what didn't. Now how do you what do you do from here? What do you what are the next steps you take? So what I would do actually is based on these test cases, please proceed to go ahead and fix these issues. So, it's really cool because it kind of lets you actually automatically
run let the agent run these endto-end tests. And then if you wanted to, not only can you do these manually within your code, you can actually create the test within the dashboard itself. So, if you wanted to just go in here and actually create a test, you can go ahead and do that. So, you can just do example test for example. And for here, you'll be able to actually give the API name that you're using, the endpoint, and then the type of testing that you want
to do. Um, I prefer the MCP just because it's very cohesive and within the UI. But at the same time, you can also even do kind of um schedule monitoring. So if you want to run tests every single day or every other day, especially for services like this that's dependent or needed for other sort of uh uh uh applications, you can go ahead and um you know run this. Now we've taken these test cases and actually made the improvements. So it said that for
example um it you know it fixed all these issues which is so cool to be able to actually do this end to end. So now let's recap what we've done here. We have essentially built a front end the NodeJS express uh we've called an image generation to generate an image. We have this all tested within test sprite using the MCP. We were able to create test cases. 15 of them five passed. 10 failed. If I were to run this test again most likely it's going to pass for every
single one. or if it fails, we will then go back and fix the same issues. We were able to generate and tests, have a test plan report, and do this all within a single workflow in just a couple minutes without having to have any issues in the future. I hope you found this tutorial helpful. See you around next time.