How vihanga-vn/marinecenter_frontend works
This is a marine spare-parts storefront and administration frontend. Customers enter the shop or home page, browse active products and categories, and view product cards; administrators manage inventory and categories through separate routes. Admin forms can upload images or supply image URLs. Service modules make API requests to a backend, which is external to this repository. The graph follows explicit route and call references; several component relationships are supported by the source index rather than inspected excerpts, and unsampled details are omitted.
Main entry points: AppRoutes.jsx Route dispatch · categoryService.js Category service · ShopPage.jsx Shop catalogue · productService.js Product service
Components 23
Application routing
- React application
src/App.jsx - Route dispatch
src/routes/AppRoutes.jsx
Customer storefront
- Customer layout
src/layouts/CustomerLayout.jsx - Navigation bar
src/components/Navbar.jsx - Home page
src/pages/customer/HomePage.jsx - Hero banner
src/components/HeroBanner.jsx - Category carousel
src/components/CategoriesCarousel.jsx - Hot deals
src/components/HotDealsSection.jsx - Shop catalogue
src/pages/customer/ShopPage.jsx - Shop filters
src/components/ShopSidebarFilter.jsx - Product card
src/components/ProductCard.jsx
Catalog administration
- Admin layout
src/layouts/AdminLayout.jsx - Admin dashboard
src/pages/admin/AdminDashboard.jsx - Product management
src/pages/admin/ProductManagement.jsx - Category management
src/pages/admin/CategoryManagement.jsx - Image upload field
src/components/admin/ImageUploadField.jsx
API and utilities
- Product service
src/services/productService.js - Category service
src/services/categoryService.js - Upload service
src/services/uploadService.js - Axios API client
src/services/api.js - Product utilities
src/utils/productUtils.js
Other components
- Customer or admin
- Backend API
Connections 34
- Customer or admin → React application: opens
- React application → Route dispatch: renders
src/App.jsx - Route dispatch → Customer layout: routes customer
src/routes/AppRoutes.jsx - Route dispatch → Home page: routes home
src/routes/AppRoutes.jsx - Route dispatch → Shop catalogue: routes shop
src/routes/AppRoutes.jsx - Route dispatch → Admin layout: routes admin
src/routes/AppRoutes.jsx - Route dispatch → Admin dashboard: routes dashboard
src/routes/AppRoutes.jsx - Route dispatch → Product management: routes products
src/routes/AppRoutes.jsx - Route dispatch → Category management: routes categories
src/routes/AppRoutes.jsx - Customer layout → Navigation bar: renders
src/layouts/CustomerLayout.jsx - Home page → Hero banner: renders
src/pages/customer/HomePage.jsx - Home page → Category carousel: renders
src/pages/customer/HomePage.jsx - Home page → Hot deals: renders
src/pages/customer/HomePage.jsx - Shop catalogue → Product service: fetches products
src/pages/customer/ShopPage.jsx - Shop catalogue → Category service: fetches categories
src/pages/customer/ShopPage.jsx - Shop catalogue → Shop filters: renders
src/pages/customer/ShopPage.jsx - Shop catalogue → Product card: renders
src/pages/customer/ShopPage.jsx - Category carousel → Category service: fetches categories
src/components/CategoriesCarousel.jsx - Hot deals → Product service: fetches products
src/components/HotDealsSection.jsx - Hot deals → Product utilities: selects products
src/components/HotDealsSection.jsx - Hot deals → Product card: renders
src/components/HotDealsSection.jsx - Product card → Product utilities: formats price
src/components/ProductCard.jsx - Admin dashboard → Product service: uses
src/pages/admin/AdminDashboard.jsx - Admin dashboard → Category service: uses
src/pages/admin/AdminDashboard.jsx - Product management → Product service: manages products
src/pages/admin/ProductManagement.jsx - Product management → Category service: loads categories
src/pages/admin/ProductManagement.jsx - Product management → Image upload field: renders
src/pages/admin/ProductManagement.jsx - Category management → Category service: manages categories
src/pages/admin/CategoryManagement.jsx - Category management → Image upload field: renders
src/pages/admin/CategoryManagement.jsx - Image upload field → Upload service: uploads image
src/components/admin/ImageUploadField.jsx - Product service → Axios API client: sends requests
src/services/productService.js - Category service → Axios API client: sends requests
src/services/categoryService.js - Upload service → Axios API client: sends upload
src/services/uploadService.js - Axios API client → Backend API: calls API
src/services/api.js