How rip-skillan/scrape-expectations works
Purpose and runtime topology
Scrape-Expectations is a product-search and price-comparison application. A React/Vite browser client submits product queries to a Node.js backend, which is responsible for Bright Data scraping/API calls; returned product data is displayed, sorted, and optionally organized into user-managed lists. Primary runtime entry points are frontend/src/main.jsx and backend/server.js.
Frontend application shell
frontend/src/main.jsx mounts the React application, while frontend/src/App.jsx owns top-level application composition and navigation between search and list-management views. Styling is centralized in frontend/src/App.css and frontend/src/index.css; the UI is a client-rendered Vite application, served during development through frontend/vite.config.js.
Search and aggregation flow
The search UI begins in frontend/src/components/SearchBar.jsx. Search state and result presentation converge in frontend/src/components/Dashboard.jsx, which renders product result cards through frontend/src/components/ProductCard.jsx. The intended control flow is: user query → frontend request to backend → backend Bright Data integration → normalized product results → dashboard/card display. Failure or unavailable-result states are represented by frontend/src/components/NotFound.jsx.
Backend scraping boundary
backend/server.js is the server-side integration boundary for Bright Data. It isolates external scraping/API traffic from the browser, likely handling query forwarding and response shaping before product data reaches the frontend. backend/package.json defines the Node runtime dependencies and scripts. Bright Data is the principal external service and should remain behind this backend boundary rather than be invoked directly by UI components.
Result sorting and display controls
Result ordering is separated from rendering in frontend/src/hooks/sortProducts.js, supporting price and source ordering. frontend/src/components/SortDropdown.jsx exposes the sorting controls, with a custom presentation option in frontend/src/components/CustomSortDropdown.css. Dashboard.jsx is the integration point that combines search results, selected sort mode, and card rendering.
Product-list management
Saved-product organization is a client-side feature centered on frontend/src/hooks/useLists.js, which encapsulates list CRUD and storage behavior. frontend/src/components/SaveToListButton.jsx attaches search-result products to lists. frontend/src/pages/ListsPage.jsx provides collection-level list management, and frontend/src/pages/ListDetailPage.jsx manages/view edits for products within a selected list. This is distinct from the scraping pipeline and appears to use frontend-managed persistence rather than a dedicated backend data store.
Navigation and user-facing boundaries
frontend/src/components/Navbar.jsx switches users between the search/dashboard experience and saved-list pages. The main architectural boundaries are: browser UI and local list state in frontend/src; server-side scraping orchestration in backend/server.js; and Bright Data as the external product-data acquisition service.
Main entry points: Dashboard.jsx Search dashboard · App.jsx App shell · ListsPage.jsx Lists page · Navbar.jsx Navigation
Components 15
Browser client
React/Vite UI and client-managed saved lists.
- React entry
frontend/src/main.jsx - App shell · Owns top-level view composition and navigation.
frontend/src/App.jsx - Navigation
frontend/src/components/Navbar.jsx - Search bar
frontend/src/components/SearchBar.jsx - Search dashboard · Combines results, sorting, and product cards.
frontend/src/components/Dashboard.jsx - Product sorting · Orders results by price or source.
frontend/src/hooks/sortProducts.js - Sort controls
frontend/src/components/SortDropdown.jsx - Product card
frontend/src/components/ProductCard.jsx - Empty/error state
frontend/src/components/NotFound.jsx - Saved lists state · Encapsulates list CRUD and client-side storage.
frontend/src/hooks/useLists.js - Save to list
frontend/src/components/SaveToListButton.jsx - Lists page
frontend/src/pages/ListsPage.jsx - List detail · Views and edits products in a selected list.
frontend/src/pages/ListDetailPage.jsx
Scraping backend
Node boundary for external product acquisition.
- Scraping server · Forwards queries, isolates Bright Data traffic, and shapes product results.
backend/server.js
Other components
- Bright Data · External product-data acquisition service.
Connections 20
- React entry → App shell: mounts
- App shell → Navigation: renders
- App shell → Search dashboard: shows search view
- App shell → Lists page: shows list views
- Navigation → Search dashboard: navigates
- Navigation → Lists page: navigates
- Search bar → Scraping server: submits query
- Scraping server → Bright Data: scrapes / calls API
- Scraping server → Search dashboard: normalized results
- Search dashboard → Search bar: hosts query UI
- Search dashboard → Product sorting: orders results
- Sort controls → Product sorting: selects mode
- Search dashboard → Sort controls: renders
- Search dashboard → Product card: renders results
- Search dashboard → Empty/error state: renders unavailable state
- Product card → Save to list: offers save action
- Save to list → Saved lists state: adds product
- Lists page → Saved lists state: manages collections
- Lists page → List detail: opens list
- List detail → Saved lists state: edits products