# grigor159/gnss architecture

> Architecture diagram of the GitHub repository grigor159/gnss, 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/grigor159/gnss
- Repository: https://github.com/grigor159/gnss

## Overview

This repository implements a product-catalog and inquiry/order application alongside a Laravel staff dashboard for managing customers and sales opportunities. A shopper-facing React client requests localized navigation/catalog data from the API; staff use dashboard controllers to manage catalog records and opportunity stages, notes, attachments, and tasks. Laravel’s route provider loads separate API, web, and dashboard route files. The graph emphasizes these product flows and their domain models; several controllers and services are unsampled, so uncertain links are omitted or marked unverified.

Main entry points: [`api/app/Http/Controllers/Dashboard/OpportunityController.php`](https://github.com/grigor159/gnss/blob/main/api/app/Http/Controllers/Dashboard/OpportunityController.php) (Opportunity workflow), [`api/app/Models/Opportunity.php`](https://github.com/grigor159/gnss/blob/main/api/app/Models/Opportunity.php) (Opportunity model), [`api/app/Http/Controllers/Api/SubcategoryController.php`](https://github.com/grigor159/gnss/blob/main/api/app/Http/Controllers/Api/SubcategoryController.php) (Subcategory API), [`api/app/Models/Product.php`](https://github.com/grigor159/gnss/blob/main/api/app/Models/Product.php) (Product model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Shopper client"]
  node_react_routes["Header navigation<br/>[Routes.jsx]"]
  node_home_state["Home state<br/>[homeSlice.js]"]
end

subgraph group_catalog["Catalog and API"]
  node_route_config["Route provider"]
  node_subcategory_api["Subcategory API"]
  node_catalog_api["Catalog endpoints"]
  node_inquiry_api["Inquiry endpoint"]
  node_orders_api["Order endpoint"]
end

subgraph group_crm["Sales dashboard"]
  node_dashboard["Dashboard controllers"]
  node_opportunity_controller["Opportunity workflow"]
  node_opportunity_service["Opportunity operations"]
  node_opportunity_notes["Notes operations"]
  node_filter_service["Opportunity filters<br/>[FilterService.php]"]
end

subgraph group_domain["Domain models"]
  node_category_model["Category model<br/>[Category.php]"]
  node_subcategory_model["Subcategory model<br/>[Subcategory.php]"]
  node_product_model["Product model<br/>[Product.php]"]
  node_customer_model["Customer model<br/>[Customer.php]"]
  node_opportunity_model["Opportunity model<br/>[Opportunity.php]"]
  node_statuses_model["Opportunity statuses"]
  node_order_model["Order model<br/>[Order.php]"]
  node_user_model["User and roles<br/>[User.php]"]
end

node_shopper(("Shopper"))

node_shopper -.->|"uses navigation"| node_react_routes
node_react_routes -->|"dispatches routes"| node_home_state
node_shopper -.->|"requests catalog"| node_subcategory_api
node_route_config -.->|"loads API routes"| node_subcategory_api
node_route_config -->|"loads API routes"| node_catalog_api
node_route_config -.->|"loads API routes"| node_inquiry_api
node_route_config -.->|"loads API routes"| node_orders_api
node_subcategory_api -->|"queries categories"| node_category_model
node_subcategory_api -->|"queries subcategories"| node_subcategory_model
node_subcategory_api -->|"queries products"| node_product_model
node_dashboard -.->|"includes workflow"| node_opportunity_controller
node_opportunity_controller -->|"delegates operations"| node_opportunity_service
node_opportunity_controller -->|"deletes notes"| node_opportunity_notes
node_opportunity_controller -->|"filters listings"| node_filter_service
node_opportunity_controller -->|"queries opportunities"| node_opportunity_model
node_opportunity_controller -->|"loads customers"| node_customer_model
node_opportunity_controller -->|"loads products"| node_product_model
node_opportunity_controller -->|"loads statuses"| node_statuses_model
node_opportunity_model -->|"belongs to"| node_customer_model
node_opportunity_model -->|"belongs to"| node_product_model
node_opportunity_model -->|"belongs to"| node_statuses_model
node_category_model -->|"has subcategories"| node_subcategory_model
node_category_model -->|"associates products"| node_product_model
node_product_model -->|"has opportunities"| node_opportunity_model
node_customer_model -->|"has opportunities"| node_opportunity_model
node_customer_model -->|"has orders"| node_order_model
node_user_model -->|"has opportunities"| node_opportunity_model

click node_react_routes "https://github.com/grigor159/gnss/blob/main/client/src/components/header/components/routes/Routes.jsx"
click node_home_state "https://github.com/grigor159/gnss/blob/main/client/src/store/slices/homeSlice.js"
click node_route_config "https://github.com/grigor159/gnss/blob/main/api/app/Providers/RouteServiceProvider.php"
click node_subcategory_api "https://github.com/grigor159/gnss/blob/main/api/app/Http/Controllers/Api/SubcategoryController.php"
click node_catalog_api "https://github.com/grigor159/gnss/tree/main/api/app/Http/Controllers/Api"
click node_inquiry_api "https://github.com/grigor159/gnss/blob/main/api/app/Http/Controllers/Api/InquiryController.php"
click node_orders_api "https://github.com/grigor159/gnss/blob/main/api/app/Http/Controllers/Api/OrderController.php"
click node_dashboard "https://github.com/grigor159/gnss/tree/main/api/app/Http/Controllers/Dashboard"
click node_opportunity_controller "https://github.com/grigor159/gnss/blob/main/api/app/Http/Controllers/Dashboard/OpportunityController.php"
click node_opportunity_service "https://github.com/grigor159/gnss/blob/main/api/app/Services/OpportunityService.php"
click node_opportunity_notes "https://github.com/grigor159/gnss/blob/main/api/app/Services/OpportunityNotesService.php"
click node_filter_service "https://github.com/grigor159/gnss/blob/main/api/app/Services/FilterService.php"
click node_category_model "https://github.com/grigor159/gnss/blob/main/api/app/Models/Category.php"
click node_subcategory_model "https://github.com/grigor159/gnss/blob/main/api/app/Models/Subcategory.php"
click node_product_model "https://github.com/grigor159/gnss/blob/main/api/app/Models/Product.php"
click node_customer_model "https://github.com/grigor159/gnss/blob/main/api/app/Models/Customer.php"
click node_opportunity_model "https://github.com/grigor159/gnss/blob/main/api/app/Models/Opportunity.php"
click node_statuses_model "https://github.com/grigor159/gnss/blob/main/api/app/Models/OpportunityStatuses.php"
click node_order_model "https://github.com/grigor159/gnss/blob/main/api/app/Models/Order.php"
click node_user_model "https://github.com/grigor159/gnss/blob/main/api/app/Models/User.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_react_routes,node_home_state toneBlue
class node_route_config,node_subcategory_api,node_catalog_api,node_inquiry_api,node_orders_api toneAmber
class node_dashboard,node_opportunity_controller,node_opportunity_service,node_opportunity_notes,node_filter_service toneMint
class node_category_model,node_subcategory_model,node_product_model,node_customer_model,node_opportunity_model,node_statuses_model,node_order_model,node_user_model toneRose
class node_shopper toneIndigo
```

## Components

### Shopper client

- [Header navigation](https://github.com/grigor159/gnss/blob/main/client/src/components/header/components/routes/Routes.jsx): `client/src/components/header/components/routes/Routes.jsx`
- [Home state](https://github.com/grigor159/gnss/blob/main/client/src/store/slices/homeSlice.js): `client/src/store/slices/homeSlice.js`

### Catalog and API

- [Route provider](https://github.com/grigor159/gnss/blob/main/api/app/Providers/RouteServiceProvider.php): `api/app/Providers/RouteServiceProvider.php`
- [Subcategory API](https://github.com/grigor159/gnss/blob/main/api/app/Http/Controllers/Api/SubcategoryController.php): `api/app/Http/Controllers/Api/SubcategoryController.php`
- [Catalog endpoints](https://github.com/grigor159/gnss/tree/main/api/app/Http/Controllers/Api): `api/app/Http/Controllers/Api`
- [Inquiry endpoint](https://github.com/grigor159/gnss/blob/main/api/app/Http/Controllers/Api/InquiryController.php): `api/app/Http/Controllers/Api/InquiryController.php`
- [Order endpoint](https://github.com/grigor159/gnss/blob/main/api/app/Http/Controllers/Api/OrderController.php): `api/app/Http/Controllers/Api/OrderController.php`

### Sales dashboard

- [Dashboard controllers](https://github.com/grigor159/gnss/tree/main/api/app/Http/Controllers/Dashboard): `api/app/Http/Controllers/Dashboard`
- [Opportunity workflow](https://github.com/grigor159/gnss/blob/main/api/app/Http/Controllers/Dashboard/OpportunityController.php): `api/app/Http/Controllers/Dashboard/OpportunityController.php`
- [Opportunity operations](https://github.com/grigor159/gnss/blob/main/api/app/Services/OpportunityService.php): `api/app/Services/OpportunityService.php`
- [Notes operations](https://github.com/grigor159/gnss/blob/main/api/app/Services/OpportunityNotesService.php): `api/app/Services/OpportunityNotesService.php`
- [Opportunity filters](https://github.com/grigor159/gnss/blob/main/api/app/Services/FilterService.php): `api/app/Services/FilterService.php`

### Domain models

- [Category model](https://github.com/grigor159/gnss/blob/main/api/app/Models/Category.php): `api/app/Models/Category.php`
- [Subcategory model](https://github.com/grigor159/gnss/blob/main/api/app/Models/Subcategory.php): `api/app/Models/Subcategory.php`
- [Product model](https://github.com/grigor159/gnss/blob/main/api/app/Models/Product.php): `api/app/Models/Product.php`
- [Customer model](https://github.com/grigor159/gnss/blob/main/api/app/Models/Customer.php): `api/app/Models/Customer.php`
- [Opportunity model](https://github.com/grigor159/gnss/blob/main/api/app/Models/Opportunity.php): `api/app/Models/Opportunity.php`
- [Opportunity statuses](https://github.com/grigor159/gnss/blob/main/api/app/Models/OpportunityStatuses.php): `api/app/Models/OpportunityStatuses.php`
- [Order model](https://github.com/grigor159/gnss/blob/main/api/app/Models/Order.php): `api/app/Models/Order.php`
- [User and roles](https://github.com/grigor159/gnss/blob/main/api/app/Models/User.php): `api/app/Models/User.php`

### Other components

- **Shopper**

## Connections

- Shopper → Header navigation: uses navigation
- Header navigation → Home state: dispatches routes (evidence: `client/src/components/header/components/routes/Routes.jsx`)
- Shopper → Subcategory API: requests catalog
- Route provider → Subcategory API: loads API routes
- Route provider → Catalog endpoints: loads API routes (evidence: `api/app/Providers/RouteServiceProvider.php`)
- Route provider → Inquiry endpoint: loads API routes
- Route provider → Order endpoint: loads API routes
- Subcategory API → Category model: queries categories (evidence: `api/app/Http/Controllers/Api/SubcategoryController.php`)
- Subcategory API → Subcategory model: queries subcategories (evidence: `api/app/Http/Controllers/Api/SubcategoryController.php`)
- Subcategory API → Product model: queries products (evidence: `api/app/Http/Controllers/Api/SubcategoryController.php`)
- Dashboard controllers → Opportunity workflow: includes workflow
- Opportunity workflow → Opportunity operations: delegates operations (evidence: `api/app/Http/Controllers/Dashboard/OpportunityController.php`)
- Opportunity workflow → Notes operations: deletes notes (evidence: `api/app/Http/Controllers/Dashboard/OpportunityController.php`)
- Opportunity workflow → Opportunity filters: filters listings (evidence: `api/app/Http/Controllers/Dashboard/OpportunityController.php`)
- Opportunity workflow → Opportunity model: queries opportunities (evidence: `api/app/Http/Controllers/Dashboard/OpportunityController.php`)
- Opportunity workflow → Customer model: loads customers (evidence: `api/app/Http/Controllers/Dashboard/OpportunityController.php`)
- Opportunity workflow → Product model: loads products (evidence: `api/app/Http/Controllers/Dashboard/OpportunityController.php`)
- Opportunity workflow → Opportunity statuses: loads statuses (evidence: `api/app/Http/Controllers/Dashboard/OpportunityController.php`)
- Opportunity model → Customer model: belongs to (evidence: `api/app/Models/Opportunity.php`)
- Opportunity model → Product model: belongs to (evidence: `api/app/Models/Opportunity.php`)
- Opportunity model → Opportunity statuses: belongs to (evidence: `api/app/Models/Opportunity.php`)
- Category model → Subcategory model: has subcategories (evidence: `api/app/Models/Category.php`)
- Category model → Product model: associates products (evidence: `api/app/Models/Category.php`)
- Product model → Opportunity model: has opportunities (evidence: `api/app/Models/Product.php`)
- Customer model → Opportunity model: has opportunities (evidence: `api/app/Models/Customer.php`)
- Customer model → Order model: has orders (evidence: `api/app/Models/Customer.php`)
- User and roles → Opportunity model: has opportunities (evidence: `api/app/Models/User.php`)
