# husanswe/texmart-laravel-ecommerce architecture

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

- Interactive diagram: https://gitdiagram.com/husanswe/texmart-laravel-ecommerce
- Repository: https://github.com/husanswe/texmart-laravel-ecommerce

## Overview

Texmart is an Uzbek-market electronics storefront split between a Nuxt frontend and a Laravel JSON API. The shopper-facing workflow is browsing categories and brands, viewing and filtering products, then (as documented API capabilities) authenticating, managing a cart and favorites, and placing orders. The README says the frontend currently uses JSON fixtures and can switch to the API without UI changes. API routing and catalog controller relationships are evidenced in the excerpts; several other API controllers are stubs or were not sampled, so their internal behavior is not inferred.

Main entry points: [`backend/routes/api.php`](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/routes/api.php) (Versioned API routes), [`frontend/app/app.vue`](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/frontend/app/app.vue) (Storefront UI), [`backend/app/Http/Controllers/Api/CategoryController.php`](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/CategoryController.php) (Categories), [`backend/app/Http/Controllers/Api/ProductController.php`](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/ProductController.php) (Products and filters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Nuxt storefront"]
  node_storefront["Storefront UI<br/>[app.vue]"]
  node_home["Storefront home<br/>[index.vue]"]
  node_header["Header and search<br/>[AppHeader.vue]"]
  node_api_client["API client<br/>[useApi.ts]"]
  node_category_repo["Category repository<br/>[categoryRepo.ts]"]
end

subgraph group_api["Laravel API"]
  node_api_routes["Versioned API routes<br/>[api.php]"]
  node_product_resource["Product response"]
  node_brand_resource["Brand response<br/>[BrandResource.php]"]
  node_category_resource["Category response"]
end

subgraph group_catalog["Catalog domain"]
  node_categories["Categories"]
  node_brands["Brands"]
  node_products["Products and filters"]
  node_search["Search"]
  node_filter["Filter options"]
  node_product_model["Product model<br/>[Product.php]"]
  node_category_model["Category model<br/>[Category.php]"]
end

subgraph group_commerce["Customer commerce"]
  node_auth["Authentication<br/>[AuthController.php]"]
  node_profile["Profile"]
  node_cart["Cart<br/>[CartController.php]"]
  node_favorites["Favorites"]
  node_orders["Orders"]
end

node_shopper(("Shopper"))

node_shopper -->|"browses"| node_storefront
node_storefront -->|"shows"| node_home
node_storefront -.->|"renders"| node_header
node_home -.->|"requests data"| node_api_client
node_category_repo -.->|"uses"| node_api_client
node_api_client -->|"calls JSON API"| node_api_routes
node_api_routes -->|"routes auth"| node_auth
node_api_routes -->|"routes profile"| node_profile
node_api_routes -->|"routes cart"| node_cart
node_api_routes -->|"routes favorites"| node_favorites
node_api_routes -->|"routes orders"| node_orders
node_api_routes -->|"routes categories"| node_categories
node_api_routes -->|"routes brands"| node_brands
node_api_routes -->|"routes products"| node_products
node_api_routes -->|"routes search"| node_search
node_api_routes -->|"routes filters"| node_filter
node_categories -->|"queries"| node_category_model
node_categories -->|"serializes"| node_category_resource
node_brands -->|"serializes"| node_brand_resource
node_products -->|"queries"| node_product_model
node_products -->|"serializes"| node_product_resource
node_product_model -->|"belongs to"| node_category_model

click node_storefront "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/frontend/app/app.vue"
click node_home "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/frontend/app/pages/index.vue"
click node_header "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/frontend/app/components/AppHeader.vue"
click node_api_client "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/frontend/app/composables/useApi.ts"
click node_category_repo "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/frontend/app/repositories/categoryRepo.ts"
click node_api_routes "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/routes/api.php"
click node_auth "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/AuthController.php"
click node_profile "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/ProfileController.php"
click node_cart "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/CartController.php"
click node_favorites "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/FavoriteController.php"
click node_orders "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/OrderController.php"
click node_categories "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/CategoryController.php"
click node_brands "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/BrandController.php"
click node_products "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/ProductController.php"
click node_search "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/SearchController.php"
click node_filter "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/FilterController.php"
click node_product_model "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Models/Product.php"
click node_category_model "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Models/Category.php"
click node_product_resource "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Resources/ProductResource.php"
click node_brand_resource "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Resources/BrandResource.php"
click node_category_resource "https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Resources/CategoryResource.php"

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_storefront,node_home,node_header,node_api_client,node_category_repo toneBlue
class node_api_routes,node_product_resource,node_brand_resource,node_category_resource toneAmber
class node_categories,node_brands,node_products,node_search,node_filter,node_product_model,node_category_model toneMint
class node_auth,node_profile,node_cart,node_favorites,node_orders toneRose
class node_shopper toneIndigo
```

## Components

### Nuxt storefront

- [Storefront UI](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/frontend/app/app.vue): `frontend/app/app.vue`
- [Storefront home](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/frontend/app/pages/index.vue): `frontend/app/pages/index.vue`
- [Header and search](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/frontend/app/components/AppHeader.vue): `frontend/app/components/AppHeader.vue`
- [API client](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/frontend/app/composables/useApi.ts): `frontend/app/composables/useApi.ts`
- [Category repository](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/frontend/app/repositories/categoryRepo.ts): `frontend/app/repositories/categoryRepo.ts`

### Laravel API

- [Versioned API routes](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/routes/api.php): `backend/routes/api.php`
- [Product response](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Resources/ProductResource.php): `backend/app/Http/Resources/ProductResource.php`
- [Brand response](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Resources/BrandResource.php): `backend/app/Http/Resources/BrandResource.php`
- [Category response](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Resources/CategoryResource.php): `backend/app/Http/Resources/CategoryResource.php`

### Catalog domain

- [Categories](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/CategoryController.php): `backend/app/Http/Controllers/Api/CategoryController.php`
- [Brands](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/BrandController.php): `backend/app/Http/Controllers/Api/BrandController.php`
- [Products and filters](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/ProductController.php): `backend/app/Http/Controllers/Api/ProductController.php`
- [Search](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/SearchController.php): `backend/app/Http/Controllers/Api/SearchController.php`
- [Filter options](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/FilterController.php): `backend/app/Http/Controllers/Api/FilterController.php`
- [Product model](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Models/Product.php): `backend/app/Models/Product.php`
- [Category model](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Models/Category.php): `backend/app/Models/Category.php`

### Customer commerce

- [Authentication](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/AuthController.php): `backend/app/Http/Controllers/Api/AuthController.php`
- [Profile](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/ProfileController.php): `backend/app/Http/Controllers/Api/ProfileController.php`
- [Cart](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/CartController.php): `backend/app/Http/Controllers/Api/CartController.php`
- [Favorites](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/FavoriteController.php): `backend/app/Http/Controllers/Api/FavoriteController.php`
- [Orders](https://github.com/husanswe/texmart-laravel-ecommerce/blob/main/backend/app/Http/Controllers/Api/OrderController.php): `backend/app/Http/Controllers/Api/OrderController.php`

### Other components

- **Shopper**

## Connections

- Shopper → Storefront UI: browses (evidence: `README.md`)
- Storefront UI → Storefront home: shows (evidence: `frontend/app/app.vue`)
- Storefront UI → Header and search: renders
- Storefront home → API client: requests data
- Category repository → API client: uses
- API client → Versioned API routes: calls JSON API (evidence: `README.md`)
- Versioned API routes → Authentication: routes auth (evidence: `backend/routes/api.php`)
- Versioned API routes → Profile: routes profile (evidence: `backend/routes/api.php`)
- Versioned API routes → Cart: routes cart (evidence: `backend/routes/api.php`)
- Versioned API routes → Favorites: routes favorites (evidence: `backend/routes/api.php`)
- Versioned API routes → Orders: routes orders (evidence: `backend/routes/api.php`)
- Versioned API routes → Categories: routes categories (evidence: `backend/routes/api.php`)
- Versioned API routes → Brands: routes brands (evidence: `backend/routes/api.php`)
- Versioned API routes → Products and filters: routes products (evidence: `backend/routes/api.php`)
- Versioned API routes → Search: routes search (evidence: `backend/routes/api.php`)
- Versioned API routes → Filter options: routes filters (evidence: `backend/routes/api.php`)
- Categories → Category model: queries (evidence: `backend/app/Http/Controllers/Api/CategoryController.php`)
- Categories → Category response: serializes (evidence: `backend/app/Http/Controllers/Api/CategoryController.php`)
- Brands → Brand response: serializes (evidence: `backend/app/Http/Controllers/Api/BrandController.php`)
- Products and filters → Product model: queries (evidence: `backend/app/Http/Controllers/Api/ProductController.php`)
- Products and filters → Product response: serializes (evidence: `backend/app/Http/Controllers/Api/ProductController.php`)
- Product model → Category model: belongs to (evidence: `backend/app/Models/Product.php`)
