How hainam1408/interlux-fe works
Project type and purpose
• This is a front-end single-page e-commerce application built with React, TypeScript, and Vite.
• It provides product listing, product detail, cart management, authentication, chat-bot support, and 3D model viewing (GLB files under public/models).
• It consumes RESTful APIs (auth, cart, category, chatbot, product) exposed by a back-end or microservices.
File structure
• Top-level:
· public/ – static assets and 3D models
· src/
– src/main.tsx, App.tsx – application entry point
– src/pages/… – page-level components (landing, layout, login, products, product-detail)
– src/components/… – reusable UI components (buttons, inputs, chat-bot, loading screens, etc.)
– src/apis/… – API wrappers for each REST endpoint
– src/redux/… – Redux slices and store setup
– src/routes/router-container.tsx – client routing layer
– src/hooks, src/utils – custom hooks and HTTP utility
– src/themes, src/constants, src/configs – theming, constants, and route layouts
• Configuration files: vite.config.ts, tsconfig*.json, eslint.config.js, package.json
Key technical stack from README
• React 18 + TypeScript + Vite for fast HMR builds
• ESLint (with recommended and type-checked rules)
• SWC/Babel plugin for React Fast Refresh
Main components
a. Client SPA (browser)
• Vite-built JS bundle (App.tsx + pages + components)
• Static assets (images, videos, GLB 3D models served from CDN or static hosting)
b. API Gateway / Backend services
• Auth Service (login/register endpoints)
• Product Service (list, detail)
• Category Service
• Cart Service
• Chatbot Service (possibly backed by an AI engine)
c. Data stores
• Relational or NoSQL DB for users, products, categories, carts, orders
d. External services
• CDN (for static assets & 3D models)
• Third-party Chatbot / AI API
e. Redux store (client-side state)
f. Client Router (routes → pages)
Relationships & interactions
• The browser loads index.html → main.tsx → hydrates App.
• Client Router directs to pages.
• Pages/components call src/apis/*.api.ts → fetch() → API Gateway.
• API Gateway forwards to microservices.
• Microservices read/write to shared DB.
• Payment service callbacks update Order status.
• Chatbot UI ↔ Chatbot Service ↔ AI API.
• Static assets (models/videos/images) served from CDN/public.
Architectural patterns & principles
• SPA with clear separation of concerns: presentation (components/pages) vs. data-access (api wrappers) vs. state (Redux).
• Feature folders: grouping by page and component domain.
• Unidirectional data flow: React → Redux → API → Redux.
• Thematic styling: global theme + CSS/SCSS modules.
• Client-side routing (React Router).