# alimohammaddev/new-home-api architecture

> Architecture diagram of the GitHub repository alimohammaddev/new-home-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alimohammaddev/new-home-api
- Repository: https://github.com/alimohammaddev/new-home-api

## Overview

This appears to be a Laravel commerce and operations application: customer-facing APIs cover catalog, carts, checkout, orders, and reviews, while a Filament panel manages inventory, sales points, imports, and finances. The tree shows these distinct capabilities, but the README is only the stock Laravel README and does not describe product behavior. Edges are limited to relationships visible in supplied excerpts or SOURCE INDEX references; unsampled routing and runtime wiring are not asserted.

Main entry points: [`app/Models/Order.php`](https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/Order.php) (Orders), [`app/Models/ProductVariant.php`](https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/ProductVariant.php) (Products and Variants), [`app/Http/Controllers/Api/FinancialReportController.php`](https://github.com/alimohammaddev/new-home-api/blob/main/app/Http/Controllers/Api/FinancialReportController.php) (Financial Reports), [`app/Http/Controllers/Api`](https://github.com/alimohammaddev/new-home-api/tree/main/app/Http/Controllers/Api) (Commerce API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commerce["Commerce API"]
  node_commerce_api["Commerce API"]
  node_checkout_service["Checkout Service"]
  node_orders[("Orders<br/>[Order.php]")]
  node_cart[("Cart<br/>[Cart.php]")]
  node_reviews_api["Reviews API"]
  node_reviews_service["Reviews Service<br/>[ReviewsService.php]"]
  node_reviews[("Reviews<br/>[Reviews.php]")]
end

subgraph group_inventory["Catalog and Inventory"]
  node_catalog_api["Catalog API"]
  node_products[("Products and Variants<br/>[ProductVariant.php]")]
  node_imports[("Product Imports<br/>[ProductImport.php]")]
  node_warehouses[("Warehouses<br/>[Warehouse.php]")]
  node_shipping_stock[("Inbound Stock")]
end

subgraph group_operations["Sales Operations"]
  node_filament["Filament Admin"]
  node_sales_points[("Sales Points and Cashiers<br/>[SalesPoint.php]")]
  node_sales_transfers[("Cashier Transactions")]
end

subgraph group_finance["Finance and Reporting"]
  node_financial_reports["Financial Reports"]
  node_company_finance[("Company Finance")]
end

subgraph group_internal["Domain and Services"]
  node_users[("Users and Roles<br/>[User.php]")]
  node_order_observer["Order Observer<br/>[OrderObserver.php]"]
end

node_customer(("Customer"))
node_staff(("Operations Staff"))

node_reviews_api -->|"calls"| node_reviews_service
node_reviews_service -->|"queries and updates"| node_reviews
node_reviews -->|"references variant"| node_products
node_filament -->|"manages"| node_sales_points
node_sales_points -->|"has transactions"| node_sales_transfers
node_products -->|"stock association"| node_warehouses
node_products -->|"has inbound stock"| node_shipping_stock
node_imports -->|"imports variants"| node_products
node_shipping_stock -->|"belongs to"| node_warehouses
node_orders -->|"belongs to"| node_users
node_users -->|"has orders"| node_orders
node_orders -->|"references cart"| node_cart
node_orders -->|"observed by"| node_order_observer
node_financial_reports -->|"reads"| node_orders
node_financial_reports -->|"reads"| node_company_finance
node_customer -.->|"uses"| node_commerce_api
node_staff -.->|"uses"| node_filament
node_commerce_api -.->|"delegates"| node_checkout_service
node_checkout_service -.->|"creates"| node_orders
node_catalog_api -.->|"serves catalog"| node_products

click node_commerce_api "https://github.com/alimohammaddev/new-home-api/tree/main/app/Http/Controllers/Api"
click node_checkout_service "https://github.com/alimohammaddev/new-home-api/blob/main/app/Services/CheckoutService.php"
click node_orders "https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/Order.php"
click node_cart "https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/Cart.php"
click node_reviews_api "https://github.com/alimohammaddev/new-home-api/blob/main/app/Http/Controllers/Api/ReviewsController.php"
click node_reviews_service "https://github.com/alimohammaddev/new-home-api/blob/main/app/Services/ReviewsService.php"
click node_reviews "https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/Reviews.php"
click node_catalog_api "https://github.com/alimohammaddev/new-home-api/blob/main/app/Http/Controllers/Api/ProductController.php"
click node_products "https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/ProductVariant.php"
click node_imports "https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/ProductImport.php"
click node_warehouses "https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/Warehouse.php"
click node_shipping_stock "https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/ShippingWarehouse.php"
click node_filament "https://github.com/alimohammaddev/new-home-api/tree/main/app/Filament/Resources"
click node_sales_points "https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/SalesPoint.php"
click node_sales_transfers "https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/SalesPointCashierTrans.php"
click node_financial_reports "https://github.com/alimohammaddev/new-home-api/blob/main/app/Http/Controllers/Api/FinancialReportController.php"
click node_company_finance "https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/CompanySalesTransfer.php"
click node_users "https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/User.php"
click node_order_observer "https://github.com/alimohammaddev/new-home-api/blob/main/app/Observers/OrderObserver.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_commerce_api,node_checkout_service,node_orders,node_cart,node_reviews_api,node_reviews_service,node_reviews toneBlue
class node_catalog_api,node_products,node_imports,node_warehouses,node_shipping_stock toneAmber
class node_filament,node_sales_points,node_sales_transfers toneMint
class node_financial_reports,node_company_finance toneRose
class node_users,node_order_observer,node_customer,node_staff toneIndigo
```

## Components

### Commerce API

- [Commerce API](https://github.com/alimohammaddev/new-home-api/tree/main/app/Http/Controllers/Api): `app/Http/Controllers/Api`
- [Checkout Service](https://github.com/alimohammaddev/new-home-api/blob/main/app/Services/CheckoutService.php): `app/Services/CheckoutService.php`
- [Orders](https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/Order.php): `app/Models/Order.php`
- [Cart](https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/Cart.php): `app/Models/Cart.php`
- [Reviews API](https://github.com/alimohammaddev/new-home-api/blob/main/app/Http/Controllers/Api/ReviewsController.php): `app/Http/Controllers/Api/ReviewsController.php`
- [Reviews Service](https://github.com/alimohammaddev/new-home-api/blob/main/app/Services/ReviewsService.php): `app/Services/ReviewsService.php`
- [Reviews](https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/Reviews.php): `app/Models/Reviews.php`

### Catalog and Inventory

- [Catalog API](https://github.com/alimohammaddev/new-home-api/blob/main/app/Http/Controllers/Api/ProductController.php): `app/Http/Controllers/Api/ProductController.php`
- [Products and Variants](https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/ProductVariant.php): `app/Models/ProductVariant.php`
- [Product Imports](https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/ProductImport.php): `app/Models/ProductImport.php`
- [Warehouses](https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/Warehouse.php): `app/Models/Warehouse.php`
- [Inbound Stock](https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/ShippingWarehouse.php): `app/Models/ShippingWarehouse.php`

### Sales Operations

- [Filament Admin](https://github.com/alimohammaddev/new-home-api/tree/main/app/Filament/Resources): `app/Filament/Resources`
- [Sales Points and Cashiers](https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/SalesPoint.php): `app/Models/SalesPoint.php`
- [Cashier Transactions](https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/SalesPointCashierTrans.php): `app/Models/SalesPointCashierTrans.php`

### Finance and Reporting

- [Financial Reports](https://github.com/alimohammaddev/new-home-api/blob/main/app/Http/Controllers/Api/FinancialReportController.php): `app/Http/Controllers/Api/FinancialReportController.php`
- [Company Finance](https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/CompanySalesTransfer.php): `app/Models/CompanySalesTransfer.php`

### Domain and Services

- [Users and Roles](https://github.com/alimohammaddev/new-home-api/blob/main/app/Models/User.php): `app/Models/User.php`
- [Order Observer](https://github.com/alimohammaddev/new-home-api/blob/main/app/Observers/OrderObserver.php): `app/Observers/OrderObserver.php`

### Other components

- **Customer**
- **Operations Staff**

## Connections

- Reviews API → Reviews Service: calls (evidence: `app/Http/Controllers/Api/ReviewsController.php`)
- Reviews Service → Reviews: queries and updates (evidence: `app/Services/ReviewsService.php`)
- Reviews → Products and Variants: references variant (evidence: `app/Models/Reviews.php`)
- Filament Admin → Sales Points and Cashiers: manages (evidence: `app/Filament/Resources/SalesPointManagerResource.php`)
- Sales Points and Cashiers → Cashier Transactions: has transactions (evidence: `app/Models/SalesPointManager.php`)
- Products and Variants → Warehouses: stock association (evidence: `app/Models/ProductVariant.php`)
- Products and Variants → Inbound Stock: has inbound stock (evidence: `app/Models/ProductVariant.php`)
- Product Imports → Products and Variants: imports variants (evidence: `app/Models/ProductImport.php`)
- Inbound Stock → Warehouses: belongs to (evidence: `app/Models/ShippingWarehouse.php`)
- Orders → Users and Roles: belongs to (evidence: `app/Models/Order.php`)
- Users and Roles → Orders: has orders (evidence: `app/Models/User.php`)
- Orders → Cart: references cart (evidence: `app/Models/Order.php`)
- Orders → Order Observer: observed by (evidence: `app/Providers/AppServiceProvider.php`)
- Financial Reports → Orders: reads (evidence: `app/Http/Controllers/Api/FinancialReportController.php`)
- Financial Reports → Company Finance: reads (evidence: `app/Http/Controllers/Api/FinancialReportController.php`)
- Customer → Commerce API: uses
- Operations Staff → Filament Admin: uses
- Commerce API → Checkout Service: delegates
- Checkout Service → Orders: creates
- Catalog API → Products and Variants: serves catalog
