# omarzidane0/chat-system architecture

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

- Interactive diagram: https://gitdiagram.com/omarzidane0/chat-system
- Repository: https://github.com/omarzidane0/chat-system

## Overview

msg↗ is a Django chat application with account registration, login, JWT-protected pages, password reset by email, conversation management, and WebSocket messaging. The principal path is browser authentication, protected conversation access, then real-time message synchronization and delivery. The graph separates account flows, conversation pages, and WebSocket handling. Source excerpts establish the main calls and persistence behavior; UI-to-WebSocket wiring and some project URL configuration are not shown, so those links are omitted or marked unverified.

Main entry points: [`messageup/conversations/views.py`](https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/views.py) (Conversation pages), [`messageup/accounts/views.py`](https://github.com/omarzidane0/chat-system/blob/main/messageup/accounts/views.py) (Account workflows), [`messageup/conversations/consumers.py`](https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/consumers.py) (Conversation consumer), [`messageup/accounts/models.py`](https://github.com/omarzidane0/chat-system/blob/main/messageup/accounts/models.py) (Account records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts &amp; Security"]
  node_account_pages["Account pages"]
  node_account_ui["Account interactions"]
  node_account_routes["Account routes<br/>[urls.py]"]
  node_account_views["Account workflows<br/>[views.py]"]
  node_account_models[("Account records<br/>[models.py]")]
  node_jwt_guard["HTTP JWT guard<br/>[decorators.py]"]
end

subgraph group_conversations["Conversation Experience"]
  node_conversation_routes["Conversation routes<br/>[urls.py]"]
  node_conversation_views["Conversation pages<br/>[views.py]"]
  node_conversation_ui["Conversation interface<br/>[conversations.html]"]
  node_conversation_js["Chat interactions<br/>[conversations.js]"]
  node_conversation_models[("Conversation records<br/>[models.py]")]
end

subgraph group_realtime["WebSocket Messaging"]
  node_websocket_routes["WebSocket routes<br/>[routing.py]"]
  node_jwt_ws["WebSocket JWT auth<br/>[jwt_auth.py]"]
  node_consumer["Conversation consumer<br/>[consumers.py]"]
end

subgraph group_platform["Django Runtime"]
  node_asgi["ASGI dispatcher<br/>[asgi.py]"]
end

node_browser(("Browser user"))
node_email_service["SMTP email"]

node_browser -->|"uses"| node_account_pages
node_browser -->|"interacts"| node_account_ui
node_account_routes -->|"routes"| node_account_views
node_account_views -->|"reads and writes"| node_account_models
node_account_views -->|"sends reset email"| node_email_service
node_browser -.->|"requests"| node_conversation_routes
node_conversation_routes -->|"routes"| node_conversation_views
node_conversation_views -->|"requires token"| node_jwt_guard
node_jwt_guard -->|"loads account"| node_account_models
node_conversation_views -->|"queries and creates"| node_conversation_models
node_conversation_views -->|"renders"| node_conversation_ui
node_browser -->|"uses"| node_conversation_js
node_conversation_js -.->|"uses WebSocket"| node_consumer
node_asgi -->|"wraps"| node_jwt_ws
node_asgi -->|"dispatches"| node_websocket_routes
node_websocket_routes -->|"routes"| node_consumer
node_jwt_ws -->|"loads account"| node_account_models
node_consumer -->|"reads and writes"| node_conversation_models

click node_account_pages "https://github.com/omarzidane0/chat-system/tree/main/messageup/accounts/templates"
click node_account_ui "https://github.com/omarzidane0/chat-system/tree/main/messageup/accounts/static/accounts/js"
click node_account_routes "https://github.com/omarzidane0/chat-system/blob/main/messageup/accounts/urls.py"
click node_account_views "https://github.com/omarzidane0/chat-system/blob/main/messageup/accounts/views.py"
click node_account_models "https://github.com/omarzidane0/chat-system/blob/main/messageup/accounts/models.py"
click node_jwt_guard "https://github.com/omarzidane0/chat-system/blob/main/messageup/accounts/decorators.py"
click node_conversation_routes "https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/urls.py"
click node_conversation_views "https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/views.py"
click node_conversation_ui "https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/templates/conversations.html"
click node_conversation_js "https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/static/conversations/js/conversations.js"
click node_conversation_models "https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/models.py"
click node_websocket_routes "https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/routing.py"
click node_jwt_ws "https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/jwt_auth.py"
click node_consumer "https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/consumers.py"
click node_asgi "https://github.com/omarzidane0/chat-system/blob/main/messageup/messageup/asgi.py"

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_account_pages,node_account_ui,node_account_routes,node_account_views,node_account_models,node_jwt_guard,node_browser toneBlue
class node_conversation_routes,node_conversation_views,node_conversation_ui,node_conversation_js,node_conversation_models toneAmber
class node_websocket_routes,node_jwt_ws,node_consumer toneMint
class node_asgi toneRose
class node_email_service toneIndigo
```

## Components

### Accounts & Security

- [Account pages](https://github.com/omarzidane0/chat-system/tree/main/messageup/accounts/templates): `messageup/accounts/templates`
- [Account interactions](https://github.com/omarzidane0/chat-system/tree/main/messageup/accounts/static/accounts/js): `messageup/accounts/static/accounts/js`
- [Account routes](https://github.com/omarzidane0/chat-system/blob/main/messageup/accounts/urls.py): `messageup/accounts/urls.py`
- [Account workflows](https://github.com/omarzidane0/chat-system/blob/main/messageup/accounts/views.py): `messageup/accounts/views.py`
- [Account records](https://github.com/omarzidane0/chat-system/blob/main/messageup/accounts/models.py): `messageup/accounts/models.py`
- [HTTP JWT guard](https://github.com/omarzidane0/chat-system/blob/main/messageup/accounts/decorators.py): `messageup/accounts/decorators.py`

### Conversation Experience

- [Conversation routes](https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/urls.py): `messageup/conversations/urls.py`
- [Conversation pages](https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/views.py): `messageup/conversations/views.py`
- [Conversation interface](https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/templates/conversations.html): `messageup/conversations/templates/conversations.html`
- [Chat interactions](https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/static/conversations/js/conversations.js): `messageup/conversations/static/conversations/js/conversations.js`
- [Conversation records](https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/models.py): `messageup/conversations/models.py`

### WebSocket Messaging

- [WebSocket routes](https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/routing.py): `messageup/conversations/routing.py`
- [WebSocket JWT auth](https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/jwt_auth.py): `messageup/conversations/jwt_auth.py`
- [Conversation consumer](https://github.com/omarzidane0/chat-system/blob/main/messageup/conversations/consumers.py): `messageup/conversations/consumers.py`

### Django Runtime

- [ASGI dispatcher](https://github.com/omarzidane0/chat-system/blob/main/messageup/messageup/asgi.py): `messageup/messageup/asgi.py`

### Other components

- **Browser user**
- **SMTP email**

## Connections

- Browser user → Account pages: uses (evidence: `README.md`)
- Browser user → Account interactions: interacts (evidence: `README.md`)
- Account routes → Account workflows: routes (evidence: `messageup/accounts/urls.py`)
- Account workflows → Account records: reads and writes (evidence: `messageup/accounts/views.py`)
- Account workflows → SMTP email: sends reset email (evidence: `messageup/accounts/views.py`)
- Browser user → Conversation routes: requests
- Conversation routes → Conversation pages: routes (evidence: `messageup/conversations/urls.py`)
- Conversation pages → HTTP JWT guard: requires token (evidence: `messageup/conversations/views.py`)
- HTTP JWT guard → Account records: loads account (evidence: `messageup/accounts/decorators.py`)
- Conversation pages → Conversation records: queries and creates (evidence: `messageup/conversations/views.py`)
- Conversation pages → Conversation interface: renders (evidence: `messageup/conversations/views.py`)
- Browser user → Chat interactions: uses (evidence: `README.md`)
- Chat interactions → Conversation consumer: uses WebSocket
- ASGI dispatcher → WebSocket JWT auth: wraps (evidence: `messageup/messageup/asgi.py`)
- ASGI dispatcher → WebSocket routes: dispatches (evidence: `messageup/messageup/asgi.py`)
- WebSocket routes → Conversation consumer: routes (evidence: `messageup/conversations/routing.py`)
- WebSocket JWT auth → Account records: loads account (evidence: `messageup/conversations/jwt_auth.py`)
- Conversation consumer → Conversation records: reads and writes (evidence: `messageup/conversations/consumers.py`)
