# mahmoud-borkhsh/chat-pusher-and-livewire architecture

> Architecture diagram of the GitHub repository mahmoud-borkhsh/chat-pusher-and-livewire, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mahmoud-borkhsh/chat-pusher-and-livewire
- Repository: https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire

## Overview

This Laravel application provides authenticated, browser-based chat: users register or sign in, enter Livewire chat screens, and exchange conversation messages. The sampled source confirms route registration, authentication, chat components’ model dependencies, and user/message models. Notifications and the Pusher-oriented realtime client are retained as product capabilities indicated by the repository name and module tree, but their runtime wiring was not fully sampled; those links are marked unverified or omitted.

Main entry points: [`chat-pusher-and-livewire/routes/web.php`](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/routes/web.php) (Web routes), [`chat-pusher-and-livewire/app/Http/Livewire/Chat/Chat.php`](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Livewire/Chat/Chat.php) (Chat interaction), [`chat-pusher-and-livewire/app/Models/Conversation.php`](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Models/Conversation.php) (Conversation model), [`chat-pusher-and-livewire/app/Http/Controllers/Auth/RegisteredUserController.php`](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Controllers/Auth/RegisteredUserController.php) (Authentication handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Request and routing"]
  node_front["Laravel entry<br/>[index.php]"]
  node_bootstrap["App bootstrap<br/>[app.php]"]
  node_httpkernel["HTTP middleware<br/>[Kernel.php]"]
  node_routeservice["Route registration"]
  node_webroutes["Web routes<br/>[web.php]"]
end

subgraph group_identity["Accounts and profiles"]
  node_authroutes["Account routes<br/>[auth.php]"]
  node_authcontrollers["Authentication handlers"]
  node_loginrequest["Login validation<br/>[LoginRequest.php]"]
  node_profile["Profile management"]
  node_basecontroller["Controller base<br/>[Controller.php]"]
  node_user[("User model<br/>[User.php]")]
end

subgraph group_chat["Live chat"]
  node_livewirechat["Chat interaction<br/>[Chat.php]"]
  node_chatindex["Chat screen<br/>[Index.php]"]
  node_chatbox["Message panel<br/>[ChatBox.php]"]
  node_chatlist["Conversation list<br/>[ChatList.php]"]
  node_userbrowser["User discovery<br/>[Users.php]"]
  node_conversation[("Conversation model<br/>[Conversation.php]")]
  node_message[("Message model<br/>[Message.php]")]
end

subgraph group_realtime["Realtime notifications"]
  node_sentnotification["Message sent event<br/>[MessageSent.php]"]
  node_readnotification["Message read event<br/>[MessageRead.php]"]
  node_jsclient["Realtime browser client<br/>[bootstrap.js]"]
  node_pusher{{"Pusher service"}}
end

node_visitor(("Browser user"))

node_visitor -->|"sends request"| node_front
node_front -->|"loads app"| node_bootstrap
node_bootstrap -->|"binds kernel"| node_httpkernel
node_routeservice -->|"registers routes"| node_webroutes
node_webroutes -->|"includes routes"| node_authroutes
node_authroutes -->|"dispatches auth"| node_authcontrollers
node_authcontrollers -->|"uses validation"| node_loginrequest
node_authcontrollers -->|"creates account"| node_user
node_webroutes -->|"dispatches profile"| node_profile
node_profile -->|"updates account"| node_user
node_authcontrollers -.->|"extends"| node_basecontroller
node_webroutes -->|"dispatches chat"| node_chatindex
node_webroutes -->|"dispatches chat"| node_livewirechat
node_webroutes -->|"dispatches discovery"| node_userbrowser
node_chatindex -->|"renders"| node_livewirechat
node_livewirechat -->|"uses model"| node_conversation
node_livewirechat -->|"uses model"| node_message
node_userbrowser -->|"uses model"| node_conversation
node_userbrowser -->|"queries users"| node_user
node_message -->|"references"| node_conversation
node_user -->|"defines relation"| node_conversation
node_chatbox -.->|"uses messages"| node_message
node_chatlist -.->|"shows conversations"| node_conversation
node_livewirechat -.->|"may dispatch"| node_sentnotification
node_livewirechat -.->|"may dispatch"| node_readnotification
node_jsclient -.->|"may connect"| node_pusher
node_sentnotification -.->|"may broadcast"| node_pusher
node_readnotification -.->|"may broadcast"| node_pusher

click node_front "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/public/index.php"
click node_bootstrap "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/bootstrap/app.php"
click node_httpkernel "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Kernel.php"
click node_routeservice "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Providers/RouteServiceProvider.php"
click node_webroutes "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/routes/web.php"
click node_authroutes "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/routes/auth.php"
click node_authcontrollers "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Controllers/Auth/RegisteredUserController.php"
click node_loginrequest "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Requests/Auth/LoginRequest.php"
click node_profile "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Controllers/ProfileController.php"
click node_basecontroller "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Controllers/Controller.php"
click node_livewirechat "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Livewire/Chat/Chat.php"
click node_chatindex "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Livewire/Chat/Index.php"
click node_chatbox "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Livewire/Chat/ChatBox.php"
click node_chatlist "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Livewire/Chat/ChatList.php"
click node_userbrowser "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Livewire/Users.php"
click node_conversation "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Models/Conversation.php"
click node_message "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Models/Message.php"
click node_user "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Models/User.php"
click node_sentnotification "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Notifications/MessageSent.php"
click node_readnotification "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Notifications/MessageRead.php"
click node_jsclient "https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/resources/js/bootstrap.js"

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_front,node_bootstrap,node_httpkernel,node_routeservice,node_webroutes,node_visitor toneBlue
class node_authroutes,node_authcontrollers,node_loginrequest,node_profile,node_basecontroller,node_user toneAmber
class node_livewirechat,node_chatindex,node_chatbox,node_chatlist,node_userbrowser,node_conversation,node_message toneMint
class node_sentnotification,node_readnotification,node_jsclient,node_pusher toneRose
```

## Components

### Request and routing

- [Laravel entry](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/public/index.php): `chat-pusher-and-livewire/public/index.php`
- [App bootstrap](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/bootstrap/app.php): `chat-pusher-and-livewire/bootstrap/app.php`
- [HTTP middleware](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Kernel.php): `chat-pusher-and-livewire/app/Http/Kernel.php`
- [Route registration](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Providers/RouteServiceProvider.php): `chat-pusher-and-livewire/app/Providers/RouteServiceProvider.php`
- [Web routes](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/routes/web.php): `chat-pusher-and-livewire/routes/web.php`

### Accounts and profiles

- [Account routes](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/routes/auth.php): `chat-pusher-and-livewire/routes/auth.php`
- [Authentication handlers](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Controllers/Auth/RegisteredUserController.php): `chat-pusher-and-livewire/app/Http/Controllers/Auth/RegisteredUserController.php`
- [Login validation](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Requests/Auth/LoginRequest.php): `chat-pusher-and-livewire/app/Http/Requests/Auth/LoginRequest.php`
- [Profile management](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Controllers/ProfileController.php): `chat-pusher-and-livewire/app/Http/Controllers/ProfileController.php`
- [Controller base](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Controllers/Controller.php): `chat-pusher-and-livewire/app/Http/Controllers/Controller.php`
- [User model](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Models/User.php): `chat-pusher-and-livewire/app/Models/User.php`

### Live chat

- [Chat interaction](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Livewire/Chat/Chat.php): `chat-pusher-and-livewire/app/Http/Livewire/Chat/Chat.php`
- [Chat screen](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Livewire/Chat/Index.php): `chat-pusher-and-livewire/app/Http/Livewire/Chat/Index.php`
- [Message panel](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Livewire/Chat/ChatBox.php): `chat-pusher-and-livewire/app/Http/Livewire/Chat/ChatBox.php`
- [Conversation list](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Livewire/Chat/ChatList.php): `chat-pusher-and-livewire/app/Http/Livewire/Chat/ChatList.php`
- [User discovery](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Http/Livewire/Users.php): `chat-pusher-and-livewire/app/Http/Livewire/Users.php`
- [Conversation model](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Models/Conversation.php): `chat-pusher-and-livewire/app/Models/Conversation.php`
- [Message model](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Models/Message.php): `chat-pusher-and-livewire/app/Models/Message.php`

### Realtime notifications

- [Message sent event](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Notifications/MessageSent.php): `chat-pusher-and-livewire/app/Notifications/MessageSent.php`
- [Message read event](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/app/Notifications/MessageRead.php): `chat-pusher-and-livewire/app/Notifications/MessageRead.php`
- [Realtime browser client](https://github.com/mahmoud-borkhsh/chat-pusher-and-livewire/blob/main/chat-pusher-and-livewire/resources/js/bootstrap.js): `chat-pusher-and-livewire/resources/js/bootstrap.js`
- **Pusher service**

### Other components

- **Browser user**

## Connections

- Browser user → Laravel entry: sends request (evidence: `chat-pusher-and-livewire/public/index.php`)
- Laravel entry → App bootstrap: loads app (evidence: `chat-pusher-and-livewire/public/index.php`)
- App bootstrap → HTTP middleware: binds kernel (evidence: `chat-pusher-and-livewire/bootstrap/app.php`)
- Route registration → Web routes: registers routes (evidence: `chat-pusher-and-livewire/app/Providers/RouteServiceProvider.php`)
- Web routes → Account routes: includes routes (evidence: `chat-pusher-and-livewire/routes/web.php`)
- Account routes → Authentication handlers: dispatches auth (evidence: `chat-pusher-and-livewire/routes/auth.php`)
- Authentication handlers → Login validation: uses validation
- Authentication handlers → User model: creates account (evidence: `chat-pusher-and-livewire/app/Http/Controllers/Auth/RegisteredUserController.php`)
- Web routes → Profile management: dispatches profile (evidence: `chat-pusher-and-livewire/routes/web.php`)
- Profile management → User model: updates account (evidence: `chat-pusher-and-livewire/app/Http/Controllers/ProfileController.php`)
- Authentication handlers → Controller base: extends (evidence: `chat-pusher-and-livewire/app/Http/Controllers/Auth/RegisteredUserController.php`)
- Web routes → Chat screen: dispatches chat (evidence: `chat-pusher-and-livewire/routes/web.php`)
- Web routes → Chat interaction: dispatches chat (evidence: `chat-pusher-and-livewire/routes/web.php`)
- Web routes → User discovery: dispatches discovery (evidence: `chat-pusher-and-livewire/routes/web.php`)
- Chat screen → Chat interaction: renders (evidence: `chat-pusher-and-livewire/app/Http/Livewire/Chat/Index.php`)
- Chat interaction → Conversation model: uses model (evidence: `chat-pusher-and-livewire/app/Http/Livewire/Chat/Chat.php`)
- Chat interaction → Message model: uses model (evidence: `chat-pusher-and-livewire/app/Http/Livewire/Chat/Chat.php`)
- User discovery → Conversation model: uses model (evidence: `chat-pusher-and-livewire/app/Http/Livewire/Users.php`)
- User discovery → User model: queries users (evidence: `chat-pusher-and-livewire/app/Http/Livewire/Users.php`)
- Message model → Conversation model: references (evidence: `chat-pusher-and-livewire/app/Models/Message.php`)
- User model → Conversation model: defines relation (evidence: `chat-pusher-and-livewire/app/Models/User.php`)
- Message panel → Message model: uses messages
- Conversation list → Conversation model: shows conversations
- Chat interaction → Message sent event: may dispatch
- Chat interaction → Message read event: may dispatch
- Realtime browser client → Pusher service: may connect
- Message sent event → Pusher service: may broadcast
- Message read event → Pusher service: may broadcast
