(This page has no text content)
Vibe Coding with Cursor, Windsurf, and Lovable Build Apps Fast with AI-Assisted Software Development and Testing Greg Lim
Vibe Coding with Cursor, Windsurf, and Lovable Copyright © 2026 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. Portfolio Director: Ashwin Nair Relationship Lead: Nitin Nainani Content Engineer: Kinnari Chohan Project Manager: Ruvika Rao Technical Editor: Rohit Singh Indexer: Rekha Nair Production Designer: Shankar Kalbhor Growth Lead: Anamika Singh First published: February 2026 Production reference: 1060226 Published by Packt Publishing Ltd. Grosvenor House 11 St Paul’s Square Birmingham B3 1RB, UK. ISBN 978-1-80730-163-7 www.packtpub.com
About the author Greg Lim is a technologist and author of several programming books. Greg has many years in teaching programming in tertiary institutions and he places special emphasis on learning by doing. Contact Greg at support@i-ducate.com.
(This page has no text content)
Table of Contents Preface ix Chapter 1: Introduction 1 Requirements ���������������������������������������������������������������������������������������������������������������������� 4 AI-Powered Coding Tools ���������������������������������������������������������������������������������������������������� 4 Chapter 2: Installing Software (Cursor, NodeJS, Git) 9 Opening the Terminal ��������������������������������������������������������������������������������������������������������� 9 Tool 1: Node�js ������������������������������������������������������������������������������������������������������������������� 10 Tool 2: Git ������������������������������������������������������������������������������������������������������������������������� 10 Tool 3: Cursor ��������������������������������������������������������������������������������������������������������������������� 11 Pricing Note ���������������������������������������������������������������������������������������������������������������������� 12 Chapter 3: Vibe Coding with Cursor 13 Reviewing and Accepting Changes ������������������������������������������������������������������������������������ 16 Understanding that LLMs are Non-Deterministic ������������������������������������������������������������� 20 Embracing Randomness • 20 Choosing a Model in Cursor • 20 Chapter 4: Software Development - Traditional vs Vibe Coding workflow 23 1� Planning ������������������������������������������������������������������������������������������������������������������������ 23 2� Design ��������������������������������������������������������������������������������������������������������������������������� 24 3� Implementation (Coding) ��������������������������������������������������������������������������������������������� 24 4� Testing ��������������������������������������������������������������������������������������������������������������������������� 24 5� Deployment ������������������������������������������������������������������������������������������������������������������� 24 6� Maintenance & Iteration ����������������������������������������������������������������������������������������������� 24
Table of Contentsvi Summary �������������������������������������������������������������������������������������������������������������������������� 25 Choosing a Tech Stack ������������������������������������������������������������������������������������������������������� 25 1. JavaScript (Full Stack) • 25 2. Python (Backend-Focused) • 26 Chapter 5: Vibe Coding Fundamentals with Cursor 27 Writing a Software Specification ��������������������������������������������������������������������������������������� 28 Creating a TODO List �������������������������������������������������������������������������������������������������������� 33 Building the First Feature ������������������������������������������������������������������������������������������������� 34 Starting the Project ����������������������������������������������������������������������������������������������������������� 35 Chapter 6: Configuring Version Control with Git 41 Rolling Back to a Working Version ������������������������������������������������������������������������������������ 43 Ways to Revert Changes ���������������������������������������������������������������������������������������������������� 44 1. Reject Changes in Cursor • 44 2. Ask the Agent to Discard Changes • 45 Chapter 7: Iterating with New Features 47 Chapter 8: Adding Automated Tests 53 Types of Tests �������������������������������������������������������������������������������������������������������������������� 53 Running and Debugging Tests ������������������������������������������������������������������������������������������ 56 Final Steps: Git and Housekeeping ������������������������������������������������������������������������������������ 57 Summary �������������������������������������������������������������������������������������������������������������������������� 58 Chapter 9: Rules for Controlling the AI Behavior 59 Testing the Rules ��������������������������������������������������������������������������������������������������������������� 62 Beyond Testing: Other Use Cases �������������������������������������������������������������������������������������� 63 Chapter 10: Code Refactoring 65
Table of Contents vii Chapter 11: Providing Context by Referencing Resources 69 Chapter 12: GitHub Integration 71 Chapter 13: Deployment 77 1� Asking Cursor for Deployment Guidance ����������������������������������������������������������������������� 78 2� Build the Project ������������������������������������������������������������������������������������������������������������ 79 3� Set Up a Vercel Account ������������������������������������������������������������������������������������������������� 81 4� Build and Deploy with Cursor ��������������������������������������������������������������������������������������� 81 Chapter 14: Building Apps with Lovable (No-code/Low-code) 85 Pricing ������������������������������������������������������������������������������������������������������������������������������ 86 Supabase ��������������������������������������������������������������������������������������������������������������������������� 87 Exporting Your Project ������������������������������������������������������������������������������������������������������ 87 First Lovable Project �������������������������������������������������������������������������������������������������������� 88 History ������������������������������������������������������������������������������������������������������������������������������ 94 Chapter 15: Creating the Software Specifications Document 95 Adding Instructions and Guidelines ��������������������������������������������������������������������������������� 101 Chapter 16: Supabase Integration 107 Storing Data in the Database ������������������������������������������������������������������������������������������� 110 Chapter 17: Adding Functionality 115 Chapter 18: Source Code Extraction via GitHub Integration 121 Chapter 19: Deploying Your Application with Lovable 127 Resolving Security Issues ������������������������������������������������������������������������������������������������ 130
Table of Contentsviii Chapter 20: Domain and External Hosting Options 137 Additional Integrations ��������������������������������������������������������������������������������������������������� 138 Conclusion ����������������������������������������������������������������������������������������������������������������������� 139 Chapter 21: Working on Existing Code Bases with Windsurf 141 Setting Up Windsurf �������������������������������������������������������������������������������������������������������� 142 First Project in Windsurf �������������������������������������������������������������������������������������������������� 143 Creating a New Project ���������������������������������������������������������������������������������������������������� 144 Chapter 22: Analyzing an Existing Code Base 147 Chapter 23: Adding Features 157 Chapter 24: Windsurf Rules 163 Chapter 25: Windsurf Workflows 169 Chapter 26: Deploying Your Application with Windsurf 175 Pricing ���������������������������������������������������������������������������������������������������������������������������� 178 Conclusion ����������������������������������������������������������������������������������������������������������������������� 179 Final Words ���������������������������������������������������������������������������������������������������������������������� 179 Index 181
Preface In this book, we take you on a fun, hands-on, and pragmatic journey to Vibe Coding with Cursor, Lovable, and Windsurf. You’ll start building your first app within minutes. We will discover how to shift from traditional programming to a ‘vibe coding’ approach, where we will prompt AI Agents using natural language to build, test, and deploy our applications. We will use AI tools like Cursor and Windsurf to guide and refine AI output rather than wrestling with every line of code manually. In the course of this book, we will cover: • Introduction to the Vibe Coding Approach • Vibe Coding with Cursor • Software Development - Traditional vs Vibe Coding workflow • Iterating with New Features • Adding Automated Tests • Rules for Controlling the AI Behavior • Providing Context by Referencing Resources • GitHub Integration and Deployment • Building Apps with Lovable (No-code/Low-code) • Creating the Software Specifications Document • Supabase Integration • Domain and External Hosting Options • Working on Existing Code Bases with Windsurf • Windsurf Rules and Workflows and more..
Prefacex Whether you are a complete beginner, curious to build your own apps with AI, or an experienced developer eager to speed up prototyping and learn to guide AI output, this book is for you. What will you learn • Build apps from scratch by describing ideas in plain English and turning them into work- ing code • Identify, debug, and refine AI-generated code • Version control, track changes, and roll back safely with Git and GitHub • Add automated tests to check your app functions well • AI-guided deployment to launch your app Working through this book The book takes a practical hands on approach to learning through practice. You learn best when you code along with the examples in the book. Get in touch Feedback from our readers is always welcome. General feedback: If you have questions about any aspect of this book or have any general feed- back, please email us at customercare@packt.com and mention the book’s title in the subject of your message. Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you reported this to us. Please visit http://www.packt.com/submit-errata, click Submit Errata, and fill in the form. Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material. If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit http://authors.packt.com/.
Preface xi Download a free PDF copy of this book Thanks for purchasing this book! Do you like to read on the go but are unable to carry your print books everywhere? Is your eBook purchase not compatible with the device of your choice? Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost. Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application. The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily Follow these simple steps to get the benefits: 1. Scan the QR code or visit the link below https://packt.link/free-ebook/9781807301637 2. Submit your proof of purchase 3. That’s it! We’ll send your free PDF and other benefits to your email directly
(This page has no text content)
1 Introduction Welcome to this book where we’ll explore this new and exciting way of building software called Vibe Coding. Vibe coding lets you build apps by simply describing them in plain English. No need to worry about programming languages like JavaScript or Python. If you’ve ever copied code from ChatGPT, pasted it into your editor, and then sent back the errors that occurred—congratulations! You’ve already done some coding. But in this book, you’ll be blown away by what else is possible. Vibe coding isn’t just a new tool. It’s more of a mindset—an approach to writing code and building applications. The term was coined by Andrej Karpathy, who describes vibe coding as fully giving into the vibes, embracing exponentials, and forgetting the code even exists:
Introduction2 On the front lines of this movement are tools like Cursor and Windsurf. Let’s briefly walk through a simple project. In Cursor (which is based on VS Code), to create a new project, you simply chat with Cursor. Be- hind the scenes, it uses an LLM and immediately gets to work. I can ask it to recreate my favorite childhood game, a car dodging game where a player drives a car down a highway and dodges oncoming traffic. So I can prompt it: Here’s the cool part: because it’s an agent, it can take a lot of actions on its own—creating files, executing commands, installing dependencies, deploying, and more: In less than a few minutes, you’ll have your first working iteration:
Chapter 1 3 It might not look great at first, but still, it’s amazing what you can do in just one minute. In traditional programming, you need to know every line, every file. But today, the way we build software is changing fast. Writing code itself isn’t the main skill anymore. AI can do that. Instead, the most important skills now are being able to experiment, understand, debug, guide and work side by side with AI. This book is for anyone curious about how AI is changing software development. Whether you’re a complete beginner or already a developer, we will see how AI can help us build faster—and how to do it right. We’ll explore different tools and build multiple projects. We’ll talk about prototyping apps, spot- ting bad code, and which skills matter most in this new era. We’ll also see firsthand why strong fundamentals are still important—especially if you want to build advanced, production-ready apps. By the end of this book, you’ll be able to describe your app ideas in natural language and turn them into working prototypes using AI-powered tools. Essential software development practices such as using Git for version control, organizing projects into clear and maintainable structures, writing and running tests, and automating parts of the process such as deployments. This isn’t just about writing code faster—it’s also about learning how to build real-world, pro- duction-ready apps with confidence. Even if you’re just starting out, it still takes time, practice, and patience. But with the right mindset and the help of AI, you can go from idea to working prototype—and potentially a product—in record time. That said, don’t expect magic from a single prompt. It’s like telling a builder, “Build me a house.” You still need to specify the size, style, and materials. The clearer your instructions, the better the result. This is how software development works realistically. Except now, English—or your native lan- guage—becomes your programming language.
Introduction4 Requirements Now, if you’ve never written code before, following this book will be a bit challenging. There’s a lot to learn, and running into hiccups is part of the process. Having basic programming experience will help you understand the code that the AI generates and able to debut when issues arise. Email me at support@i-ducate.com if you need introductory programming resources. AI-Powered Coding Tools This book aims to teach you the skills you need, regardless of which AI coding tools you choose to use. Right now, there’s an explosion of such tools in this space, and it’s difficult to keep track of them all. In this section, we will give you some orientation so you know which tools might work best for you. If you’re just starting out and don’t have much experience installing Development Tools on your computer, you can use web-based tools like Lovable, Firebase Studio, Bolt or Replit. For example, here’s Lovable: Web-based tools are user-friendly for creating beautiful front-ends without needing to install anything or leave your browser. We just provide a prompt (optionally attach an image or a Figma design) and it can generate a working app.
Chapter 1 5 For instance, I created a small app that helps my child with Math Practice. I simply wrote a short prompt: I want to build a math practice app for students. Each card should display a simple arithmetic problem, such as addition or multiplication. When flipped, it should show the correct answer. The app should randomize problems and track how many were answered correctly. And Lovable generates an interface that would have taken us much longer to build from scratch: From there, we can continue refining the app and improving it through conversation. Lovable even handles deployment—you can use a domain directly from them:
Introduction6 You can also view the generated code if you’re more technical: We can even sync it with GitHub:
Chapter 1 7 Beyond that, we can integrate with services like Supabase for data storage and backend func- tionality. This makes Lovable a great starting point, especially if you don’t want to leave your browser. We will cover Lovable later in this book. If you want something a little more advanced, Firebase Studio (launched by Google) provides more functionality. Though remember that for beginners, “more” isn’t always “better.”
Comments 0
Loading comments...
Reply to Comment
Edit Comment