# devtres/autofix-hub architecture

> Architecture diagram of the GitHub repository devtres/autofix-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/devtres/autofix-hub
- Repository: https://github.com/devtres/autofix-hub

## Overview

AutoFix Hub is a prototype storefront for automotive and motorcycle parts, with customer browsing, cart, demo checkout, order lookup/history, and an admin area. The main customer flow routes through the React app to browse products, build a cart, save an order in browser storage, and view confirmation or tracking. The README describes a planned Express/MySQL backend and broader admin capabilities, but the sampled checkout and tracking code use browser-local data; no client-to-API calls were shown.

Main entry points: [`client/src/App.jsx`](https://github.com/devtres/autofix-hub/blob/main/client/src/App.jsx) (Route application), [`client/src/utils/orders.js`](https://github.com/devtres/autofix-hub/blob/main/client/src/utils/orders.js) (Order creation and storage), [`client/src/pages/store/Checkout.jsx`](https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/Checkout.jsx) (Checkout), [`client/src/pages/store/TrackOrder.jsx`](https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/TrackOrder.jsx) (Order tracking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["Route application<br/>[App.jsx]"]
  node_store_layout["Store layout<br/>[StoreLayout.jsx]"]
  node_catalog["Product catalog<br/>[Home.jsx]"]
  node_product_detail["Product detail<br/>[ProductDetail.jsx]"]
  node_product_data["Product data<br/>[products.js]"]
  node_product_card["Product card<br/>[ProductCard.jsx]"]
end

subgraph group_orders["Cart and Orders"]
  node_cart["Cart and wishlist<br/>[CartContext.jsx]"]
  node_cart_drawer["Cart drawer<br/>[CartDrawer.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_order_logic["Order creation and storage<br/>[orders.js]"]
  node_order_confirmation["Order confirmation"]
  node_order_history["Order history<br/>[OrderHistory.jsx]"]
  node_tracking["Order tracking<br/>[TrackOrder.jsx]"]
  node_locations["Philippine locations and routes"]
end

subgraph group_admin["Admin"]
  node_admin_layout["Admin layout<br/>[AdminLayout.jsx]"]
  node_admin_products["Product management demo<br/>[Products.jsx]"]
  node_admin_capabilities["Admin operations"]
end

subgraph group_backend["Backend and Data"]
  node_api["Express API<br/>[index.js]"]
  node_db_pool["MySQL connection pool<br/>[db.js]"]
  node_schema["Database schema<br/>[schema.sql]"]
  node_seed["Seed data<br/>[seed.sql]"]
  node_db_views["Views and indexes"]
end

node_customer(("Customer"))
node_admin_user(("Admin user"))
node_map_tiles["OpenStreetMap tiles"]

node_customer -->|"uses storefront"| node_app
node_admin_user -->|"uses admin"| node_app
node_app -->|"routes to"| node_store_layout
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_product_detail
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_order_confirmation
node_app -->|"routes to"| node_order_history
node_app -->|"routes to"| node_tracking
node_app -->|"routes to"| node_admin_layout
node_app -->|"routes to"| node_admin_products
node_app -->|"routes to"| node_admin_capabilities
node_catalog -->|"reads"| node_product_data
node_catalog -->|"renders"| node_product_card
node_product_detail -->|"reads"| node_product_data
node_product_detail -->|"renders"| node_product_card
node_product_card -->|"updates"| node_cart
node_store_layout -->|"renders"| node_cart_drawer
node_cart_drawer -->|"reads and updates"| node_cart
node_checkout -->|"reads and clears"| node_cart
node_checkout -->|"creates and saves"| node_order_logic
node_checkout -->|"reads options"| node_locations
node_order_confirmation -->|"reads saved orders"| node_order_logic
node_order_history -->|"reads saved orders"| node_order_logic
node_tracking -->|"reads saved orders"| node_order_logic
node_tracking -->|"uses route helper"| node_locations
node_order_logic -->|"builds delivery route"| node_locations
node_tracking -->|"loads map tiles"| node_map_tiles
node_admin_products -.->|"implements product subset"| node_admin_capabilities
node_api -->|"uses pool"| node_db_pool
node_api -.->|"uses database"| node_schema
node_schema -.->|"initialized with"| node_seed
node_schema -.->|"extended by"| node_db_views
node_db_pool -.->|"connects to MySQL"| node_schema

click node_app "https://github.com/devtres/autofix-hub/blob/main/client/src/App.jsx"
click node_store_layout "https://github.com/devtres/autofix-hub/blob/main/client/src/layouts/StoreLayout.jsx"
click node_catalog "https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/Home.jsx"
click node_product_detail "https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/ProductDetail.jsx"
click node_product_data "https://github.com/devtres/autofix-hub/blob/main/client/src/data/products.js"
click node_product_card "https://github.com/devtres/autofix-hub/blob/main/client/src/components/store/ProductCard.jsx"
click node_cart "https://github.com/devtres/autofix-hub/blob/main/client/src/context/CartContext.jsx"
click node_cart_drawer "https://github.com/devtres/autofix-hub/blob/main/client/src/components/store/CartDrawer.jsx"
click node_checkout "https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/Checkout.jsx"
click node_order_logic "https://github.com/devtres/autofix-hub/blob/main/client/src/utils/orders.js"
click node_order_confirmation "https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/OrderConfirmation.jsx"
click node_order_history "https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/OrderHistory.jsx"
click node_tracking "https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/TrackOrder.jsx"
click node_locations "https://github.com/devtres/autofix-hub/blob/main/client/src/utils/philippineLocations.js"
click node_admin_layout "https://github.com/devtres/autofix-hub/blob/main/client/src/layouts/AdminLayout.jsx"
click node_admin_products "https://github.com/devtres/autofix-hub/blob/main/client/src/pages/admin/Products.jsx"
click node_admin_capabilities "https://github.com/devtres/autofix-hub/tree/main/client/src/pages/admin"
click node_api "https://github.com/devtres/autofix-hub/blob/main/server/index.js"
click node_db_pool "https://github.com/devtres/autofix-hub/blob/main/server/db.js"
click node_schema "https://github.com/devtres/autofix-hub/blob/main/database/schema.sql"
click node_seed "https://github.com/devtres/autofix-hub/blob/main/database/seed.sql"
click node_db_views "https://github.com/devtres/autofix-hub/blob/main/database/views_and_indexes.sql"

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_store_layout,node_catalog,node_product_detail,node_product_data,node_product_card,node_admin_user toneBlue
class node_cart,node_cart_drawer,node_checkout,node_order_logic,node_order_confirmation,node_order_history,node_tracking,node_locations toneAmber
class node_admin_layout,node_admin_products,node_admin_capabilities toneMint
class node_api,node_db_pool,node_schema,node_seed,node_db_views toneRose
class node_customer,node_map_tiles toneIndigo
```

## Components

### Storefront

- [Route application](https://github.com/devtres/autofix-hub/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Store layout](https://github.com/devtres/autofix-hub/blob/main/client/src/layouts/StoreLayout.jsx): `client/src/layouts/StoreLayout.jsx`
- [Product catalog](https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/Home.jsx): `client/src/pages/store/Home.jsx`
- [Product detail](https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/ProductDetail.jsx): `client/src/pages/store/ProductDetail.jsx`
- [Product data](https://github.com/devtres/autofix-hub/blob/main/client/src/data/products.js): `client/src/data/products.js`
- [Product card](https://github.com/devtres/autofix-hub/blob/main/client/src/components/store/ProductCard.jsx): `client/src/components/store/ProductCard.jsx`

### Cart and Orders

- [Cart and wishlist](https://github.com/devtres/autofix-hub/blob/main/client/src/context/CartContext.jsx): `client/src/context/CartContext.jsx`
- [Cart drawer](https://github.com/devtres/autofix-hub/blob/main/client/src/components/store/CartDrawer.jsx): `client/src/components/store/CartDrawer.jsx`
- [Checkout](https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/Checkout.jsx): `client/src/pages/store/Checkout.jsx`
- [Order creation and storage](https://github.com/devtres/autofix-hub/blob/main/client/src/utils/orders.js): `client/src/utils/orders.js`
- [Order confirmation](https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/OrderConfirmation.jsx): `client/src/pages/store/OrderConfirmation.jsx`
- [Order history](https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/OrderHistory.jsx): `client/src/pages/store/OrderHistory.jsx`
- [Order tracking](https://github.com/devtres/autofix-hub/blob/main/client/src/pages/store/TrackOrder.jsx): `client/src/pages/store/TrackOrder.jsx`
- [Philippine locations and routes](https://github.com/devtres/autofix-hub/blob/main/client/src/utils/philippineLocations.js): `client/src/utils/philippineLocations.js`

### Admin

- [Admin layout](https://github.com/devtres/autofix-hub/blob/main/client/src/layouts/AdminLayout.jsx): `client/src/layouts/AdminLayout.jsx`
- [Product management demo](https://github.com/devtres/autofix-hub/blob/main/client/src/pages/admin/Products.jsx): `client/src/pages/admin/Products.jsx`
- [Admin operations](https://github.com/devtres/autofix-hub/tree/main/client/src/pages/admin): `client/src/pages/admin`

### Backend and Data

- [Express API](https://github.com/devtres/autofix-hub/blob/main/server/index.js): `server/index.js`
- [MySQL connection pool](https://github.com/devtres/autofix-hub/blob/main/server/db.js): `server/db.js`
- [Database schema](https://github.com/devtres/autofix-hub/blob/main/database/schema.sql): `database/schema.sql`
- [Seed data](https://github.com/devtres/autofix-hub/blob/main/database/seed.sql): `database/seed.sql`
- [Views and indexes](https://github.com/devtres/autofix-hub/blob/main/database/views_and_indexes.sql): `database/views_and_indexes.sql`

### Other components

- **Customer**
- **Admin user**
- **OpenStreetMap tiles**

## Connections

- Customer → Route application: uses storefront (evidence: `README.md`)
- Admin user → Route application: uses admin (evidence: `README.md`)
- Route application → Store layout: routes to (evidence: `client/src/App.jsx`)
- Route application → Product catalog: routes to (evidence: `client/src/App.jsx`)
- Route application → Product detail: routes to (evidence: `client/src/App.jsx`)
- Route application → Checkout: routes to (evidence: `client/src/App.jsx`)
- Route application → Order confirmation: routes to (evidence: `client/src/App.jsx`)
- Route application → Order history: routes to (evidence: `client/src/App.jsx`)
- Route application → Order tracking: routes to (evidence: `client/src/App.jsx`)
- Route application → Admin layout: routes to (evidence: `client/src/App.jsx`)
- Route application → Product management demo: routes to (evidence: `client/src/App.jsx`)
- Route application → Admin operations: routes to (evidence: `client/src/App.jsx`)
- Product catalog → Product data: reads (evidence: `client/src/pages/store/Home.jsx`)
- Product catalog → Product card: renders (evidence: `client/src/pages/store/Home.jsx`)
- Product detail → Product data: reads (evidence: `client/src/pages/store/ProductDetail.jsx`)
- Product detail → Product card: renders (evidence: `client/src/pages/store/ProductDetail.jsx`)
- Product card → Cart and wishlist: updates (evidence: `client/src/components/store/ProductCard.jsx`)
- Store layout → Cart drawer: renders (evidence: `client/src/layouts/StoreLayout.jsx`)
- Cart drawer → Cart and wishlist: reads and updates (evidence: `client/src/components/store/CartDrawer.jsx`)
- Checkout → Cart and wishlist: reads and clears (evidence: `client/src/pages/store/Checkout.jsx`)
- Checkout → Order creation and storage: creates and saves (evidence: `client/src/pages/store/Checkout.jsx`)
- Checkout → Philippine locations and routes: reads options (evidence: `client/src/pages/store/Checkout.jsx`)
- Order confirmation → Order creation and storage: reads saved orders (evidence: `client/src/pages/store/OrderConfirmation.jsx`)
- Order history → Order creation and storage: reads saved orders (evidence: `client/src/pages/store/OrderHistory.jsx`)
- Order tracking → Order creation and storage: reads saved orders (evidence: `client/src/pages/store/TrackOrder.jsx`)
- Order tracking → Philippine locations and routes: uses route helper (evidence: `client/src/pages/store/TrackOrder.jsx`)
- Order creation and storage → Philippine locations and routes: builds delivery route (evidence: `client/src/utils/orders.js`)
- Order tracking → OpenStreetMap tiles: loads map tiles (evidence: `client/src/pages/store/TrackOrder.jsx`)
- Product management demo → Admin operations: implements product subset
- Express API → MySQL connection pool: uses pool (evidence: `server/index.js`)
- Express API → Database schema: uses database (evidence: `README.md`)
- Database schema → Seed data: initialized with (evidence: `README.md`)
- Database schema → Views and indexes: extended by (evidence: `README.md`)
- MySQL connection pool → Database schema: connects to MySQL (evidence: `README.md`)
