How techieviveksharma/e-commerce-store works
Main Components
• Development & Build Tooling
• Vite (vite.config.js)
• ESLint (eslint.config.js)
• PostCSS & Tailwind (postcss.config.js, tailwind.config.js)
• Entry Point & Static Assets
• index.html (root HTML)
• public/ (favicon, static files)
• Application Bootstrapping
• src/main.jsx (mounts React into DOM)
• src/index.css (global styles)
• Core App
• src/App.jsx (root component, sets up routing & context)
• src/utils/Context.jsx (React Context provider & global state)
• src/utils/axios.jsx (preconfigured Axios instance for API calls)
• UI Components
• Nav.jsx (navigation bar)
• Home.jsx, Create.jsx, Details.jsx, Edit.jsx (feature pages)
• Loading.jsx (shared spinner/loading state)
Relationships & Data Flow
• Startup Flow:
1. User requests the SPA in the browser → served by Vite dev server or built static files.
2. index.html loads → src/main.jsx executes → React renders <App /> into #root.
• Application Flow:
1. <App /> wraps all routes in Context provider (src/utils/Context).
2. Pages/components call the Axios instance (src/utils/axios) to fetch/persist data to an external API.
3. Responses update Context state → consumed by components (Home, Details, etc.).
• Build & HMR:
• Vite watches source files → on change, does Hot Module Replacement via @vitejs/plugin-react.
• ESLint ensures code quality during development.
• Tailwind processes CSS classes at build time via PostCSS.
Architectural Patterns
• SPA / Component‑Based: clear separation of pages & shared UI.
• Context API: central state management without external libraries.
• API Service Layer: Axios wrapper abstracts HTTP calls.
• Build Pipeline: Vite + plugins enable fast refresh, linting, CSS utility processing.
Checklist
• Config files and key dependencies near their respective tools/libraries.