How quangvinh14072006/zingshop works
This is a storefront with a React web client and a Laravel backend. The visible customer journey is route selection into home, product-list, and product-detail pages; cart, login, and registration are separate routes. The backend exposes product listing and detail controller actions and defines user, cart, product, and order domain models. The sampled files do not show checkout, authentication API calls, or how the frontend fetches backend data, so those connections are not asserted. Several frontend page capabilities are represented from the route map and source index rather than inspected implementations.
Main entry points: AppRoutes.jsx Page routes · Product.php Products · Order.php Orders · OrderItem.php Order items
Components 26
Web client
- Client app
frontend/src/App.jsx - Auth state
frontend/src/contexts/AuthContext.jsx - Page routes
frontend/src/routes/AppRoutes.jsx - Main layout
frontend/src/layouts/MainLayout.jsx - Home page
frontend/src/pages/HomePage.jsx - Product listing
frontend/src/pages/ProductsPage.jsx - Product detail
frontend/src/pages/ProductDetailPage.jsx - Cart page
frontend/src/pages/CartPage.jsx - Login page
frontend/src/pages/LoginPage.jsx - Registration page
frontend/src/pages/RegisterPage.jsx - Not found
frontend/src/pages/NotFoundPage.jsx - HTTP client
frontend/src/services/axiosClient.js
Product catalog
- Product API
backend/app/Http/Controllers/Api/ProductController.php - Products
backend/app/Models/Product.php - Categories
backend/app/Models/Category.php
Commerce domain
- Users
backend/app/Models/User.php - Carts
backend/app/Models/Cart.php - Cart items
backend/app/Models/CartItem.php - Orders
backend/app/Models/Order.php - Order items
backend/app/Models/OrderItem.php
Backend routing
- Backend bootstrap
backend/bootstrap/app.php - Web routes
backend/routes/web.php - API routes
backend/routes/api.php
Other components
- Shopper
- Browser
- API caller
Connections 29
- Shopper → Browser: uses
- Browser → Client app: opens
- Client app → Auth state: provides state
frontend/src/App.jsx - Client app → Page routes: renders
frontend/src/App.jsx - Page routes → Main layout: routes to
frontend/src/routes/AppRoutes.jsx - Page routes → Home page: routes to
frontend/src/routes/AppRoutes.jsx - Page routes → Product listing: routes to
frontend/src/routes/AppRoutes.jsx - Page routes → Product detail: routes to
frontend/src/routes/AppRoutes.jsx - Page routes → Cart page: routes to
frontend/src/routes/AppRoutes.jsx - Page routes → Login page: routes to
frontend/src/routes/AppRoutes.jsx - Page routes → Registration page: routes to
frontend/src/routes/AppRoutes.jsx - Page routes → Not found: routes to
frontend/src/routes/AppRoutes.jsx - Main layout → Auth state: reads state
frontend/src/layouts/MainLayout.jsx - API caller → API routes: requests
- Backend bootstrap → Web routes: loads routes
backend/bootstrap/app.php - Backend bootstrap → API routes: loads routes
backend/bootstrap/app.php - Web routes → Product API: references
backend/routes/web.php - Product API → Products: queries
backend/app/Http/Controllers/Api/ProductController.php - Products → Categories: belongs to
backend/app/Models/Product.php - Products → Cart items: has many
backend/app/Models/Product.php - Products → Order items: has many
backend/app/Models/Product.php - Users → Carts: has one
backend/app/Models/User.php - Users → Orders: has many
backend/app/Models/User.php - Cart items → Carts: belongs to
backend/app/Models/CartItem.php - Cart items → Products: belongs to
backend/app/Models/CartItem.php - Orders → Users: belongs to
backend/app/Models/Order.php - Orders → Order items: has many
backend/app/Models/Order.php - Order items → Orders: belongs to
backend/app/Models/OrderItem.php - Order items → Products: belongs to
backend/app/Models/OrderItem.php