How elamaimhamza/ecomsiteweb works
Project type and purpose
• This is a front-end single-page application (SPA) built with React + Vite (no backend code in this repo).
• Its goal is to deliver a catalog and user-driven flows (login, register, product browsing, cart) by consuming external REST APIs via Axios.
File structure
• Top-level: Vite config (vite.config.js), PostCSS & Tailwind configs, package.json (frontend dependencies).
• public/: static assets (logos).
• src/: application source
– main.jsx: React entrypoint
– index.css: global styles (Tailwind directives)
– api/axios.js: centralized HTTP client
– lib/utils.js: shared helper functions
– context/: React Context providers (AuthContext, ProtectedRoute)
– layouts/Layout.jsx: application shell (header, nav, footer)
– components/: reusable UI building blocks (badge, button, card, etc.) and composite components (cart.jsx)
– pages/: route targets (Home, Products, ProductView, Login, Register, Profile, Users, NotFound)
• jsconfig.json: path aliases, IDE hints
• eslint.config.js: lint rules
README
• Confirms minimal React + Vite setup
• Mentions HMR via @vitejs/plugin-react and ESLint
• No server side—client only SPA
Detailed but focused guidance
• Data flow direction: user → UI → API → external service → UI update.
• Critical paths: auth token injection, route protection.
Layer 1: Tooling & Build
Layer 2: Entry & Routing
Layer 3: UI & Logic
Layer 4: External dependencies