<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sivaraman Ramaswami</title>
    <description>The latest articles on DEV Community by Sivaraman Ramaswami (@sivaraman_ramaswami_e7cc2).</description>
    <link>https://dev.to/sivaraman_ramaswami_e7cc2</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2549516%2F71548e39-06fd-40de-b77d-731073417e39.png</url>
      <title>DEV Community: Sivaraman Ramaswami</title>
      <link>https://dev.to/sivaraman_ramaswami_e7cc2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sivaraman_ramaswami_e7cc2"/>
    <language>en</language>
    <item>
      <title>I built a travel app with Abstract Factory + affiliate APIs — here's what actually worked</title>
      <dc:creator>Sivaraman Ramaswami</dc:creator>
      <pubDate>Thu, 12 Nov 2026 14:54:41 +0000</pubDate>
      <link>https://dev.to/sivaraman_ramaswami_e7cc2/i-built-a-travel-app-with-abstract-factory-affiliate-apis-heres-what-actually-worked-41g3</link>
      <guid>https://dev.to/sivaraman_ramaswami_e7cc2/i-built-a-travel-app-with-abstract-factory-affiliate-apis-heres-what-actually-worked-41g3</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3qt8nf7etdt0hngopea9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3qt8nf7etdt0hngopea9.png" alt="packedNbooked search results showing Vegas trip package with flights, hotel, car rental, and activities totaling $1,847" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've been building packedNbooked (&lt;a href="https://packednbooked.com" rel="noopener noreferrer"&gt;https://packednbooked.com&lt;/a&gt;) — a trip planner that starts with your budget instead of a destination. You enter $2,000, JFK, 7 days → it fans out to flight/hotel/car/activity APIs in parallel and returns ranked complete trip packages.&lt;/p&gt;

&lt;p&gt;This post is about the architecture decisions that held up and the ones that didn't.&lt;/p&gt;

&lt;p&gt;The pattern: Abstract Factory&lt;/p&gt;

&lt;p&gt;Every travel category (flights, hotels, cars, attractions) gets its own factory. Each factory spawns provider agents. The orchestrator never touches provider logic directly.&lt;/p&gt;

&lt;p&gt;class FlightProviderFactory(BaseFactory):&lt;br&gt;
    def create_agent(self) -&amp;gt; BaseAgent:&lt;br&gt;
        return TravelpayoutsAgent()&lt;/p&gt;

&lt;p&gt;class HotelProviderFactory(BaseFactory):&lt;br&gt;
    def create_agent(self) -&amp;gt; BaseAgent:&lt;br&gt;
        return BookingAgent()&lt;/p&gt;

&lt;p&gt;This paid off when I swapped hotel providers mid-project (Hotellook → Booking.com via CJ affiliate). Zero changes to the orchestrator — I just swapped the agent behind the factory. Same when Ticketmaster went live: new factory, new agent, plug it in.&lt;/p&gt;

&lt;p&gt;The fan-out itself runs async — all four factories fire in parallel, results get budget-pruned, then an LLM (Groq + gpt-oss-120b) ranks the combos by value.&lt;/p&gt;

&lt;p&gt;The hotel API nightmare&lt;/p&gt;

&lt;p&gt;This is the part nobody writes about.&lt;/p&gt;

&lt;p&gt;My original plan was real-time hotel pricing. Here's what I found:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Amadeus — decommissioned their free tier in July 2025&lt;/li&gt;
&lt;li&gt;Travelpayouts hotel endpoints — all 404&lt;/li&gt;
&lt;li&gt;Booking.com, Agoda, Expedia, HotelBeds — all require commercial contracts&lt;/li&gt;
&lt;li&gt;Booking.com via CJ affiliate — Demand API is restricted to "strategic partners," no application path&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I spent three weeks on this before accepting the ceiling: mock prices + live Booking.com deep-links is the permanent setup. The links go to Booking.com search results where users see real availability. It's honest — I label prices as estimates and the Show HN caveat was upfront about it.&lt;/p&gt;

&lt;p&gt;The lesson: travel pricing APIs are a moat. If you're not paying enterprise rates, you're not getting real-time hotel data. Build around it, not through it.&lt;/p&gt;

&lt;p&gt;The affiliate setup (actual numbers)&lt;/p&gt;

&lt;p&gt;Revenue model is affiliate commissions — no ads, no paywall:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Partner&lt;/th&gt;
&lt;th&gt;Integration&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Travelpayouts/Aviasales&lt;/td&gt;
&lt;td&gt;Live prices via Data API&lt;/td&gt;
&lt;td&gt;marker 326901&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Booking.com via CJ&lt;/td&gt;
&lt;td&gt;Deep-links, mock prices&lt;/td&gt;
&lt;td&gt;publisher 101876939&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Viator&lt;/td&gt;
&lt;td&gt;Live affiliate links&lt;/td&gt;
&lt;td&gt;ID P00319033&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DiscoverCars&lt;/td&gt;
&lt;td&gt;Affiliate link&lt;/td&gt;
&lt;td&gt;~$20/booking, 365-day cookie&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Booking.com's CJ approval took about a week. Viator was instant. DiscoverCars was the fastest approval and best cookie window.&lt;/p&gt;

&lt;p&gt;Realistic projection: $0–20/mo now, $200–430/mo at 20k monthly visitors. It's a long game — the affiliate revenue only matters if the SEO compounds.&lt;/p&gt;

&lt;p&gt;What's actually live&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FastAPI backend on Railway ($5/mo), React/Vite frontend on Render (free static)&lt;/li&gt;
&lt;li&gt;Flights: real cached prices from Travelpayouts /v2/prices/latest&lt;/li&gt;
&lt;li&gt;Hotels: estimated prices, live Booking.com deep-links&lt;/li&gt;
&lt;li&gt;Attractions: Viator (live) + Ticketmaster Discovery API (real events by city/date)&lt;/li&gt;
&lt;li&gt;AI ranking: falls back to cost-sort if Groq key is missing&lt;/li&gt;
&lt;li&gt;115 tests passing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What I'd do differently&lt;/p&gt;

&lt;p&gt;Start with the affiliate approvals. I wired affiliate links at the end and retroactively got approvals. Should have done it week one — some take a week+, and you don't want to build around a partner that rejects you.&lt;/p&gt;

&lt;p&gt;Don't fight the hotel API wall. I lost three weeks trying to find real-time hotel pricing. The correct answer was always "mock prices + live booking link."&lt;/p&gt;

&lt;p&gt;Abstract Factory was the right call. The pattern felt like over-engineering for a solo project at first. It wasn't — I swapped providers three times without touching orchestration logic.&lt;/p&gt;




&lt;p&gt;App is live at &lt;a href="https://packednbooked.com" rel="noopener noreferrer"&gt;https://packednbooked.com&lt;/a&gt;. Code isn't public yet but happy to answer questions about the architecture or affiliate setup.&lt;/p&gt;

&lt;p&gt;What travel pricing APIs have you found that actually work at the free/indie tier?&lt;/p&gt;




</description>
      <category>python</category>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
