Robbin Schuchmann
Robbin Schuchmann
June 4, 2025

Adding Affiliate Links & Google Maps to Our Directory | Learning In Public Day 16

So here's the thing about building in public - sometimes you're cruising along thinking everything's going great, and then you read one tweet that makes you realize you've been walking a tightrope without a safety net this whole time.

Quick summary

Day 16 of my 60-day challenge brought some major wins and a few "oh crap" moments. I finally set up GitHub (after seeing too many horror stories on X), added affiliate link functionality to monetize the travel directory, and integrated Google Maps. Plus I completely restructured how amenities work in the database. Not bad for a day's work, right?

Why GitHub became my new best friend

You know what's funny? I've been building this travel directory for over two weeks, making changes every day, and I somehow forgot to set up version control. I know, I know - that's like building a house without insurance.

But then I saw these tweets from people who lost entire projects because Cursor or some AI tool just... deleted everything. Months of work, gone. That's when it hit me: I'm an idiot for not having this set up already.

Living here in Bali, I've learned that sometimes the most obvious solutions are the ones you overlook when you're in the flow. So the first thing I did today was set up GitHub Desktop (yeah, I prefer the GUI over command line - fight me).

Here's how stupidly simple it was:

  1. Open GitHub Desktop

  2. Click "Add existing repository"

  3. Choose my project folder

  4. Commit and publish

Now every change I make gets tracked. If I mess something up, I can roll back to when things actually worked. It's like having a time machine for your code.

The affiliate link challenge (aka how to actually make money from this thing)

So I'm building this travel directory, but I hadn't really thought through the monetization part. I mean, what's the point of sending traffic to hotels if I can't earn anything from it?

The plan is pretty straightforward: when someone clicks "Book Now" or "Check Availability" on a hotel listing, they go through my affiliate link to Booking.com. If they book, I get a commission. Simple, right?

Well, not exactly. First I had to figure out where to store these affiliate links in my database.

Adding the affiliate link column

I decided to add the affiliate link field to my main listings table since I'll use it for hotels, spas, restaurants - basically everything. Here's the SQL I ran:

ALTER TABLE public.listings 
ADD COLUMN IF NOT EXISTS affiliate_link TEXT;

The cool thing is that if I don't have an affiliate link for a place, I can just link directly to their website. That way I'm still sending them traffic, which feels good - supporting local businesses in Bali and all that.

Making the buttons actually work

Then I had to update all the "Book Now" and "Check Availability" buttons to use these affiliate links. This is where Cursor really shined - I just told it what I wanted, and it updated the components automatically.

The logic is simple: if there's an affiliate link, use that. If not, fall back to the regular website URL. Everyone wins.

Google Maps integration (easier than I expected)

I wanted to add maps to each listing so people can see exactly where places are located. Living in Bali, I know how important it is to understand the geography - some places that look close on paper are actually a nightmare to reach.

Getting the API key

First, I had to set up a Google Maps API key. I was worried about costs, but Google gives you $200 in monthly credits, which should be plenty for a small directory like mine.

The process was pretty straightforward:

  1. Go to Google Cloud Console

  2. Create a new project

  3. Enable the Maps JavaScript API

  4. Create an API key

  5. Add it to my environment variables

The one-shot implementation

This is where I got genuinely excited. I told Cursor: "I want to show the location on a map with a 'Get Directions' button that opens Google Maps."

And it just... did it. In one go. Created the map component, integrated it into the listing page, added the directions functionality. The whole thing probably took 5 minutes.

Now each listing shows an embedded map with the exact location, plus a button that opens Google Maps for navigation. Pretty slick for something that would have taken me hours to figure out manually.

The amenities database redesign (because hardcoding is evil)

Here's where things got a bit messy. I had been hardcoding amenities for hotels - you know, stuff like "Free WiFi," "Pool," "Room Service." But that's terrible for filtering and searching later.

Why the old approach sucked

Imagine trying to filter hotels by amenities when each hotel just has a text field with random amenities listed. It's impossible to query properly. Plus, if I wanted to add the same amenity to multiple places, I'd have to type it out every time.

The new database structure

So I created a proper amenities system:

  • One table for all possible amenities

  • A junction table linking hotels to their amenities

  • Proper many-to-many relationships

This means I can now:

  • Add new amenities once and use them everywhere

  • Filter hotels by specific amenities

  • Keep everything consistent

The implementation got a bit tricky because I had to remove the old hardcoded amenities column and update all the forms and queries. But once it was working, adding amenities became super clean.

The stuff that went wrong (because nothing ever goes smoothly)

Form submissions weren't saving

I spent way too long debugging why amenities weren't saving when I updated hotel listings. Turns out the form was trying to save to the old database column that I'd already deleted. Classic.

Row Level Security headaches

Supabase (my database) has this security feature where you need to set up policies for who can read/write data. I forgot to add policies for my new amenities tables, so nothing was saving.

The fix was adding proper RLS policies:

-- Allow authenticated users to read amenities
CREATE POLICY "Allow read access to amenities" 
ON stay_amenities FOR SELECT 
TO authenticated 
USING (true);

-- Allow authenticated users to manage stay-amenity relationships
CREATE POLICY "Allow full access to stay amenities junction" 
ON stays_amenities_junction FOR ALL 
TO authenticated 
USING (true);

API billing setup confusion

Google Maps required billing setup even for the free tier. I was paranoid about accidentally racking up charges, but the free credits should cover my usage for months.

What it looks like now

The directory is starting to feel like a real product. Each hotel listing now has:

  • Affiliate links on all booking buttons

  • An embedded Google Map showing exact location

  • Proper amenities that I can filter and search by

  • All changes tracked in GitHub

I'm honestly pretty excited about the progress. The foundation is solid, and now I can focus on adding content and working on SEO.

Lessons I'm taking from this

  • Version control isn't optional: I should have set up GitHub on day one. Seeing those horror stories on X was a wake-up call.

  • Database design matters early: Hardcoding amenities seemed fine at first, but redesigning it later was a pain. Think about scalability from the start.

  • AI tools are getting scary good: Cursor implementing the entire Google Maps integration in one shot still blows my mind.

  • Small wins add up: Each feature feels minor, but together they're turning this into something real.

What I'm working on next

The technical foundation is mostly done, so now I need to:

  1. Add actual content (hotels, restaurants, spas)

  2. Get my partner Grace to help with writing and photos

  3. Start working on SEO and content strategy

  4. Maybe add dining and wellness sections

I'm also building a public progress page where I'm documenting each day of this challenge. Still figuring out the best way to get feedback from people following along.

Final thoughts

You know what's wild about this whole process? Three weeks ago, I had zero experience building travel websites. I always thought the margins were too low compared to SaaS affiliate sites where I can earn recurring commissions.

But there's something satisfying about building something that could actually help people discover cool places in Bali. Even if the commissions are smaller, the impact feels more real.

Plus, I'm learning a ton about database design, API integrations, and building in public. That knowledge transfers to everything else I build.

If you're following along with this challenge, thanks for sticking with me through the technical weeds. Tomorrow I'll probably focus more on content and start thinking about the SEO strategy.


Want to see the daily progress? I'm documenting everything (including mistakes) at my public build page. And if you have ideas for features I should add to the travel directory, I'd love to hear them.

Robbin Schuchmann

Robbin Schuchmann

Entrepreneur and founder of multiple companies in the global employment space. Passionate about simplifying global hiring and connecting talent across borders.

Adding Affiliate Links & Google Maps to Our Directory | Learning In Public Day 16 | Robbin Schuchmann