# akshithkl/zulip architecture

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

- Interactive diagram: https://gitdiagram.com/akshithkl/zulip
- Repository: https://github.com/akshithkl/zulip

## Overview

Zulip is an organized team-chat application built around topic-threaded conversations, with web-client interaction, server-side request handling, and supporting account, billing, import, and analytics capabilities. The graph follows the documented chat workflow and preserves major subsystems visible in the tree. Source-level evidence is limited to the supplied excerpts and SOURCE INDEX; unsampled links are omitted rather than inferred.

Main entry points: [`zerver/tornado/handlers.py`](https://github.com/akshithkl/zulip/blob/main/zerver/tornado/handlers.py) (Django request runtime), [`web/src/click_handlers.ts`](https://github.com/akshithkl/zulip/blob/main/web/src/click_handlers.ts) (Interaction handlers), [`corporate/lib/stripe_event_handler.py`](https://github.com/akshithkl/zulip/blob/main/corporate/lib/stripe_event_handler.py) (Billing event handling), [`corporate/views/webhook.py`](https://github.com/akshithkl/zulip/blob/main/corporate/views/webhook.py) (Billing webhook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Web application<br/>[app.ts]"]
  node_clicks["Interaction handlers<br/>[click_handlers.ts]"]
  node_compose["Message composition<br/>[compose_actions.ts]"]
  node_message_view["Message view<br/>[message_view.ts]"]
  node_recent_view["Recent conversations<br/>[recent_view_ui.ts]"]
  node_stream_list["Stream navigation<br/>[stream_list.ts]"]
end

subgraph group_server["Server runtime"]
  node_django_runtime["Django request runtime<br/>[handlers.py]"]
  node_async_entry["Tornado application<br/>[application.py]"]
  node_send_action["Message sending<br/>[message_send.py]"]
  node_streams["Stream operations<br/>[streams.py]"]
end

subgraph group_accounts["Accounts and billing"]
  node_auth["Authentication backends<br/>[backends.py]"]
  node_corporate_webhook["Billing webhook<br/>[webhook.py]"]
  node_stripe_events["Billing event handling"]
  node_stripe_api["Stripe billing<br/>[stripe.py]"]
  node_billing_state[("Billing records<br/>[stripe_state.py]")]
end

subgraph group_extensions["Integrations and import"]
  node_importers["Organization import"]
  node_bot_storage_view["Bot storage API<br/>[storage.py]"]
  node_bot_storage[("Bot storage<br/>[bot_storage.py]")]
end

subgraph group_operations["Analytics"]
  node_analytics["Analytics counts<br/>[counts.py]"]
  node_stats["Analytics views<br/>[stats.py]"]
end

node_person(("Team member"))

node_person -->|"uses"| node_app
node_app -->|"loads"| node_clicks
node_clicks -->|"invokes"| node_compose
node_clicks -->|"invokes"| node_message_view
node_person -->|"sends requests"| node_django_runtime
node_async_entry -->|"dispatches"| node_django_runtime
node_django_runtime -.->|"routes requests"| node_send_action
node_django_runtime -.->|"routes requests"| node_streams
node_person -.->|"authenticates"| node_auth
node_corporate_webhook -->|"dispatches events"| node_stripe_events
node_corporate_webhook -->|"reads and writes"| node_billing_state
node_stripe_events -->|"uses billing functions"| node_stripe_api
node_stripe_events -->|"updates records"| node_billing_state
node_bot_storage_view -->|"reads and writes"| node_bot_storage
node_person -.->|"imports history"| node_importers
node_analytics -.->|"supplies counts"| node_stats

click node_app "https://github.com/akshithkl/zulip/blob/main/web/src/bundles/app.ts"
click node_clicks "https://github.com/akshithkl/zulip/blob/main/web/src/click_handlers.ts"
click node_compose "https://github.com/akshithkl/zulip/blob/main/web/src/compose_actions.ts"
click node_message_view "https://github.com/akshithkl/zulip/blob/main/web/src/message_view.ts"
click node_recent_view "https://github.com/akshithkl/zulip/blob/main/web/src/recent_view_ui.ts"
click node_stream_list "https://github.com/akshithkl/zulip/blob/main/web/src/stream_list.ts"
click node_django_runtime "https://github.com/akshithkl/zulip/blob/main/zerver/tornado/handlers.py"
click node_async_entry "https://github.com/akshithkl/zulip/blob/main/zerver/tornado/application.py"
click node_send_action "https://github.com/akshithkl/zulip/blob/main/zerver/actions/message_send.py"
click node_streams "https://github.com/akshithkl/zulip/blob/main/zerver/lib/streams.py"
click node_auth "https://github.com/akshithkl/zulip/blob/main/zproject/backends.py"
click node_corporate_webhook "https://github.com/akshithkl/zulip/blob/main/corporate/views/webhook.py"
click node_stripe_events "https://github.com/akshithkl/zulip/blob/main/corporate/lib/stripe_event_handler.py"
click node_stripe_api "https://github.com/akshithkl/zulip/blob/main/corporate/lib/stripe.py"
click node_billing_state "https://github.com/akshithkl/zulip/blob/main/corporate/models/stripe_state.py"
click node_importers "https://github.com/akshithkl/zulip/tree/main/zerver/data_import"
click node_bot_storage_view "https://github.com/akshithkl/zulip/blob/main/zerver/views/storage.py"
click node_bot_storage "https://github.com/akshithkl/zulip/blob/main/zerver/lib/bot_storage.py"
click node_analytics "https://github.com/akshithkl/zulip/blob/main/analytics/lib/counts.py"
click node_stats "https://github.com/akshithkl/zulip/blob/main/analytics/views/stats.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_app,node_clicks,node_compose,node_message_view,node_recent_view,node_stream_list toneBlue
class node_django_runtime,node_async_entry,node_send_action,node_streams toneAmber
class node_auth,node_corporate_webhook,node_stripe_events,node_stripe_api,node_billing_state toneMint
class node_importers,node_bot_storage_view,node_bot_storage toneRose
class node_analytics,node_stats,node_person toneIndigo
```

## Components

### Web client

- [Web application](https://github.com/akshithkl/zulip/blob/main/web/src/bundles/app.ts): `web/src/bundles/app.ts`
- [Interaction handlers](https://github.com/akshithkl/zulip/blob/main/web/src/click_handlers.ts): `web/src/click_handlers.ts`
- [Message composition](https://github.com/akshithkl/zulip/blob/main/web/src/compose_actions.ts): `web/src/compose_actions.ts`
- [Message view](https://github.com/akshithkl/zulip/blob/main/web/src/message_view.ts): `web/src/message_view.ts`
- [Recent conversations](https://github.com/akshithkl/zulip/blob/main/web/src/recent_view_ui.ts): `web/src/recent_view_ui.ts`
- [Stream navigation](https://github.com/akshithkl/zulip/blob/main/web/src/stream_list.ts): `web/src/stream_list.ts`

### Server runtime

- [Django request runtime](https://github.com/akshithkl/zulip/blob/main/zerver/tornado/handlers.py): `zerver/tornado/handlers.py`
- [Tornado application](https://github.com/akshithkl/zulip/blob/main/zerver/tornado/application.py): `zerver/tornado/application.py`
- [Message sending](https://github.com/akshithkl/zulip/blob/main/zerver/actions/message_send.py): `zerver/actions/message_send.py`
- [Stream operations](https://github.com/akshithkl/zulip/blob/main/zerver/lib/streams.py): `zerver/lib/streams.py`

### Accounts and billing

- [Authentication backends](https://github.com/akshithkl/zulip/blob/main/zproject/backends.py): `zproject/backends.py`
- [Billing webhook](https://github.com/akshithkl/zulip/blob/main/corporate/views/webhook.py): `corporate/views/webhook.py`
- [Billing event handling](https://github.com/akshithkl/zulip/blob/main/corporate/lib/stripe_event_handler.py): `corporate/lib/stripe_event_handler.py`
- [Stripe billing](https://github.com/akshithkl/zulip/blob/main/corporate/lib/stripe.py): `corporate/lib/stripe.py`
- [Billing records](https://github.com/akshithkl/zulip/blob/main/corporate/models/stripe_state.py): `corporate/models/stripe_state.py`

### Integrations and import

- [Organization import](https://github.com/akshithkl/zulip/tree/main/zerver/data_import): `zerver/data_import`
- [Bot storage API](https://github.com/akshithkl/zulip/blob/main/zerver/views/storage.py): `zerver/views/storage.py`
- [Bot storage](https://github.com/akshithkl/zulip/blob/main/zerver/lib/bot_storage.py): `zerver/lib/bot_storage.py`

### Analytics

- [Analytics counts](https://github.com/akshithkl/zulip/blob/main/analytics/lib/counts.py): `analytics/lib/counts.py`
- [Analytics views](https://github.com/akshithkl/zulip/blob/main/analytics/views/stats.py): `analytics/views/stats.py`

### Other components

- **Team member**

## Connections

- Team member → Web application: uses
- Web application → Interaction handlers: loads (evidence: `web/src/bundles/app.ts`)
- Interaction handlers → Message composition: invokes (evidence: `web/src/click_handlers.ts`)
- Interaction handlers → Message view: invokes (evidence: `web/src/click_handlers.ts`)
- Team member → Django request runtime: sends requests
- Tornado application → Django request runtime: dispatches (evidence: `zerver/tornado/application.py`)
- Django request runtime → Message sending: routes requests
- Django request runtime → Stream operations: routes requests
- Team member → Authentication backends: authenticates
- Billing webhook → Billing event handling: dispatches events (evidence: `corporate/views/webhook.py`)
- Billing webhook → Billing records: reads and writes (evidence: `corporate/views/webhook.py`)
- Billing event handling → Stripe billing: uses billing functions (evidence: `corporate/lib/stripe_event_handler.py`)
- Billing event handling → Billing records: updates records (evidence: `corporate/lib/stripe_event_handler.py`)
- Bot storage API → Bot storage: reads and writes (evidence: `zerver/views/storage.py`)
- Team member → Organization import: imports history
- Analytics counts → Analytics views: supplies counts
