How harman21754/wanderchat works
Project Type & Purpose
• This is a full-stack web application (“WanderChat”) whose goal is to generate personalized travel itineraries.
• Frontend: React SPA (user inputs → UI rendering).
• Backend: FastAPI service (business logic, external API orchestration).
• External APIs: Gemini (Google Generative AI) & RapidAPI GeoDB Cities.
File Structure
• Top-level files: .gitignore, README.md, LICENSE, package.json (Node scripts & deps), package-lock.json
• backend/
• main.py – FastAPI app & HTTP endpoints
• requirements.txt – Python dependencies
• public/
• index.html – React entry HTML
• src/
• index.js – React bootstrap
• App.js – Main SPA + router + form
• components/ – Itinerary.js, TripOutputPage.jsx + CSS
• No database or caching—pure compute layer + external services.
Key README Insights
• React ecosystem: React Router, React Bootstrap
• Python ecosystem: FastAPI, Uvicorn, Pydantic, python-dotenv
• External service SDKs: google-generativeai, httpx
• Config files (.env) for REACT_APP_BACKEND_URL, GEMINI_API_KEY, RAPIDAPI_KEY.
• End User / Web Browser
• Static Asset Host (Node dev server or CDN)
• React SPA
• Form Component (dest, days, style, budget)
• TripOutputPage & Itinerary Components
• FastAPI Service
• REST Endpoints (/generate-itinerary, /suggest-city)
• Business Logic & Fallback Path
• External APIs
• Gemini API (via google-generativeai SDK)
• GeoDB Cities API (via httpx)
• Configuration Store (.env files)
1. Browser → Static Host: GET /index.html, /bundle.js
2. React SPA → FastAPI: POST /generate-itinerary (payload: destination, days, style, budget)
3. FastAPI → Gemini API: HTTPS call (itinerary generation)
4. FastAPI → GeoDB API: HTTPS call (city suggestions)
5. Gemini & GeoDB → FastAPI: JSON responses
6. FastAPI → React SPA: aggregated JSON response (itinerary + tips/fallback)
7. React SPA → Browser DOM: render results
c. Architectural Patterns & Principles
• Single-Page Application (SPA) + RESTful API separation
• Layered architecture: Presentation → API → External Services
• Config-driven endpoints & secrets (dotenv)
• Monolithic back-end (one service) with third-party integrations
d. Technologies & Frameworks
• React (JSX, hooks, Router)
• React Bootstrap
• FastAPI + Uvicorn
• google-generativeai SDK, httpx, python-dotenv, Pydantic