
How Cursor AI Makes Supabase Setup 5X Faster | Learning in Public Day 8
You know what's wild? I've been putting off this whole database setup thing for weeks, thinking it was going to be this massive technical headache. But today I finally dove in to set up Cursor AI with Supabase for my Bali travel directory project, and honestly... it was actually pretty smooth once I figured out the right approach.
Quick summary
Today was all about getting the foundation right - setting up Cursor AI as my development environment, creating a Supabase database, and getting everything connected so I can actually start building this travel directory. The whole process took about 3 hours (with some detours), but now I've got a solid foundation that should make everything else way faster.
Why I'm sharing this setup process
So here's the thing - I'm doing this 60-day challenge to build a complete Bali travel directory, and I'm documenting everything because I genuinely think this stuff is useful to share. Living here in Bali, I meet so many people who want to build their own projects but get stuck on the technical setup phase.
Plus, I'm not gonna lie, I learn better when I explain things out loud. It forces me to actually understand what I'm doing instead of just copying and pasting code.
The challenge I was facing
I needed to set up three main things today:
Cursor AI as my development environment
Supabase as my database
All the project structure and rules so everything works together smoothly
The tricky part wasn't any individual piece - it was getting them all talking to each other properly and setting up good conventions from the start.
What I tried first (and the detours I took)
Okay, so I started with Supabase because I figured I should get the database sorted before jumping into the code. Pretty straightforward - went to supabase.com, created a new project called "bali-travel-directory", and set the server location to Southeast Asia Singapore since that's closest to where the initial traffic will probably come from.
One thing I did right away was turn off email verification. In the authentication settings, I just switched off the "confirm email" requirement because honestly, when you're just launching something, you don't want to add friction. People can register and start using it immediately. I can always add email verification later when the project is more established.
I also used their quick start template for user management, which automatically created a profiles table connected to the authentication system. Pretty handy.
Setting up Cursor AI (this is where it gets interesting)
Now here's where I got excited - Cursor AI has this new feature called "cursor rules" that I'd never used before. Basically, you can define rules for how your AI assistant should write code, organize files, handle components, all that stuff.
I spent probably 30 minutes setting up rules for:
Component structure and naming conventions
URL structure (always with trailing slashes for SEO)
Database and API standards
Image handling with lazy loading
Performance optimization guidelines
The cool part is once you set these up, Cursor AI follows them automatically. So instead of me having to remember "oh, make sure you add the trailing slash" or "use the proper component structure," it just does it.
Here's how I actually built the project structure
Step 1: Getting all my project guidelines into Cursor
I created a folder called "project-guidelines" and dumped in all the planning documents I'd created earlier - technical specs, database schema, page structure, implementation guide, the whole thing. Then I created another folder called "cursor" with all my coding rules.
Step 2: Letting Cursor AI analyze everything and create a master plan
This was honestly pretty cool. I told Cursor: "Analyze all these files and create a comprehensive project plan with checklists for everything we need to build."
It came back with this incredibly detailed plan broken down into phases:
Phase 1: Project initialization
Phase 2: Core functionality
Phase 3: Advanced features
Phase 4: Testing and optimization
Each phase had specific tasks with checkboxes. Way more organized than my usual "figure it out as I go" approach.
Step 3: Setting up the Next.js project
Here's where I ran into my first real snag. Cursor AI started setting up the Next.js project, but it created this weird nested folder structure that didn't make sense. I had to ask it to move files around, which wasn't ideal but we got there.
The setup included:
Next.js 15 with TypeScript
Tailwind CSS for styling
Shadcn UI for components
All the Supabase integration pieces
Step 4: Connecting everything to Supabase
I gave Cursor AI my Supabase credentials (public URL and anon key), and it automatically generated all the database connection code. But then it also created SQL scripts for all my tables - categories, locations, listings, the works.
The smart thing it did was create separate tables for different types of places (stays, dining, beach clubs, wellness spots) but connect them all through a main listings table. Pretty clean architecture.
The stuff that went wrong
Oh man, there were definitely some hiccups. The biggest one was with Next.js 15 - apparently they changed how cookies work compared to version 14, and Cursor AI was using the old format. Took me like 20 minutes to figure out why the build was failing.
Also, when I tried to set up the storage buckets in Supabase, Cursor AI generated the TypeScript code but didn't actually create the buckets in Supabase itself. I had to manually create those through the Supabase interface.
And don't get me started on the folder structure confusion. For some reason, it created an extra nested folder that I had to clean up later.
How I fixed the problems
For the Next.js cookies issue, I just asked Cursor AI to look up the Next.js 15 documentation and update the code accordingly. Worked perfectly.
For the storage buckets, I manually created them in Supabase:
listings
bucket for place photosprofiles
bucket for user avatarsreviews
bucket for review images
Set them all to public with a 50MB file size limit.
The folder structure thing was just a matter of moving files to the right places and updating the imports.
What it looks like now
I've got a solid foundation running on localhost:3000
. The basic Next.js app loads without errors, Supabase is connected, and all the database tables are set up with proper relationships.
The project structure is clean:
/components
/layout (header, footer)
/listings (main components)
/ui (shadcn components)
/app
/dashboard
/marketing
Everything's connected and ready for me to start building actual pages.
Lessons I'm taking from this
Cursor rules are a game-changer: Setting up conventions upfront saves so much time later
Let AI handle the boring stuff: Database schemas, boilerplate code, configuration - perfect for AI
But stay involved in the architecture: I still needed to make decisions about how things connect
Next.js 15 has some quirks: Good to know for future projects
Supabase setup is actually pretty straightforward: Once you know the workflow
The biggest insight? I used to think I needed to understand every single line of code. But honestly, if the AI can handle the setup and configuration correctly, I can focus on the interesting parts - the actual features and user experience.
What I'm working on next
Tomorrow I'm diving into v0 (Vercel's design tool) to start creating the actual page layouts. Then I'll feed those designs back into Cursor AI to generate the React components. Should be fun to see how that workflow plays out.
I'm also curious about this MCP Supabase integration I saw mentioned - apparently you can connect Cursor AI directly to your database so it can read the schema in real-time. That could be incredibly useful.
Final thoughts
You know what? This whole setup process reminded me why I love building things. Sure, there were frustrating moments when stuff didn't work, but when it all clicked together... pretty satisfying.
If you're thinking about starting your own project, don't let the technical setup scare you. Tools like Cursor AI and Supabase make it way more approachable than it used to be. Just expect some detours along the way - they're part of the process.
Following along with my 60-day challenge? I'm documenting everything as I build this Bali travel directory from scratch. Tomorrow we start on the actual design and user interface - should be interesting to see how v0 and Cursor AI work together.