How 2024uch1376-spec/blinkit-clone works
Purpose and runtime
This is a Vite-served React single-page front-end that recreates a Blinkit-style quick-commerce flow. It uses React Router for page navigation, Tailwind/CSS for presentation and animations, FontAwesome icons, static assets, and local mock data; no backend, database, or real payment/location service is represented.
Bootstrap and application shell
• src/main.jsx mounts the React application into the browser.
• src/App.jsx is the central composition and state boundary: it configures routes and coordinates cross-cutting UI/business state such as cart, authentication, wallet, location, modal visibility, and order behavior.
• app.js and index.html are root-level browser/application artifacts; Vite configuration is in vite.config.js.
Catalog and discovery
The product catalog is local mock data in src/data/products.js. Home and category experiences render that data through reusable catalog surfaces:
• src/pages/Home.jsx
• src/pages/CategoryDetail.jsx
• src/components/CategoryGrid.jsx
• src/components/CategorySlider.jsx
• src/components/ProductGrid.jsx
• src/components/ProductCard.jsx
Search input flows from the header into filtered product suggestions via src/components/SearchAutocompleteDropdown.jsx; product selection can open src/components/ProductDetailModal.jsx.
Cart and checkout flow
Product add actions update application-level cart state, then drive several coordinated views:
• src/components/CartFlyOverlay.jsx provides add-to-cart animation feedback.
• src/components/CartDrawer.jsx exposes the active cart, quantities, pricing, fees, coupons, and order summary.
• src/pages/CartPage.jsx provides the dedicated cart route.
• src/components/CheckoutModal.jsx finalizes the simulated purchase flow.
Checkout is a front-end state transition: coupon validation, totals, wallet/payment decisions, and resulting order records are simulated rather than sent to external APIs.
Identity, location, and customer state
The header is the primary global interaction surface:
• src/components/Header.jsx
• src/components/LoginModal.jsx
• src/components/LocationSearchModal.jsx
Login uses simulated mobile OTP behavior. Location search simulates GPS/address selection. These states gate or personalize checkout, wallet, and order-history experiences but have no indicated persistence or external authentication/geocoding boundary.
Post-purchase and account areas
Account-oriented routes consume the app’s simulated user, order, and financial state:
• src/pages/OrderHistory.jsx presents orders and delivery status progression.
• src/pages/Wallet.jsx presents balance, promotional credit, cashback, and transactions.
• src/pages/Favorites.jsx manages saved products.
• src/pages/Support.jsx is the customer-support interaction surface.
src/components/Footer.jsx supplies shared navigation/context around these routes.
Presentation and assets
The design system is primarily Tailwind plus custom global styles:
• src/index.css
• tailwind.config.js
• postcss.config.js
Static imagery is served from public/images and images. The main architectural boundary is therefore browser-local React state and mock catalog data versus UI components/pages; the repository does not expose server-side APIs, persistence, payment processing, or deployed infrastructure.
Main entry points: App.jsx App state & routes · CheckoutModal.jsx Checkout modal · CartDrawer.jsx Cart views · ProductGrid.jsx Catalog surfaces
Components 21
Browser runtime
- Vite app host · Serves the browser SPA.
vite.config.js - React entry
src/main.jsx - App state & routes · Central boundary for cart, identity, wallet, location, modals, and orders.
src/App.jsx - Header
src/components/Header.jsx
Catalog & discovery
- Mock product catalog
src/data/products.js - Home
src/pages/Home.jsx - Category detail
src/pages/CategoryDetail.jsx - Catalog surfaces · Category grids, sliders, product grid, and product cards.
src/components/ProductGrid.jsx - Search autocomplete
src/components/SearchAutocompleteDropdown.jsx - Product detail modal
src/components/ProductDetailModal.jsx
Cart & checkout
- Cart views · Drawer and dedicated cart route expose quantities, pricing, fees, and coupons.
src/components/CartDrawer.jsx - Cart fly overlay
src/components/CartFlyOverlay.jsx - Checkout modal · Calculates payment decisions and creates local orders.
src/components/CheckoutModal.jsx
Customer state
- Login & location modals · Simulates OTP login and GPS/address selection.
src/components/LoginModal.jsx - Order history · Displays locally simulated orders and delivery progression.
src/pages/OrderHistory.jsx - Wallet
src/pages/Wallet.jsx - Favorites
src/pages/Favorites.jsx - Support
src/pages/Support.jsx
Presentation
- Footer
src/components/Footer.jsx - Global styles
src/index.css - Static imagery
public/images
Connections 29
- Vite app host → React entry: serves
- React entry → App state & routes: mounts
- App state & routes → Header: renders
- App state & routes → Home: routes to
- App state & routes → Category detail: routes to
- App state & routes → Cart views: coordinates cart state
- App state & routes → Checkout modal: controls modal
- App state & routes → Login & location modals: controls identity/location
- App state & routes → Order history: provides order state
- App state & routes → Wallet: provides wallet state
- App state & routes → Favorites: provides saved products
- App state & routes → Support: routes to
- App state & routes → Footer: renders
- Mock product catalog → Home: supplies products
- Mock product catalog → Category detail: supplies products
- Mock product catalog → Search autocomplete: filters
- Home → Catalog surfaces: renders
- Category detail → Catalog surfaces: renders
- Header → Search autocomplete: passes search input
- Search autocomplete → Product detail modal: selects product
- Catalog surfaces → Product detail modal: opens product
- Product detail modal → Cart views: adds item
- Cart views → Cart fly overlay: triggers feedback
- Cart views → Checkout modal: starts checkout
- Login & location modals → Checkout modal: gates/personalizes
- Checkout modal → Order history: creates local order
- Checkout modal → Wallet: uses local wallet state
- Global styles → App state & routes: styles UI
- Static imagery → Catalog surfaces: product imagery