# nirajgitnest/chattrix architecture

> Architecture diagram of the GitHub repository nirajgitnest/chattrix, 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/nirajgitnest/chattrix
- Repository: https://github.com/nirajgitnest/chattrix

## Overview

Chattrix is a Streamlit dashboard for analyzing exported WhatsApp chats. The user uploads a chat, the app preprocesses it into structured rows, and the dashboard displays the processed data with CSV download plus on-demand statistics, activity, word-frequency, and emoji analyses. The app invokes preprocessing and analytics; those analytics operate on the resulting dataframe. The source excerpts show these main calls, but not deeper implementation details for Streamlit or its dependencies.

Main entry points: [`app.py`](https://github.com/nirajgitnest/chattrix/blob/main/app.py) (Streamlit dashboard), [`preprocessor.py`](https://github.com/nirajgitnest/chattrix/blob/main/preprocessor.py) (Chat preprocessor), [`helper.py`](https://github.com/nirajgitnest/chattrix/blob/main/helper.py) (Chat statistics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
  node_data_view["Structured data viewer<br/>[app.py]"]
  node_csv_download["CSV download<br/>[app.py]"]
end

subgraph group_processing["Chat Processing"]
  node_chat_parser["Chat preprocessor<br/>[preprocessor.py]"]
end

subgraph group_analysis["Chat Analytics"]
  node_stats["Chat statistics<br/>[helper.py]"]
  node_active_users["Active users<br/>[helper.py]"]
  node_common_words["Common words<br/>[helper.py]"]
  node_emoji_analysis["Emoji analysis<br/>[helper.py]"]
end

node_user(("Chat uploader"))

node_user -->|"uploads chat"| node_dashboard
node_dashboard -->|"preprocesses chat"| node_chat_parser
node_chat_parser -->|"returns dataframe"| node_dashboard
node_dashboard -->|"renders dataframe"| node_data_view
node_dashboard -->|"offers download"| node_csv_download
node_dashboard -->|"fetches statistics"| node_stats
node_dashboard -->|"fetches activity"| node_active_users
node_dashboard -->|"fetches word counts"| node_common_words
node_dashboard -->|"fetches emoji counts"| node_emoji_analysis

click node_dashboard "https://github.com/nirajgitnest/chattrix/blob/main/app.py"
click node_chat_parser "https://github.com/nirajgitnest/chattrix/blob/main/preprocessor.py"
click node_data_view "https://github.com/nirajgitnest/chattrix/blob/main/app.py"
click node_csv_download "https://github.com/nirajgitnest/chattrix/blob/main/app.py"
click node_stats "https://github.com/nirajgitnest/chattrix/blob/main/helper.py"
click node_active_users "https://github.com/nirajgitnest/chattrix/blob/main/helper.py"
click node_common_words "https://github.com/nirajgitnest/chattrix/blob/main/helper.py"
click node_emoji_analysis "https://github.com/nirajgitnest/chattrix/blob/main/helper.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_dashboard,node_data_view,node_csv_download toneBlue
class node_chat_parser toneAmber
class node_stats,node_active_users,node_common_words,node_emoji_analysis toneMint
class node_user toneIndigo
```

## Components

### Dashboard

- [Streamlit dashboard](https://github.com/nirajgitnest/chattrix/blob/main/app.py): `app.py`
- [Structured data viewer](https://github.com/nirajgitnest/chattrix/blob/main/app.py): `app.py`
- [CSV download](https://github.com/nirajgitnest/chattrix/blob/main/app.py): `app.py`

### Chat Processing

- [Chat preprocessor](https://github.com/nirajgitnest/chattrix/blob/main/preprocessor.py): `preprocessor.py`

### Chat Analytics

- [Chat statistics](https://github.com/nirajgitnest/chattrix/blob/main/helper.py): `helper.py`
- [Active users](https://github.com/nirajgitnest/chattrix/blob/main/helper.py): `helper.py`
- [Common words](https://github.com/nirajgitnest/chattrix/blob/main/helper.py): `helper.py`
- [Emoji analysis](https://github.com/nirajgitnest/chattrix/blob/main/helper.py): `helper.py`

### Other components

- **Chat uploader**

## Connections

- Chat uploader → Streamlit dashboard: uploads chat (evidence: `app.py`)
- Streamlit dashboard → Chat preprocessor: preprocesses chat (evidence: `app.py`)
- Chat preprocessor → Streamlit dashboard: returns dataframe (evidence: `app.py`)
- Streamlit dashboard → Structured data viewer: renders dataframe (evidence: `app.py`)
- Streamlit dashboard → CSV download: offers download (evidence: `app.py`)
- Streamlit dashboard → Chat statistics: fetches statistics (evidence: `app.py`)
- Streamlit dashboard → Active users: fetches activity (evidence: `app.py`)
- Streamlit dashboard → Common words: fetches word counts (evidence: `app.py`)
- Streamlit dashboard → Emoji analysis: fetches emoji counts (evidence: `app.py`)
