How vaibhavghugretkar/triptak works
Project type and purpose
• TripTak is a full-stack, single-page web application for personalized trip planning.
• Its core purpose is to collect user inputs (days, traveler type, budget), call external APIs (Gemini for itinerary generation, Google Maps for mapping), and store/retrieve user data (Firebase).
File structure
• Top-level files:
– index.html, Vite and Tailwind configs, Netlify and ESLint configs → static hosting and build setup.
– src/: all React code broken into feature folders (create-trip, my-trips, view-trip), shared components (ui, custom), assets, constants, and services.
• src/service/: encapsulates API integrations (GlobalApi.jsx), Firebase setup (firebaseConfig.jsx), and UI modals (AIModal.jsx).
• src/components/: reusable UI pieces (buttons, dialogs, inputs, toasts).
• Feature modules:
– create-trip: user input form, calls trip-generation API.
– my-trips: lists saved trips from Firebase.
– view-trip: displays detailed itinerary with hotel & place cards plus Google Maps integration.
README for additional insights
• Tech stack: React (frontend), Gemini & Google Maps (backend services), Firebase (database & auth).
• Deployment: static build (Netlify or Firebase Hosting) serving the React app.
• Environment variables: API keys for Gemini, Google Maps, Firebase.
a. Main components
– Browser (User Interface)
– Static Asset Hosting (Netlify or Firebase Hosting)
– React App (bundled via Vite)
– API Gateway Layer (src/service/GlobalApi.jsx)
– External Services:
· Gemini API (trip generation engine)
· Google Maps API (mapping & place data)
– Firebase (Authentication and Firestore database)
b. Relationships & interactions
1. User opens the React SPA in browser.
2. Browser requests static assets from Hosting service.
3. React routes user to create-trip, my-trips, or view-trip pages.
4. On trip creation: React → GlobalApi → Gemini API → returns itinerary → React renders via AIModal and UI components.
5. Display on view-trip: React → Google Maps API → map tiles & place details → React renders PlaceCardItem & HotelCardItem.
6. Data persistence: React → Firebase Auth (user sign-in/up) → Firestore (save and fetch user’s trips).
c. Architectural patterns & principles
• Component-based UI (React) with atomic/ui and custom layouts
• Service abstraction layer (GlobalApi, firebaseConfig) to decouple APIs from UI
• Feature folders for domain separation (create-trip, my-trips, view-trip)
• Static site generation/build (Vite) for performance and ease of deployment
d. Key technologies & frameworks
– React.js for frontend components and routing
– Vite for build & local dev server
– Tailwind CSS & PostCSS for styling
– Firebase SDK for Authentication & Firestore
– Gemini API & Google Maps API for business logic
– Netlify (netlify.toml) or Firebase Hosting for static deployment