How anand-nayak-git/price-comparision-system works
PriceCompare is a product-price comparison app: shoppers browse or search products, inspect vendor offers and lowest prices, and can view comparisons and recommendations. The React client has home and comparison pages; the Express API serves product, search, vendor, and recommendation features. Server-side pricing generates offers for five named retailers, while product/search data can come from MongoDB or local JSON. The sampled code shows generated price estimates, not retailer price scraping. Some client and route implementations were not sampled, so uncertain wiring is omitted.
Main entry points: searchController.js Search handling · universalPriceEngine.js Offer generation · HomePage.jsx Home page · app.js Express app
Components 27
Shopper interface
- React app
client/src/App.jsx - Home page
client/src/pages/HomePage.jsx - Comparison page
client/src/pages/ComparisonPage.jsx - Category filter
client/src/components/CategoryFilter.jsx - Product card
client/src/components/ProductCard.jsx - Recommendation card
client/src/components/RecommendationCard.jsx - API client
client/src/services/api.js
API workflows
- Express app
server/app.js - Product routes
server/routes/productRoutes.js - Search routes
server/routes/searchRoutes.js - Recommendation routes
server/routes/recommendationRoutes.js - Vendor routes
server/routes/vendorRoutes.js - Product handling
server/controllers/productController.js - Search handling
server/controllers/searchController.js - Vendor handling
server/controllers/vendorController.js
Offer and discovery logic
- Smart search
server/utils/searchEngine.js - Live query offers
server/services/liveSearchService.js - Offer generation
server/utils/universalPriceEngine.js - Recommendations
server/utils/recommendationEngine.js - Vendor catalog
server/utils/vendorCatalog.js - Reference prices
server/utils/priceCatalog.js - Image resolver
server/utils/imageResolver.js
Product data
- Product model
server/models/Product.js - Vendor model
server/models/Vendor.js - Product fallback
data.json
Other components
- Shopper
- MongoDB
Connections 33
- Shopper → React app: uses
- React app → Home page: routes to
- React app → Comparison page: routes to
- Home page → Category filter: offers filtering
- Home page → Product card: shows products
- Home page → Recommendation card: shows suggestions
- Home page → API client: requests data
- Comparison page → API client: requests comparison
- API client → Express app: calls API
- Express app → Product routes: dispatches
- Express app → Search routes: dispatches
- Express app → Recommendation routes: dispatches
- Express app → Vendor routes: dispatches
- Product routes → Product handling: dispatches
- Search routes → Search handling: dispatches
- Recommendation routes → Search handling: dispatches
- Vendor routes → Vendor handling: dispatches
- Product handling → Product model: queries
- Product handling → Product fallback: fallback reads
- Product handling → Offer generation: generates offers
- Search handling → Product model: loads products
- Search handling → Product fallback: fallback reads
- Search handling → Smart search: searches products
- Search handling → Live query offers: falls back to
- Search handling → Recommendations: requests suggestions
- Live query offers → Offer generation: generates offers
- Live query offers → Product model: caches offers
- Recommendations → Smart search: groups products
- Recommendations → Offer generation: refreshes offers
- Offer generation → Reference prices: looks up prices
- Offer generation → Vendor catalog: selects vendors
- Offer generation → Image resolver: resolves image
- Vendor handling → Vendor model: queries vendors