# vihanga-vn/marinecenter_frontend architecture

> Architecture diagram of the GitHub repository vihanga-vn/marinecenter_frontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vihanga-vn/marinecenter_frontend
- Repository: https://github.com/vihanga-vn/marinecenter_frontend

## Overview

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: [`src/routes/AppRoutes.jsx`](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/routes/AppRoutes.jsx) (Route dispatch), [`src/services/categoryService.js`](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/services/categoryService.js) (Category service), [`src/pages/customer/ShopPage.jsx`](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/pages/customer/ShopPage.jsx) (Shop catalogue), [`src/services/productService.js`](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/services/productService.js) (Product service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Application routing"]
  node_app["React application<br/>[App.jsx]"]
  node_routes["Route dispatch<br/>[AppRoutes.jsx]"]
end

subgraph group_storefront["Customer storefront"]
  node_customer_layout["Customer layout<br/>[CustomerLayout.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
  node_home["Home page<br/>[HomePage.jsx]"]
  node_hero["Hero banner<br/>[HeroBanner.jsx]"]
  node_categories["Category carousel"]
  node_deals["Hot deals"]
  node_shop["Shop catalogue<br/>[ShopPage.jsx]"]
  node_filters["Shop filters"]
  node_product_card["Product card<br/>[ProductCard.jsx]"]
end

subgraph group_admin["Catalog administration"]
  node_admin_layout["Admin layout<br/>[AdminLayout.jsx]"]
  node_dashboard["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_product_admin["Product management"]
  node_category_admin["Category management"]
  node_image_field["Image upload field"]
end

subgraph group_data["API and utilities"]
  node_product_service["Product service<br/>[productService.js]"]
  node_category_service["Category service<br/>[categoryService.js]"]
  node_upload_service["Upload service<br/>[uploadService.js]"]
  node_api["Axios API client<br/>[api.js]"]
  node_product_utils["Product utilities<br/>[productUtils.js]"]
end

node_user(("Customer or admin"))
node_backend["Backend API"]

node_user -->|"opens"| node_app
node_app -->|"renders"| node_routes
node_routes -->|"routes customer"| node_customer_layout
node_routes -->|"routes home"| node_home
node_routes -->|"routes shop"| node_shop
node_routes -->|"routes admin"| node_admin_layout
node_routes -->|"routes dashboard"| node_dashboard
node_routes -->|"routes products"| node_product_admin
node_routes -->|"routes categories"| node_category_admin
node_customer_layout -->|"renders"| node_navbar
node_home -->|"renders"| node_hero
node_home -->|"renders"| node_categories
node_home -->|"renders"| node_deals
node_shop -->|"fetches products"| node_product_service
node_shop -->|"fetches categories"| node_category_service
node_shop -->|"renders"| node_filters
node_shop -->|"renders"| node_product_card
node_categories -->|"fetches categories"| node_category_service
node_deals -->|"fetches products"| node_product_service
node_deals -->|"selects products"| node_product_utils
node_deals -->|"renders"| node_product_card
node_product_card -->|"formats price"| node_product_utils
node_dashboard -->|"uses"| node_product_service
node_dashboard -->|"uses"| node_category_service
node_product_admin -->|"manages products"| node_product_service
node_product_admin -->|"loads categories"| node_category_service
node_product_admin -->|"renders"| node_image_field
node_category_admin -->|"manages categories"| node_category_service
node_category_admin -->|"renders"| node_image_field
node_image_field -->|"uploads image"| node_upload_service
node_product_service -->|"sends requests"| node_api
node_category_service -->|"sends requests"| node_api
node_upload_service -->|"sends upload"| node_api
node_api -->|"calls API"| node_backend

click node_app "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/App.jsx"
click node_routes "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/routes/AppRoutes.jsx"
click node_customer_layout "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/layouts/CustomerLayout.jsx"
click node_navbar "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/Navbar.jsx"
click node_home "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/pages/customer/HomePage.jsx"
click node_hero "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/HeroBanner.jsx"
click node_categories "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/CategoriesCarousel.jsx"
click node_deals "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/HotDealsSection.jsx"
click node_shop "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/pages/customer/ShopPage.jsx"
click node_filters "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/ShopSidebarFilter.jsx"
click node_product_card "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/ProductCard.jsx"
click node_admin_layout "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/layouts/AdminLayout.jsx"
click node_dashboard "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/pages/admin/AdminDashboard.jsx"
click node_product_admin "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/pages/admin/ProductManagement.jsx"
click node_category_admin "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/pages/admin/CategoryManagement.jsx"
click node_image_field "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/admin/ImageUploadField.jsx"
click node_product_service "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/services/productService.js"
click node_category_service "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/services/categoryService.js"
click node_upload_service "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/services/uploadService.js"
click node_api "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/services/api.js"
click node_product_utils "https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/utils/productUtils.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_routes toneBlue
class node_customer_layout,node_navbar,node_home,node_hero,node_categories,node_deals,node_shop,node_filters,node_product_card toneAmber
class node_admin_layout,node_dashboard,node_product_admin,node_category_admin,node_image_field,node_backend toneMint
class node_product_service,node_category_service,node_upload_service,node_api,node_product_utils toneRose
class node_user toneIndigo
```

## Components

### Application routing

- [React application](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/App.jsx): `src/App.jsx`
- [Route dispatch](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/routes/AppRoutes.jsx): `src/routes/AppRoutes.jsx`

### Customer storefront

- [Customer layout](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/layouts/CustomerLayout.jsx): `src/layouts/CustomerLayout.jsx`
- [Navigation bar](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Home page](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/pages/customer/HomePage.jsx): `src/pages/customer/HomePage.jsx`
- [Hero banner](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/HeroBanner.jsx): `src/components/HeroBanner.jsx`
- [Category carousel](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/CategoriesCarousel.jsx): `src/components/CategoriesCarousel.jsx`
- [Hot deals](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/HotDealsSection.jsx): `src/components/HotDealsSection.jsx`
- [Shop catalogue](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/pages/customer/ShopPage.jsx): `src/pages/customer/ShopPage.jsx`
- [Shop filters](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/ShopSidebarFilter.jsx): `src/components/ShopSidebarFilter.jsx`
- [Product card](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/ProductCard.jsx): `src/components/ProductCard.jsx`

### Catalog administration

- [Admin layout](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/layouts/AdminLayout.jsx): `src/layouts/AdminLayout.jsx`
- [Admin dashboard](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/pages/admin/AdminDashboard.jsx): `src/pages/admin/AdminDashboard.jsx`
- [Product management](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/pages/admin/ProductManagement.jsx): `src/pages/admin/ProductManagement.jsx`
- [Category management](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/pages/admin/CategoryManagement.jsx): `src/pages/admin/CategoryManagement.jsx`
- [Image upload field](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/components/admin/ImageUploadField.jsx): `src/components/admin/ImageUploadField.jsx`

### API and utilities

- [Product service](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/services/productService.js): `src/services/productService.js`
- [Category service](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/services/categoryService.js): `src/services/categoryService.js`
- [Upload service](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/services/uploadService.js): `src/services/uploadService.js`
- [Axios API client](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/services/api.js): `src/services/api.js`
- [Product utilities](https://github.com/vihanga-vn/marinecenter_frontend/blob/main/src/utils/productUtils.js): `src/utils/productUtils.js`

### Other components

- **Customer or admin**
- **Backend API**

## Connections

- Customer or admin → React application: opens
- React application → Route dispatch: renders (evidence: `src/App.jsx`)
- Route dispatch → Customer layout: routes customer (evidence: `src/routes/AppRoutes.jsx`)
- Route dispatch → Home page: routes home (evidence: `src/routes/AppRoutes.jsx`)
- Route dispatch → Shop catalogue: routes shop (evidence: `src/routes/AppRoutes.jsx`)
- Route dispatch → Admin layout: routes admin (evidence: `src/routes/AppRoutes.jsx`)
- Route dispatch → Admin dashboard: routes dashboard (evidence: `src/routes/AppRoutes.jsx`)
- Route dispatch → Product management: routes products (evidence: `src/routes/AppRoutes.jsx`)
- Route dispatch → Category management: routes categories (evidence: `src/routes/AppRoutes.jsx`)
- Customer layout → Navigation bar: renders (evidence: `src/layouts/CustomerLayout.jsx`)
- Home page → Hero banner: renders (evidence: `src/pages/customer/HomePage.jsx`)
- Home page → Category carousel: renders (evidence: `src/pages/customer/HomePage.jsx`)
- Home page → Hot deals: renders (evidence: `src/pages/customer/HomePage.jsx`)
- Shop catalogue → Product service: fetches products (evidence: `src/pages/customer/ShopPage.jsx`)
- Shop catalogue → Category service: fetches categories (evidence: `src/pages/customer/ShopPage.jsx`)
- Shop catalogue → Shop filters: renders (evidence: `src/pages/customer/ShopPage.jsx`)
- Shop catalogue → Product card: renders (evidence: `src/pages/customer/ShopPage.jsx`)
- Category carousel → Category service: fetches categories (evidence: `src/components/CategoriesCarousel.jsx`)
- Hot deals → Product service: fetches products (evidence: `src/components/HotDealsSection.jsx`)
- Hot deals → Product utilities: selects products (evidence: `src/components/HotDealsSection.jsx`)
- Hot deals → Product card: renders (evidence: `src/components/HotDealsSection.jsx`)
- Product card → Product utilities: formats price (evidence: `src/components/ProductCard.jsx`)
- Admin dashboard → Product service: uses (evidence: `src/pages/admin/AdminDashboard.jsx`)
- Admin dashboard → Category service: uses (evidence: `src/pages/admin/AdminDashboard.jsx`)
- Product management → Product service: manages products (evidence: `src/pages/admin/ProductManagement.jsx`)
- Product management → Category service: loads categories (evidence: `src/pages/admin/ProductManagement.jsx`)
- Product management → Image upload field: renders (evidence: `src/pages/admin/ProductManagement.jsx`)
- Category management → Category service: manages categories (evidence: `src/pages/admin/CategoryManagement.jsx`)
- Category management → Image upload field: renders (evidence: `src/pages/admin/CategoryManagement.jsx`)
- Image upload field → Upload service: uploads image (evidence: `src/components/admin/ImageUploadField.jsx`)
- Product service → Axios API client: sends requests (evidence: `src/services/productService.js`)
- Category service → Axios API client: sends requests (evidence: `src/services/categoryService.js`)
- Upload service → Axios API client: sends upload (evidence: `src/services/uploadService.js`)
- Axios API client → Backend API: calls API (evidence: `src/services/api.js`)
