# atulsingh11-0/real-time-chat-app architecture

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

- Interactive diagram: https://gitdiagram.com/atulsingh11-0/real-time-chat-app
- Repository: https://github.com/atulsingh11-0/real-time-chat-app

## Overview

This Django Channels application serves a room list and room history over HTTP, then handles live chat over WebSockets: messages are persisted and broadcast to clients in the same room. Authentication and admin routes are configured through Django. The README also advertises online P2P video calling, but the sampled source does not show its implementation; that capability is retained as an unverified branch. Evidence is limited to the README and indexed excerpts.

Main entry points: [`wechatpp/chatapp/views.py`](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/chatapp/views.py) (Room views), [`wechatpp/chatapp/models.py`](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/chatapp/models.py) (Room and message models), [`wechatpp/wechatpp/consumers.py`](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/consumers.py) (Chat consumer), [`wechatpp/wechatpp/urls.py`](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/urls.py) (HTTP routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_browser["Browser UI<br/>[room.html]"]
  node_room_list["Room listing<br/>[rooms.html]"]
  node_login_page["Login page<br/>[login.html]"]
  node_p2p_video["P2P video<br/>[room.html]"]
  node_chat_routes["Chat routes<br/>[urls.py]"]
  node_room_views["Room views<br/>[views.py]"]
end

subgraph group_chat["Realtime chat"]
  node_ws_routes["WebSocket routes<br/>[routing.py]"]
  node_consumer["Chat consumer<br/>[consumers.py]"]
  node_channel_layer["Channel layer<br/>[settings.py]"]
end

subgraph group_data["Application data"]
  node_models["Room and message models<br/>[models.py]"]
  node_database[("SQLite database<br/>[settings.py]")]
end

subgraph group_platform["Django platform"]
  node_http_routes["HTTP routes<br/>[urls.py]"]
  node_auth["Authentication<br/>[settings.py]"]
  node_admin["Admin registration<br/>[admin.py]"]
  node_asgi["ASGI entry<br/>[asgi.py]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens pages"| node_http_routes
node_http_routes -->|"includes routes"| node_chat_routes
node_http_routes -->|"includes auth routes"| node_auth
node_chat_routes -->|"routes requests"| node_room_views
node_room_views -->|"queries rooms and messages"| node_models
node_room_views -->|"renders room list"| node_room_list
node_room_views -->|"renders room"| node_browser
node_visitor -->|"signs in"| node_login_page
node_admin -->|"registers models"| node_models
node_asgi -->|"routes WebSockets"| node_ws_routes
node_ws_routes -->|"dispatches connections"| node_consumer
node_consumer -->|"persists messages"| node_models
node_consumer -->|"sends room events"| node_channel_layer
node_models -.->|"stores records"| node_database
node_visitor -.->|"uses video calling"| node_p2p_video

click node_browser "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/templates/room.html"
click node_room_list "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/templates/rooms.html"
click node_login_page "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/templates/registration/login.html"
click node_p2p_video "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/templates/room.html"
click node_http_routes "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/urls.py"
click node_chat_routes "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/chatapp/urls.py"
click node_room_views "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/chatapp/views.py"
click node_auth "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/settings.py"
click node_admin "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/chatapp/admin.py"
click node_asgi "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/asgi.py"
click node_ws_routes "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/routing.py"
click node_consumer "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/consumers.py"
click node_channel_layer "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/settings.py"
click node_models "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/chatapp/models.py"
click node_database "https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/settings.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_browser,node_room_list,node_login_page,node_p2p_video,node_chat_routes,node_room_views toneBlue
class node_ws_routes,node_consumer,node_channel_layer toneAmber
class node_models,node_database toneMint
class node_http_routes,node_auth,node_admin,node_asgi toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Browser UI](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/templates/room.html): `wechatpp/templates/room.html`
- [Room listing](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/templates/rooms.html): `wechatpp/templates/rooms.html`
- [Login page](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/templates/registration/login.html): `wechatpp/templates/registration/login.html`
- [P2P video](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/templates/room.html): `wechatpp/templates/room.html`
- [Chat routes](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/chatapp/urls.py): `wechatpp/chatapp/urls.py`
- [Room views](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/chatapp/views.py): `wechatpp/chatapp/views.py`

### Realtime chat

- [WebSocket routes](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/routing.py): `wechatpp/wechatpp/routing.py`
- [Chat consumer](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/consumers.py): `wechatpp/wechatpp/consumers.py`
- [Channel layer](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/settings.py): `wechatpp/wechatpp/settings.py`

### Application data

- [Room and message models](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/chatapp/models.py): `wechatpp/chatapp/models.py`
- [SQLite database](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/settings.py): `wechatpp/wechatpp/settings.py`

### Django platform

- [HTTP routes](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/urls.py): `wechatpp/wechatpp/urls.py`
- [Authentication](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/settings.py): `wechatpp/wechatpp/settings.py`
- [Admin registration](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/chatapp/admin.py): `wechatpp/chatapp/admin.py`
- [ASGI entry](https://github.com/atulsingh11-0/real-time-chat-app/blob/main/wechatpp/wechatpp/asgi.py): `wechatpp/wechatpp/asgi.py`

### Other components

- **Visitor**

## Connections

- Visitor → HTTP routes: opens pages (evidence: `wechatpp/wechatpp/urls.py`)
- HTTP routes → Chat routes: includes routes (evidence: `wechatpp/wechatpp/urls.py`)
- HTTP routes → Authentication: includes auth routes (evidence: `wechatpp/wechatpp/urls.py`)
- Chat routes → Room views: routes requests (evidence: `wechatpp/chatapp/urls.py`)
- Room views → Room and message models: queries rooms and messages (evidence: `wechatpp/chatapp/views.py`)
- Room views → Room listing: renders room list (evidence: `wechatpp/chatapp/views.py`)
- Room views → Browser UI: renders room (evidence: `wechatpp/chatapp/views.py`)
- Visitor → Login page: signs in
- Admin registration → Room and message models: registers models (evidence: `wechatpp/chatapp/admin.py`)
- ASGI entry → WebSocket routes: routes WebSockets (evidence: `wechatpp/wechatpp/asgi.py`)
- WebSocket routes → Chat consumer: dispatches connections (evidence: `wechatpp/wechatpp/routing.py`)
- Chat consumer → Room and message models: persists messages (evidence: `wechatpp/wechatpp/consumers.py`)
- Chat consumer → Channel layer: sends room events (evidence: `wechatpp/wechatpp/consumers.py`)
- Room and message models → SQLite database: stores records
- Visitor → P2P video: uses video calling (evidence: `README.md`)
