# kbram/planogram architecture

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

## Overview

This is a Laravel inventory application with user authentication and role-based administration. The principal workflow is an authenticated user opening a department dashboard, where the controller gathers department, aisle, bay, product, and stock data and renders the home view; stock and user-management routes provide related operations. The graph preserves the documented seeded roles and permissions, but the README is generic Laravel documentation and sampled routing does not expose every route. Some inventory controllers and views are present in the tree but were not sampled, so their interactions are not inferred.

Main entry points: [`app/Models/Stock.php`](https://github.com/kbram/planogram/blob/main/app/Models/Stock.php) (Stock records), [`app/Http/Controllers/HomeController.php`](https://github.com/kbram/planogram/blob/main/app/Http/Controllers/HomeController.php) (Department dashboard), [`app/Models/Aisle.php`](https://github.com/kbram/planogram/blob/main/app/Models/Aisle.php) (Aisles), [`routes/web.php`](https://github.com/kbram/planogram/blob/main/routes/web.php) (Web routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_request["Request and dashboard"]
  node_web_routes["Web routes<br/>[web.php]"]
  node_dashboard["Department dashboard<br/>[HomeController.php]"]
  node_stock_ops["Stock operations"]
  node_home_view["Dashboard view<br/>[home.blade.php]"]
end

subgraph group_inventory["Inventory domain"]
  node_departments["Departments<br/>[Department.php]"]
  node_aisles["Aisles<br/>[Aisle.php]"]
  node_bays["Bays<br/>[Bay.php]"]
  node_products["Products<br/>[Product.php]"]
  node_stock["Stock records<br/>[Stock.php]"]
  node_department_ops["Department operations"]
  node_product_ops["Product operations"]
end

subgraph group_identity["Identity and administration"]
  node_login["Login"]
  node_registration["Registration"]
  node_verification["Email verification"]
  node_user_admin["User administration<br/>[UserController.php]"]
  node_users["Users and roles<br/>[User.php]"]
  node_role_model["Role records<br/>[Role.php]"]
end

subgraph group_persistence["Persistence"]
  node_database[("Application database<br/>[database.php]")]
end

node_visitor(("Web user"))

node_visitor -->|"requests pages"| node_web_routes
node_web_routes -->|"routes to"| node_dashboard
node_web_routes -->|"routes to"| node_stock_ops
node_web_routes -->|"routes to"| node_user_admin
node_dashboard -->|"loads department"| node_departments
node_dashboard -->|"loads aisles"| node_aisles
node_dashboard -->|"loads bays"| node_bays
node_dashboard -->|"loads products"| node_products
node_dashboard -->|"loads stock"| node_stock
node_dashboard -->|"renders"| node_home_view
node_stock_ops -->|"uses records"| node_stock
node_user_admin -->|"loads users"| node_users
node_users -->|"relates roles"| node_role_model
node_aisles -->|"has many"| node_bays
node_aisles -->|"belongs to"| node_departments
node_bays -->|"has many"| node_stock
node_stock -->|"belongs to"| node_products
node_stock -->|"belongs to"| node_bays
node_stock -->|"belongs to"| node_aisles
node_stock -->|"belongs to"| node_departments
node_departments -->|"has many"| node_aisles
node_database -.->|"stores records"| node_stock
node_database -.->|"stores records"| node_users

click node_web_routes "https://github.com/kbram/planogram/blob/main/routes/web.php"
click node_dashboard "https://github.com/kbram/planogram/blob/main/app/Http/Controllers/HomeController.php"
click node_stock_ops "https://github.com/kbram/planogram/blob/main/app/Http/Controllers/StockController.php"
click node_home_view "https://github.com/kbram/planogram/blob/main/resources/views/home.blade.php"
click node_departments "https://github.com/kbram/planogram/blob/main/app/Models/Department.php"
click node_aisles "https://github.com/kbram/planogram/blob/main/app/Models/Aisle.php"
click node_bays "https://github.com/kbram/planogram/blob/main/app/Models/Bay.php"
click node_products "https://github.com/kbram/planogram/blob/main/app/Models/Product.php"
click node_stock "https://github.com/kbram/planogram/blob/main/app/Models/Stock.php"
click node_department_ops "https://github.com/kbram/planogram/blob/main/app/Http/Controllers/DepartmentController.php"
click node_product_ops "https://github.com/kbram/planogram/blob/main/app/Http/Controllers/ProductController.php"
click node_login "https://github.com/kbram/planogram/blob/main/app/Http/Controllers/Auth/LoginController.php"
click node_registration "https://github.com/kbram/planogram/blob/main/app/Http/Controllers/Auth/RegisterController.php"
click node_verification "https://github.com/kbram/planogram/blob/main/app/Http/Controllers/Auth/VerificationController.php"
click node_user_admin "https://github.com/kbram/planogram/blob/main/app/Http/Controllers/Admin/UserController.php"
click node_users "https://github.com/kbram/planogram/blob/main/app/Models/User.php"
click node_role_model "https://github.com/kbram/planogram/blob/main/app/Models/Role.php"
click node_database "https://github.com/kbram/planogram/blob/main/config/database.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_web_routes,node_dashboard,node_stock_ops,node_home_view,node_visitor toneBlue
class node_departments,node_aisles,node_bays,node_products,node_stock,node_department_ops,node_product_ops toneAmber
class node_login,node_registration,node_verification,node_user_admin,node_users,node_role_model toneMint
class node_database toneRose
```

## Components

### Request and dashboard

- [Web routes](https://github.com/kbram/planogram/blob/main/routes/web.php): `routes/web.php`
- [Department dashboard](https://github.com/kbram/planogram/blob/main/app/Http/Controllers/HomeController.php): `app/Http/Controllers/HomeController.php`
- [Stock operations](https://github.com/kbram/planogram/blob/main/app/Http/Controllers/StockController.php): `app/Http/Controllers/StockController.php`
- [Dashboard view](https://github.com/kbram/planogram/blob/main/resources/views/home.blade.php): `resources/views/home.blade.php`

### Inventory domain

- [Departments](https://github.com/kbram/planogram/blob/main/app/Models/Department.php): `app/Models/Department.php`
- [Aisles](https://github.com/kbram/planogram/blob/main/app/Models/Aisle.php): `app/Models/Aisle.php`
- [Bays](https://github.com/kbram/planogram/blob/main/app/Models/Bay.php): `app/Models/Bay.php`
- [Products](https://github.com/kbram/planogram/blob/main/app/Models/Product.php): `app/Models/Product.php`
- [Stock records](https://github.com/kbram/planogram/blob/main/app/Models/Stock.php): `app/Models/Stock.php`
- [Department operations](https://github.com/kbram/planogram/blob/main/app/Http/Controllers/DepartmentController.php): `app/Http/Controllers/DepartmentController.php`
- [Product operations](https://github.com/kbram/planogram/blob/main/app/Http/Controllers/ProductController.php): `app/Http/Controllers/ProductController.php`

### Identity and administration

- [Login](https://github.com/kbram/planogram/blob/main/app/Http/Controllers/Auth/LoginController.php): `app/Http/Controllers/Auth/LoginController.php`
- [Registration](https://github.com/kbram/planogram/blob/main/app/Http/Controllers/Auth/RegisterController.php): `app/Http/Controllers/Auth/RegisterController.php`
- [Email verification](https://github.com/kbram/planogram/blob/main/app/Http/Controllers/Auth/VerificationController.php): `app/Http/Controllers/Auth/VerificationController.php`
- [User administration](https://github.com/kbram/planogram/blob/main/app/Http/Controllers/Admin/UserController.php): `app/Http/Controllers/Admin/UserController.php`
- [Users and roles](https://github.com/kbram/planogram/blob/main/app/Models/User.php): `app/Models/User.php`
- [Role records](https://github.com/kbram/planogram/blob/main/app/Models/Role.php): `app/Models/Role.php`

### Persistence

- [Application database](https://github.com/kbram/planogram/blob/main/config/database.php): `config/database.php`

### Other components

- **Web user**

## Connections

- Web user → Web routes: requests pages (evidence: `routes/web.php`)
- Web routes → Department dashboard: routes to (evidence: `routes/web.php`)
- Web routes → Stock operations: routes to (evidence: `routes/web.php`)
- Web routes → User administration: routes to (evidence: `routes/web.php`)
- Department dashboard → Departments: loads department (evidence: `app/Http/Controllers/HomeController.php`)
- Department dashboard → Aisles: loads aisles (evidence: `app/Http/Controllers/HomeController.php`)
- Department dashboard → Bays: loads bays (evidence: `app/Http/Controllers/HomeController.php`)
- Department dashboard → Products: loads products (evidence: `app/Http/Controllers/HomeController.php`)
- Department dashboard → Stock records: loads stock (evidence: `app/Http/Controllers/HomeController.php`)
- Department dashboard → Dashboard view: renders (evidence: `app/Http/Controllers/HomeController.php`)
- Stock operations → Stock records: uses records (evidence: `app/Http/Controllers/StockController.php`)
- User administration → Users and roles: loads users (evidence: `app/Http/Controllers/Admin/UserController.php`)
- Users and roles → Role records: relates roles (evidence: `app/Models/User.php`)
- Aisles → Bays: has many (evidence: `app/Models/Aisle.php`)
- Aisles → Departments: belongs to (evidence: `app/Models/Aisle.php`)
- Bays → Stock records: has many (evidence: `app/Models/Bay.php`)
- Stock records → Products: belongs to (evidence: `app/Models/Stock.php`)
- Stock records → Bays: belongs to (evidence: `app/Models/Stock.php`)
- Stock records → Aisles: belongs to (evidence: `app/Models/Stock.php`)
- Stock records → Departments: belongs to (evidence: `app/Models/Stock.php`)
- Departments → Aisles: has many (evidence: `app/Models/Department.php`)
- Application database → Stock records: stores records
- Application database → Users and roles: stores records
