# munafio/chatify architecture

> Architecture diagram of the GitHub repository munafio/chatify, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/munafio/chatify
- Repository: https://github.com/munafio/chatify

## Overview

Chatify is a Laravel real-time messaging package with a bundled Vue/Pinia messenger and a headless JSON API. The typical workflow is an authenticated user opening the messenger, selecting or creating a conversation, exchanging messages and attachments, then receiving inbox and conversation updates over broadcasting. The graph preserves distinct conversation, messaging, attachment, realtime, and personalization capabilities. Edges are limited to relationships shown in excerpts, indexed references, or README statements; unsampled implementation paths are represented only where the tree supports them.

Main entry points: [`src/routes/api.php`](https://github.com/munafio/chatify/blob/main/src/routes/api.php) (JSON API routes), [`frontend/src/components/App.vue`](https://github.com/munafio/chatify/blob/main/frontend/src/components/App.vue) (Vue application), [`src/Http/Controllers/Api/ConversationController.php`](https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Api/ConversationController.php) (Conversation endpoints), [`src/Http/Controllers/Api/MessageController.php`](https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Api/MessageController.php) (Message endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Messenger client"]
  node_app["Vue application<br/>[App.vue]"]
  node_client_api["API client<br/>[client.ts]"]
  node_conversations_ui["Conversation navigation"]
  node_conversation_store["Conversation state<br/>[conversations.ts]"]
  node_message_store["Message state<br/>[messages.ts]"]
  node_thread_ui["Message thread<br/>[ThreadPanel.vue]"]
  node_settings_ui["Theme settings"]
  node_settings_store["Appearance state<br/>[config.ts]"]
  node_echo["Realtime subscriptions<br/>[useEcho.ts]"]
end

subgraph group_api["API and workflows"]
  node_web["Messenger page"]
  node_api_routes["JSON API routes<br/>[api.php]"]
  node_conversation_controller["Conversation endpoints"]
  node_message_controller["Message endpoints"]
  node_group_controller["Group participant endpoints"]
  node_attachment_controller["Attachment endpoints"]
  node_other_api["Contacts and profile API"]
  node_boot_data["Messenger boot data"]
end

subgraph group_domain["Conversation domain"]
  node_conversation_actions["Conversation actions"]
  node_message_actions["Message actions"]
  node_conversation_service["Conversation service"]
  node_message_service["Message service<br/>[MessageService.php]"]
  node_conversation_model[("Conversation records<br/>[Conversation.php]")]
  node_message_model[("Message records<br/>[Message.php]")]
  node_attachment_service[("Attachment storage")]
  node_block_service["Blocking and favorites<br/>[BlockService.php]"]
  node_storage[("Configured file storage")]
end

subgraph group_realtime["Realtime and presence"]
  node_inbox_broadcast["Inbox broadcasting"]
  node_events["Chat events"]
  node_presence["Presence and typing<br/>[usePresence.ts]"]
  node_broadcast_service["WebSocket provider"]
end

subgraph group_preferences["User preferences"]
  node_settings_controller["Settings endpoints"]
  node_settings_service["User settings service"]
  node_settings_model[("Saved settings<br/>[UserSetting.php]")]
end

node_user(("Authenticated user"))

node_user -->|"opens"| node_web
node_web -->|"loads boot data"| node_boot_data
node_web -->|"serves UI"| node_app
node_user -->|"uses"| node_app
node_app -->|"subscribes"| node_echo
node_app -->|"tracks presence"| node_presence
node_app -->|"handles events"| node_conversation_store
node_app -->|"handles events"| node_message_store
node_conversations_ui -->|"selects conversation"| node_conversation_store
node_user -->|"navigates"| node_conversations_ui
node_thread_ui -->|"presents messages"| node_user
node_thread_ui -.->|"requests messaging"| node_client_api
node_client_api -->|"calls JSON API"| node_api_routes
node_api_routes -->|"routes conversation requests"| node_conversation_controller
node_api_routes -->|"routes message requests"| node_message_controller
node_api_routes -->|"routes group requests"| node_group_controller
node_api_routes -->|"routes uploads"| node_attachment_controller
node_api_routes -->|"routes other features"| node_other_api
node_conversation_controller -->|"executes actions"| node_conversation_actions
node_conversation_controller -->|"broadcasts inbox"| node_inbox_broadcast
node_group_controller -->|"executes group actions"| node_conversation_actions
node_message_controller -->|"executes actions"| node_message_actions
node_message_controller -->|"queries messages"| node_message_service
node_conversation_actions -.->|"manages groups"| node_conversation_service
node_message_actions -.->|"updates messages"| node_message_service
node_conversation_service -->|"persists conversations"| node_conversation_model
node_message_service -.->|"queries messages"| node_message_model
node_attachment_controller -.->|"handles attachments"| node_attachment_service
node_attachment_service -->|"stores files"| node_storage
node_conversation_model -->|"resolves avatar URL"| node_attachment_service
node_conversation_controller -->|"returns conversation data"| node_conversation_model
node_message_controller -->|"returns message data"| node_message_model
node_boot_data -->|"loads user avatar"| node_attachment_service
node_boot_data -->|"loads block state"| node_block_service
node_conversation_service -->|"filters blocked users"| node_block_service
node_inbox_broadcast -.->|"dispatches updates"| node_events
node_echo -.->|"subscribes"| node_broadcast_service
node_broadcast_service -->|"delivers realtime updates"| node_user
node_api_routes -.->|"provides settings endpoints"| node_settings_controller
node_settings_ui -.->|"edits preferences"| node_settings_store
node_settings_store -->|"saves preferences"| node_client_api
node_settings_controller -.->|"updates settings"| node_settings_service
node_settings_service -.->|"persists settings"| node_settings_model

click node_web "https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Web/MessengerController.php"
click node_app "https://github.com/munafio/chatify/blob/main/frontend/src/components/App.vue"
click node_client_api "https://github.com/munafio/chatify/blob/main/frontend/src/api/client.ts"
click node_conversations_ui "https://github.com/munafio/chatify/blob/main/frontend/src/composables/useConversationRouting.ts"
click node_conversation_store "https://github.com/munafio/chatify/blob/main/frontend/src/stores/conversations.ts"
click node_message_store "https://github.com/munafio/chatify/blob/main/frontend/src/stores/messages.ts"
click node_thread_ui "https://github.com/munafio/chatify/blob/main/frontend/src/components/thread/ThreadPanel.vue"
click node_settings_ui "https://github.com/munafio/chatify/blob/main/frontend/src/components/settings/SettingsRootView.vue"
click node_settings_store "https://github.com/munafio/chatify/blob/main/frontend/src/stores/config.ts"
click node_api_routes "https://github.com/munafio/chatify/blob/main/src/routes/api.php"
click node_conversation_controller "https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Api/ConversationController.php"
click node_message_controller "https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Api/MessageController.php"
click node_group_controller "https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Api/GroupParticipantController.php"
click node_attachment_controller "https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Api/AttachmentController.php"
click node_other_api "https://github.com/munafio/chatify/tree/main/src/Http/Controllers/Api"
click node_conversation_actions "https://github.com/munafio/chatify/tree/main/src/Actions/Conversations"
click node_message_actions "https://github.com/munafio/chatify/tree/main/src/Actions/Messages"
click node_conversation_service "https://github.com/munafio/chatify/blob/main/src/Services/ConversationService.php"
click node_message_service "https://github.com/munafio/chatify/blob/main/src/Services/MessageService.php"
click node_conversation_model "https://github.com/munafio/chatify/blob/main/src/Models/Conversation.php"
click node_message_model "https://github.com/munafio/chatify/blob/main/src/Models/Message.php"
click node_attachment_service "https://github.com/munafio/chatify/blob/main/src/Services/AttachmentService.php"
click node_block_service "https://github.com/munafio/chatify/blob/main/src/Services/BlockService.php"
click node_boot_data "https://github.com/munafio/chatify/blob/main/src/Support/ChatifyBootData.php"
click node_inbox_broadcast "https://github.com/munafio/chatify/blob/main/src/Services/InboxBroadcastService.php"
click node_events "https://github.com/munafio/chatify/tree/main/src/Events"
click node_echo "https://github.com/munafio/chatify/blob/main/frontend/src/composables/useEcho.ts"
click node_presence "https://github.com/munafio/chatify/blob/main/frontend/src/composables/usePresence.ts"
click node_settings_controller "https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Api/UserSettingsController.php"
click node_settings_service "https://github.com/munafio/chatify/blob/main/src/Services/UserSettingsService.php"
click node_settings_model "https://github.com/munafio/chatify/blob/main/src/Models/UserSetting.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_app,node_client_api,node_conversations_ui,node_conversation_store,node_message_store,node_thread_ui,node_settings_ui,node_settings_store,node_echo,node_user toneBlue
class node_web,node_api_routes,node_conversation_controller,node_message_controller,node_group_controller,node_attachment_controller,node_other_api,node_boot_data toneAmber
class node_conversation_actions,node_message_actions,node_conversation_service,node_message_service,node_conversation_model,node_message_model,node_attachment_service,node_block_service,node_storage toneMint
class node_inbox_broadcast,node_events,node_presence,node_broadcast_service toneRose
class node_settings_controller,node_settings_service,node_settings_model toneIndigo
```

## Components

### Messenger client

- [Vue application](https://github.com/munafio/chatify/blob/main/frontend/src/components/App.vue): `frontend/src/components/App.vue`
- [API client](https://github.com/munafio/chatify/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [Conversation navigation](https://github.com/munafio/chatify/blob/main/frontend/src/composables/useConversationRouting.ts): `frontend/src/composables/useConversationRouting.ts`
- [Conversation state](https://github.com/munafio/chatify/blob/main/frontend/src/stores/conversations.ts): `frontend/src/stores/conversations.ts`
- [Message state](https://github.com/munafio/chatify/blob/main/frontend/src/stores/messages.ts): `frontend/src/stores/messages.ts`
- [Message thread](https://github.com/munafio/chatify/blob/main/frontend/src/components/thread/ThreadPanel.vue): `frontend/src/components/thread/ThreadPanel.vue`
- [Theme settings](https://github.com/munafio/chatify/blob/main/frontend/src/components/settings/SettingsRootView.vue): `frontend/src/components/settings/SettingsRootView.vue`
- [Appearance state](https://github.com/munafio/chatify/blob/main/frontend/src/stores/config.ts): `frontend/src/stores/config.ts`
- [Realtime subscriptions](https://github.com/munafio/chatify/blob/main/frontend/src/composables/useEcho.ts): `frontend/src/composables/useEcho.ts`

### API and workflows

- [Messenger page](https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Web/MessengerController.php): `src/Http/Controllers/Web/MessengerController.php`
- [JSON API routes](https://github.com/munafio/chatify/blob/main/src/routes/api.php): `src/routes/api.php`
- [Conversation endpoints](https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Api/ConversationController.php): `src/Http/Controllers/Api/ConversationController.php`
- [Message endpoints](https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Api/MessageController.php): `src/Http/Controllers/Api/MessageController.php`
- [Group participant endpoints](https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Api/GroupParticipantController.php): `src/Http/Controllers/Api/GroupParticipantController.php`
- [Attachment endpoints](https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Api/AttachmentController.php): `src/Http/Controllers/Api/AttachmentController.php`
- [Contacts and profile API](https://github.com/munafio/chatify/tree/main/src/Http/Controllers/Api): `src/Http/Controllers/Api`
- [Messenger boot data](https://github.com/munafio/chatify/blob/main/src/Support/ChatifyBootData.php): `src/Support/ChatifyBootData.php`

### Conversation domain

- [Conversation actions](https://github.com/munafio/chatify/tree/main/src/Actions/Conversations): `src/Actions/Conversations`
- [Message actions](https://github.com/munafio/chatify/tree/main/src/Actions/Messages): `src/Actions/Messages`
- [Conversation service](https://github.com/munafio/chatify/blob/main/src/Services/ConversationService.php): `src/Services/ConversationService.php`
- [Message service](https://github.com/munafio/chatify/blob/main/src/Services/MessageService.php): `src/Services/MessageService.php`
- [Conversation records](https://github.com/munafio/chatify/blob/main/src/Models/Conversation.php): `src/Models/Conversation.php`
- [Message records](https://github.com/munafio/chatify/blob/main/src/Models/Message.php): `src/Models/Message.php`
- [Attachment storage](https://github.com/munafio/chatify/blob/main/src/Services/AttachmentService.php): `src/Services/AttachmentService.php`
- [Blocking and favorites](https://github.com/munafio/chatify/blob/main/src/Services/BlockService.php): `src/Services/BlockService.php`
- **Configured file storage**

### Realtime and presence

- [Inbox broadcasting](https://github.com/munafio/chatify/blob/main/src/Services/InboxBroadcastService.php): `src/Services/InboxBroadcastService.php`
- [Chat events](https://github.com/munafio/chatify/tree/main/src/Events): `src/Events`
- [Presence and typing](https://github.com/munafio/chatify/blob/main/frontend/src/composables/usePresence.ts): `frontend/src/composables/usePresence.ts`
- **WebSocket provider**

### User preferences

- [Settings endpoints](https://github.com/munafio/chatify/blob/main/src/Http/Controllers/Api/UserSettingsController.php): `src/Http/Controllers/Api/UserSettingsController.php`
- [User settings service](https://github.com/munafio/chatify/blob/main/src/Services/UserSettingsService.php): `src/Services/UserSettingsService.php`
- [Saved settings](https://github.com/munafio/chatify/blob/main/src/Models/UserSetting.php): `src/Models/UserSetting.php`

### Other components

- **Authenticated user**

## Connections

- Authenticated user → Messenger page: opens (evidence: `README.md`)
- Messenger page → Messenger boot data: loads boot data (evidence: `src/Http/Controllers/Web/MessengerController.php`)
- Messenger page → Vue application: serves UI (evidence: `README.md`)
- Authenticated user → Vue application: uses (evidence: `README.md`)
- Vue application → Realtime subscriptions: subscribes (evidence: `frontend/src/components/App.vue`)
- Vue application → Presence and typing: tracks presence (evidence: `frontend/src/components/App.vue`)
- Vue application → Conversation state: handles events (evidence: `frontend/src/components/App.vue`)
- Vue application → Message state: handles events (evidence: `frontend/src/components/App.vue`)
- Conversation navigation → Conversation state: selects conversation (evidence: `frontend/src/composables/useConversationRouting.ts`)
- Authenticated user → Conversation navigation: navigates (evidence: `README.md`)
- Message thread → Authenticated user: presents messages (evidence: `README.md`)
- Message thread → API client: requests messaging
- API client → JSON API routes: calls JSON API (evidence: `README.md`)
- JSON API routes → Conversation endpoints: routes conversation requests (evidence: `src/routes/api.php`)
- JSON API routes → Message endpoints: routes message requests (evidence: `src/routes/api.php`)
- JSON API routes → Group participant endpoints: routes group requests (evidence: `src/routes/api.php`)
- JSON API routes → Attachment endpoints: routes uploads (evidence: `src/routes/api.php`)
- JSON API routes → Contacts and profile API: routes other features (evidence: `src/routes/api.php`)
- Conversation endpoints → Conversation actions: executes actions (evidence: `src/Http/Controllers/Api/ConversationController.php`)
- Conversation endpoints → Inbox broadcasting: broadcasts inbox (evidence: `src/Http/Controllers/Api/ConversationController.php`)
- Group participant endpoints → Conversation actions: executes group actions (evidence: `src/Http/Controllers/Api/GroupParticipantController.php`)
- Message endpoints → Message actions: executes actions (evidence: `src/Http/Controllers/Api/MessageController.php`)
- Message endpoints → Message service: queries messages (evidence: `src/Http/Controllers/Api/MessageController.php`)
- Conversation actions → Conversation service: manages groups (evidence: `src/Actions/Conversations/RemoveGroupParticipant.php`)
- Message actions → Message service: updates messages (evidence: `src/Actions/Messages/SendMessage.php`)
- Conversation service → Conversation records: persists conversations (evidence: `src/Services/ConversationService.php`)
- Message service → Message records: queries messages
- Attachment endpoints → Attachment storage: handles attachments (evidence: `src/Http/Controllers/Api/AttachmentController.php`)
- Attachment storage → Configured file storage: stores files (evidence: `src/Services/AttachmentService.php`)
- Conversation records → Attachment storage: resolves avatar URL (evidence: `src/Models/Conversation.php`)
- Conversation endpoints → Conversation records: returns conversation data (evidence: `src/Http/Controllers/Api/ConversationController.php`)
- Message endpoints → Message records: returns message data (evidence: `src/Http/Controllers/Api/MessageController.php`)
- Messenger boot data → Attachment storage: loads user avatar (evidence: `src/Support/ChatifyBootData.php`)
- Messenger boot data → Blocking and favorites: loads block state (evidence: `src/Support/ChatifyBootData.php`)
- Conversation service → Blocking and favorites: filters blocked users (evidence: `src/Services/ConversationService.php`)
- Inbox broadcasting → Chat events: dispatches updates
- Realtime subscriptions → WebSocket provider: subscribes
- WebSocket provider → Authenticated user: delivers realtime updates (evidence: `README.md`)
- JSON API routes → Settings endpoints: provides settings endpoints · Inferred; not shown in the code that was read. (evidence: `src/routes/api.php`)
- Theme settings → Appearance state: edits preferences
- Appearance state → API client: saves preferences (evidence: `frontend/src/stores/config.ts`)
- Settings endpoints → User settings service: updates settings
- User settings service → Saved settings: persists settings
