Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosfreeCodeCamp.org: TimescaleDB Course – PostgreSQL for Time-Series Data(23.09.2026 um 12:30 Uhr)
Windows Tipps & SecurityAndroid 17: Rollout auf Samsung-Galaxy-Smartphones verzögert sich(23.09.2026 um 11:42 Uhr)
Unix & Linux ServerUSN-8733-2: Gzip vulnerabilities(22.09.2026 um 18:04 Uhr)
Sichere ProgrammierungHow to Build Custom PowerPoint Add-Ins for Enterprise Teams(23.09.2026 um 11:25 Uhr)
Sichere ProgrammierungSearch Google Jobs in Real-Time with Go and SerpApi 🚀(23.09.2026 um 12:13 Uhr)
Sichere ProgrammierungA Psychological State is a Coefficient Vector(23.09.2026 um 12:16 Uhr)
YouTube Security VideosfreeCodeCamp.org: TimescaleDB Course – PostgreSQL for Time-Series Data(23.09.2026 um 12:30 Uhr)
Windows Tipps & SecurityAndroid 17: Rollout auf Samsung-Galaxy-Smartphones verzögert sich(23.09.2026 um 11:42 Uhr)
Unix & Linux ServerUSN-8733-2: Gzip vulnerabilities(22.09.2026 um 18:04 Uhr)
Sichere ProgrammierungHow to Build Custom PowerPoint Add-Ins for Enterprise Teams(23.09.2026 um 11:25 Uhr)
Sichere ProgrammierungSearch Google Jobs in Real-Time with Go and SerpApi 🚀(23.09.2026 um 12:13 Uhr)
Sichere ProgrammierungA Psychological State is a Coefficient Vector(23.09.2026 um 12:16 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Building an AI-Powered Travel Planner (Matargashti) with Smart Caching and Controlled Fetching

Understanding AI Apps:- matargashti-AI travel-planner Live demo:- demo I built this app called matargashti because I was honestly tired of travel planners that either feel too static or just spam API calls every time you touch a dropdown.…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Understanding AI Apps:- matargashti-AI travel-planner

Live demo:- demo



I built this app called matargashti because I was honestly tired of travel planners that either feel too static or just spam API calls every time you touch a dropdown. The idea was simple in the beginning — I wanted something where I could just pick a city, country, number of days, click a button, and get a proper itinerary that actually feels like a human planned it. That’s where the AI part came in.



So the app is basically an AI-powered travel planner where you input your destination and duration, and it generates a full itinerary — best time to visit, places to see, a day-wise plan, budget ranges, and even local tips. This is all generated using AI models through OpenRouter, integrated via the OpenAI SDK. That part was actually the fun part — getting structured, useful output from AI instead of random paragraphs.



But the real challenge wasn’t just “plug AI and done.” The moment you start working with AI APIs, you realize two things: they’re slow and they cost money. So the entire focus of this app shifted from just generating itineraries to generating them intelligently.



Initially, I had the API tied directly to the dropdowns — change city, boom, API call. Change days, another call. That was a disaster. Not only was it wasteful, but the UI also kept flickering and resetting. That’s when I realized I needed to control when the API runs.



So I introduced this idea of separating form state and query state. The dropdowns update the form state freely, but the API only cares about a separate queryParams state, which only updates when the user clicks “Generate.” That one change solved multiple problems at once — no unnecessary API calls, predictable behavior, and much better UX.



Then came the next issue — data disappearing. If I generated a plan, then changed a dropdown, everything would just vanish. That felt terrible from a user perspective. The fix here was subtle but powerful. Instead of tying the UI directly to input changes, I let React Query hold onto the previous data using placeholderData. So even when a new request is triggered, the old data stays on screen until the new one arrives. No flicker, no blank states.



Another interesting bug was around loading states. The loader worked perfectly the first time, but on subsequent requests, nothing showed. It looked like the app wasn’t doing anything. Turns out React Query treats initial load and refetch differently — isLoading vs isFetching. Once I handled both, the UI finally behaved the way it should. I also wired this into the button so it switches from “Generate” to “Generating…” properly every time.



One more thing I didn’t expect was the navigation issue. If I generated a plan, navigated to another page, and came back — everything was gone. Not because React Query lost the data, but because my component lost the reference to it. That’s when I started using queryClient to store and retrieve the last used query parameters. So now when you come back, the app restores your last search and instantly shows the cached result. No localStorage needed, no hacks — just using the tools properly.



From a UX perspective, this app became way better after these changes. The user is always in control, nothing happens unexpectedly, and the app feels fast even though AI calls take time. The biggest win is that it doesn’t feel like a “loading machine” — it feels stable.



What I really took away from building this is that integrating AI is the easy part. The hard part is making it usable. Managing when to call it, how to cache it, and how to present it without breaking the experience — that’s where the real work is.



If I take this further, I’d probably add saving itineraries, user accounts, and maybe even shareable links so people can send their travel plans around. But even in its current state, this project taught me a lot about handling server state, optimizing expensive APIs, and building smoother user experiences.



Overall, this wasn’t just about building a travel app. It was about learning how to build something that feels thoughtful — both technically and from a user’s perspective.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Building an AI-Powered Travel Planner (Matargashti) with Smart Caching and Controlled Fetching

Thematisch verwandte Begriffe: Building, AIPowered, Travel, Planner · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-19438 | Improper Limitation of a Pathname to a Restricted Directory ('Path Trave…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick