Skip to content

Latest commit

ย 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“Š Telegram Chat Analytics

Privacy-First | 100% Frontend | Zero Backend

A modern, beautiful web app for analyzing Telegram chat exports and generating comprehensive analytics dashboards. All processing happens locally in your browserโ€”no servers, no accounts, no data collection.


โœจ Highlights

  • ๐Ÿ”’ Complete Privacy - Everything runs locally, nothing sent to servers
  • โšก Instant Analysis - No server delays, real-time processing
  • ๐Ÿ“ˆ 40+ Metrics - Deep insights across 7 analytics categories
  • ๐ŸŽจ Beautiful UI - Modern dashboard with rich visualizations
  • ๐Ÿ“ฑ Responsive Design - Works on desktop, tablet, mobile
  • ๐ŸŽฌ Media Viewer - Browse photos, videos, voice notes with context
  • ๐Ÿ“ฅ Easy Export - Download as CSV, PDF, or print

๐ŸŽฏ Dashboard Overview

๐Ÿ“Š Overview Tab

View at a glance what's happening in your chat:

  • 4 Key Summary Cards (messages, participants, avg length, media %)
  • Top 5 Contributors with message counts
  • Hourly Activity Pattern (24-hour breakdown)
  • Word Cloud (top 20 most-used words, sized by frequency)
  • Top Reactions (emoji with reactor names)
  • Day-of-Week Activity Bar Chart

๐Ÿ” Detailed Analytics Tab

Deep dive into conversation patterns with 40+ metrics:

Core Statistics

  • Total messages, unique participants, date range
  • Messages per person per day, active days count

Response Patterns

  • Average reply time, fastest/slowest responses
  • Ignored messages count

Conversation Flow

  • Longest conversation streak
  • Longest inactive period
  • Peak activity day/hour/month

Media Breakdown

  • Photos, videos, voice notes, GIFs, stickers, documents, links
  • Click any media type to browse and view actual files

Sentiment Analysis

  • Positive/neutral/negative percentages
  • Per-user sentiment breakdown

Relationship Insights (5 scores: 0-100)

  • Mutual Engagement Score
  • Communication Balance
  • Interaction Consistency
  • Emotional Intensity
  • Activity Synchronization

Top Phrases

  • 15 most recurring 2+ word combinations
  • Example usage for context

๐Ÿค– AI Analysis Tab

Auto-generated insights:

  • Relationship Summary
  • Communication Style Profile
  • Main Topics Discussed (with frequency)
  • Key Events & Milestones

๐Ÿ“ฅ Export Tab

Download your insights:

  • Analytics CSV - All metrics in spreadsheet format
  • Messages CSV - Full message log with metadata
  • PDF Report - Multi-page professional report
  • Print - Direct browser print (โ†’ Save as PDF)

๐Ÿ“ˆ Visualizations

  • Activity Heatmap - GitHub-style calendar grid (daily messages)
  • Hourly Heatmap - 24-hour pattern at a glance
  • Word Frequency - Sized by usage (word cloud)
  • Emoji Breakdown - Top reactions with user attribution
  • Progress Bars - Relationship scores and metrics

๐Ÿš€ Getting Started

Prerequisites

  • Modern browser (Chrome, Firefox, Safari, Edge)
  • Node.js 16+ and npm

Installation

# 1. Clone the repo
git clone https://github.com/yoni-clef/telegram_chat_analyzer.git
cd telegram_chat_analyzer

# 2. Install dependencies
npm install
cd frontend && npm install

# 3. Start dev server
npm run dev

# Opens at http://localhost:5173

First Analysis

  1. Export Your Telegram Chat

    • Open Telegram Desktop
    • Settings โ†’ Data and Privacy โ†’ Export Telegram data
    • Select "HTML" format
    • Choose the chat(s) to export
    • Save to your computer
  2. Upload to Analyzer

    • Go to Upload page
    • Click "Choose folder" and select your export
    • Click "Analyze"
    • Wait for processing (a few seconds)
  3. View Your Dashboard

    • Automatically redirects to analytics
    • Explore all tabs and metrics
    • Click media items to view photos/videos

๐Ÿ“ Project Structure

telegram_chat_analyzer/
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Upload.tsx           # File upload interface
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ Dashboard.tsx        # Main analytics dashboard
โ”‚   โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Heatmap.tsx          # Activity visualizations
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ TimelineViewer.tsx   # Message browser
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ChartCard.tsx        # Chart components
โ”‚   โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ telegramParser.ts    # HTML โ†’ Messages
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ analytics.ts         # Basic metrics
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ advancedAnalytics.ts # 40+ metrics
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ exportUtils.ts       # CSV/PDF export
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ fileUtils.ts         # File handling
โ”‚   โ”‚   โ””โ”€โ”€ styles.css
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ vite.config.ts
โ””โ”€โ”€ ChatExport_*/                     # Sample data (for testing)

๐Ÿงฎ Analytics Explained

What Gets Measured?

Participation

  • Who talks the most?
  • How consistent are people?
  • What's the peak activity time?

Content

  • Most used words
  • Emoji reactions and who uses them
  • Types of media shared

Dynamics

  • How fast do people respond?
  • Are conversations continuous or sporadic?
  • When is everyone most active?

Sentiment

  • Positive vs. negative tone
  • Relationship intensity
  • Communication balance between members

๐Ÿ” Privacy & Security

This app is built for privacy:

โœ… All analysis happens in your browser
โœ… No accounts or login
โœ… No data stored on servers
โœ… Files never leave your computer
โœ… Exports saved locally only
โœ… Works 100% offline after first load

The only external requests:

  • Loading the web app itself (once)
  • Optional: Emoji font from CDN

No telemetry. No tracking. No analytics on your use.


๐Ÿ›  Technology Stack

Layer Tech
Frontend React 18 + TypeScript
Build Vite
Styling Tailwind CSS
Routing React Router v6
Parsing DOMParser (Browser API)
Export CSV text generation + Print API

Browser APIs Used

  • File API (webkitRelativePath for folder access)
  • localStorage (temporary data storage)
  • DOMParser (HTML parsing)
  • URL.createObjectURL (media blob URLs)

๐Ÿ“‹ Browser Support

Works on:

  • โœ… Chrome 90+
  • โœ… Firefox 88+
  • โœ… Safari 14+
  • โœ… Edge 90+

Requires:

  • ES6+ JavaScript
  • File API with folder access
  • Modern CSS (Grid, Flexbox)

๐Ÿ› Troubleshooting

"No messages*.html files found"

Issue: Upload folder doesn't contain HTML files
Solution:

  1. Make sure you exported as HTML (not JSON)
  2. Check that folder contains messages.html or messages1.html, etc.
  3. Upload the entire folder structure, not just individual files

Media Not Showing

Issue: Photos/videos don't display
Solution:

  1. Ensure you uploaded the complete folder
  2. Media files should be in photos/, videos/, etc.
  3. Check browser console (F12) for errors
  4. Try a fresh upload

Analysis Takes Too Long

Issue: Processing is slow with large chats
Solution:

  1. This is normal for chats with 100k+ messages
  2. Let it complete (can be 30+ seconds for huge exports)
  3. Close other browser tabs to free up memory

Storage Quota Exceeded

Issue: Browser localStorage is full
Solution:

  1. Clear browser cache/cookies
  2. Use incognito mode for next analysis
  3. Try a smaller chat export

๐Ÿš€ Production Build

cd frontend
npm run build
npm run preview

Output: Static files in dist/ folder ready to deploy

Deploy to:

  • Vercel (zero config)
  • Netlify (zero config)
  • GitHub Pages
  • Any static file host (Cloudflare, S3, etc.)

๐Ÿ’ก Tips & Tricks

For Best Results:

  • ๐Ÿ“Œ Use recent chat exports (more consistent format)
  • ๐ŸŽฏ Single-chat exports analyze faster than multi-chat
  • ๐Ÿ’พ Don't refresh during analysis (data will be lost)
  • ๐Ÿ“Š Use date filters in Detailed tab to zoom in on time periods
  • ๐ŸŽจ Click media to preview, then use browser back button

๐Ÿ“ Features in Depth

Media Viewer

  • Browse all photos/videos in a chat
  • View message context (sender, time, caption)
  • See who reacted with what emoji
  • Click to open full-size or play video

Export Options

  • CSV - Open in Excel/Google Sheets
  • PDF - Share with others or print
  • Print - Customizable via browser print settings
  • All exports respect active date filters

Date Filtering

  • In Detailed tab, set "From Date" and "To Date"
  • All metrics recalculate automatically
  • Perfect for analyzing specific periods
  • "Clear Filters" button resets everything

๐ŸŽจ Design Philosophy

  • Beautiful by default - No clutter, focused on key metrics
  • Dark-aware - Respects system dark mode
  • Mobile-first - Works great on phones
  • Accessible - Keyboard navigation, ARIA labels
  • Fast - Local processing = instant feedback

๐Ÿ“ž Support & Feedback

Found a bug? Want a feature?

  • ๐Ÿ“Œ GitHub Issues: [Report here]
  • ๐Ÿ’ญ GitHub Discussions: [Share ideas]
  • โญ Star this repo if you find it useful!

๐Ÿ“„ License

MIT License - Feel free to use, modify, and share


๐Ÿ™ Credits

Built with โค๏ธ by Yonatan Ashenafi

Connect:

Inspired by Telegram's official stats but with a focus on privacy and depth of analysis.


โฌ† back to top

Made with React, Tailwind, and a love for data ๐Ÿ“Š

Releases

Packages

Contributors

Languages