How drago-03/price-pilot works
Project type and purpose
• From the file tree and README, Price Pilot is a single-page, front-end web application (React + TypeScript) that runs entirely in the browser.
• Purpose: provide real-time ride-hailing price comparisons (Uber, Ola, Rapido), show routes on Google Maps, and redirect users for booking.
File structure
• Top-level config & tooling:
• package.json, tsconfig*.json, vite.config.ts, tailwind.config.js, eslint.config.js
• .env for API keys, CI workflow under .github/workflows
• Public & assets:
• index.html, public/images, assets/images
• src/:
• App.tsx & main.tsx as entry points
• components/: UI building blocks (Map, About, Contact, HowItWorks, Team, Footer)
• index.css for base styles
• No custom backend code—services live in-browser via external HTTP calls.
README for additional insights
• Tech stack: React 18, TS 5.0+, Tailwind CSS, React Context API, Vite.
• External integrations:
• Google Maps JavaScript & Places & Directions & Geocoding APIs
• Ride-service APIs: Uber Rides API, Ola API, (implied Rapido)
• State: managed client-side with Context.
• Testing: Jest + React Testing Library.
Components
a. Main components
• Browser / Client
• React Application:
• UI Layer (components folder)
• State Layer (React Context)
• Service Layer (API‐calling functions)
• External Services:
• Google Maps Platform (Maps JS, Directions, Places, Geocoding)
• Ride Providers (Uber, Ola, Rapido APIs)
• Build & Deployment: Vite → dist → Vercel/Netlify/GitHub Pages
b. Relationships & interactions
• User interacts with UI → Context stores origin/destination → Service Layer issues HTTP calls → External Services respond with location, route, price data → Context updates state → UI updates Map & price list → Booking button triggers redirect to provider.
• Dev pipeline: Code → Vite builds → CI runs lint/tests → Deploy to hosting.
c. Architectural patterns & design principles
• Component-driven architecture (Atomic UI)
• Unidirectional data flow (React Context → props)
• Separation of concerns: UI vs. state vs. side-effects (API calls)
• Responsive design (Tailwind + mobile-first)
d. Key technologies & libraries
• React 18 + TypeScript + React Context API
• Google Maps Platform (JS, Places, Directions, Geocoding)
• Uber/Ola/Rapido REST APIs
• Vite build tool, Tailwind CSS, ESLint, Jest
Essential elements—don’t overcomplicate
• Environment variables store (.env) feeding into build.