# atetoon/whatsapp-wrapped architecture

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

- Interactive diagram: https://gitdiagram.com/atetoon/whatsapp-wrapped
- Repository: https://github.com/atetoon/whatsapp-wrapped

## Overview

WhatsApp Wrapped is a browser-based chat-export analytics app. The user selects or drops a WhatsApp .txt export; the page reads it locally, parses messages, computes statistics, then presents an animated, navigable 13-card deck. The stats implementation covers reply timing, activity patterns, media, deletes, drama, and a rule-based relationship verdict. A separate anonymous usage counter is the documented server-side exception. Relationships follow the excerpts, SOURCE INDEX references, and README; unexcerpted counter wiring is not inferred.

Main entry points: [`components/slides.tsx`](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/slides.tsx) (Analytics cards), [`app/page.tsx`](https://github.com/atetoon/whatsapp-wrapped/blob/main/app/page.tsx) (Home workflow), [`components/UploadScreen.tsx`](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/UploadScreen.tsx) (Upload screen), [`components/WrappedDeck.tsx`](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/WrappedDeck.tsx) (Card deck)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Upload and analysis"]
  node_home["Home workflow<br/>[page.tsx]"]
  node_upload["Upload screen<br/>[UploadScreen.tsx]"]
  node_parser["Export parser<br/>[parser.ts]"]
  node_stats["Chat statistics<br/>[stats.ts]"]
  node_types["Chat data types<br/>[types.ts]"]
end

subgraph group_deck["Wrapped deck"]
  node_deck["Card deck<br/>[WrappedDeck.tsx]"]
  node_slides["Analytics cards<br/>[slides.tsx]"]
  node_format["Display formatting<br/>[format.ts]"]
end

subgraph group_effects["Deck effects"]
  node_ghost["Ghost stack<br/>[GhostStack.tsx]"]
  node_progress["Progress ring<br/>[ProgressRing.tsx]"]
  node_odometer["Odometer<br/>[Odometer.tsx]"]
  node_scramble["Scramble text<br/>[ScrambleText.tsx]"]
  node_stagger["Stagger text<br/>[StaggerText.tsx]"]
  node_shine["Shine wrapper<br/>[ShineWrap.tsx]"]
  node_chart["Mini bar chart<br/>[MiniBarChart.tsx]"]
  node_confetti["Confetti burst<br/>[ConfettiBurst.tsx]"]
end

subgraph group_counter["Usage counter"]
  node_usage["Usage counter<br/>[UsageCounter.tsx]"]
  node_countapi["Count endpoint<br/>[route.ts]"]
  node_redis[("Upstash Redis")]
end

node_visitor(("Chat owner"))
node_export["Chat export"]

node_visitor -->|"selects export"| node_upload
node_export -->|"supplies file"| node_upload
node_upload -->|"passes file"| node_home
node_home -->|"parses locally"| node_parser
node_parser -->|"returns messages"| node_home
node_home -->|"computes stats"| node_stats
node_stats -->|"uses data types"| node_types
node_parser -->|"uses message type"| node_types
node_home -->|"renders results"| node_deck
node_home -->|"renders intake"| node_upload
node_deck -->|"builds cards"| node_slides
node_slides -->|"formats values"| node_format
node_slides -->|"renders numbers"| node_odometer
node_slides -->|"renders headings"| node_scramble
node_slides -->|"reveals text"| node_stagger
node_slides -->|"wraps highlights"| node_shine
node_slides -->|"renders charts"| node_chart
node_slides -->|"renders finale"| node_confetti
node_deck -->|"renders stack"| node_ghost
node_deck -->|"renders progress"| node_progress
node_upload -->|"renders counter"| node_usage
node_home -->|"posts usage"| node_countapi
node_countapi -.->|"tracks usage"| node_redis

click node_home "https://github.com/atetoon/whatsapp-wrapped/blob/main/app/page.tsx"
click node_upload "https://github.com/atetoon/whatsapp-wrapped/blob/main/components/UploadScreen.tsx"
click node_parser "https://github.com/atetoon/whatsapp-wrapped/blob/main/lib/parser.ts"
click node_stats "https://github.com/atetoon/whatsapp-wrapped/blob/main/lib/stats.ts"
click node_types "https://github.com/atetoon/whatsapp-wrapped/blob/main/lib/types.ts"
click node_deck "https://github.com/atetoon/whatsapp-wrapped/blob/main/components/WrappedDeck.tsx"
click node_slides "https://github.com/atetoon/whatsapp-wrapped/blob/main/components/slides.tsx"
click node_format "https://github.com/atetoon/whatsapp-wrapped/blob/main/lib/format.ts"
click node_ghost "https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/GhostStack.tsx"
click node_progress "https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/ProgressRing.tsx"
click node_odometer "https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/Odometer.tsx"
click node_scramble "https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/ScrambleText.tsx"
click node_stagger "https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/StaggerText.tsx"
click node_shine "https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/ShineWrap.tsx"
click node_chart "https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/MiniBarChart.tsx"
click node_confetti "https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/ConfettiBurst.tsx"
click node_usage "https://github.com/atetoon/whatsapp-wrapped/blob/main/components/UsageCounter.tsx"
click node_countapi "https://github.com/atetoon/whatsapp-wrapped/blob/main/app/api/count/route.ts"

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_home,node_upload,node_parser,node_stats,node_types toneBlue
class node_deck,node_slides,node_format toneAmber
class node_ghost,node_progress,node_odometer,node_scramble,node_stagger,node_shine,node_chart,node_confetti toneMint
class node_usage,node_countapi,node_redis toneRose
class node_visitor,node_export toneIndigo
```

## Components

### Upload and analysis

- [Home workflow](https://github.com/atetoon/whatsapp-wrapped/blob/main/app/page.tsx): `app/page.tsx`
- [Upload screen](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/UploadScreen.tsx): `components/UploadScreen.tsx`
- [Export parser](https://github.com/atetoon/whatsapp-wrapped/blob/main/lib/parser.ts): `lib/parser.ts`
- [Chat statistics](https://github.com/atetoon/whatsapp-wrapped/blob/main/lib/stats.ts): `lib/stats.ts`
- [Chat data types](https://github.com/atetoon/whatsapp-wrapped/blob/main/lib/types.ts): `lib/types.ts`

### Wrapped deck

- [Card deck](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/WrappedDeck.tsx): `components/WrappedDeck.tsx`
- [Analytics cards](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/slides.tsx): `components/slides.tsx`
- [Display formatting](https://github.com/atetoon/whatsapp-wrapped/blob/main/lib/format.ts): `lib/format.ts`

### Deck effects

- [Ghost stack](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/GhostStack.tsx): `components/effects/GhostStack.tsx`
- [Progress ring](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/ProgressRing.tsx): `components/effects/ProgressRing.tsx`
- [Odometer](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/Odometer.tsx): `components/effects/Odometer.tsx`
- [Scramble text](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/ScrambleText.tsx): `components/effects/ScrambleText.tsx`
- [Stagger text](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/StaggerText.tsx): `components/effects/StaggerText.tsx`
- [Shine wrapper](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/ShineWrap.tsx): `components/effects/ShineWrap.tsx`
- [Mini bar chart](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/MiniBarChart.tsx): `components/effects/MiniBarChart.tsx`
- [Confetti burst](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/effects/ConfettiBurst.tsx): `components/effects/ConfettiBurst.tsx`

### Usage counter

- [Usage counter](https://github.com/atetoon/whatsapp-wrapped/blob/main/components/UsageCounter.tsx): `components/UsageCounter.tsx`
- [Count endpoint](https://github.com/atetoon/whatsapp-wrapped/blob/main/app/api/count/route.ts): `app/api/count/route.ts`
- **Upstash Redis**

### Other components

- **Chat owner**
- **Chat export**

## Connections

- Chat owner → Upload screen: selects export (evidence: `components/UploadScreen.tsx`)
- Chat export → Upload screen: supplies file (evidence: `components/UploadScreen.tsx`)
- Upload screen → Home workflow: passes file (evidence: `components/UploadScreen.tsx`)
- Home workflow → Export parser: parses locally (evidence: `app/page.tsx`)
- Export parser → Home workflow: returns messages (evidence: `app/page.tsx`)
- Home workflow → Chat statistics: computes stats (evidence: `app/page.tsx`)
- Chat statistics → Chat data types: uses data types (evidence: `lib/stats.ts`)
- Export parser → Chat data types: uses message type (evidence: `lib/parser.ts`)
- Home workflow → Card deck: renders results (evidence: `app/page.tsx`)
- Home workflow → Upload screen: renders intake (evidence: `app/page.tsx`)
- Card deck → Analytics cards: builds cards (evidence: `components/WrappedDeck.tsx`)
- Analytics cards → Display formatting: formats values (evidence: `components/slides.tsx`)
- Analytics cards → Odometer: renders numbers (evidence: `components/slides.tsx`)
- Analytics cards → Scramble text: renders headings (evidence: `components/slides.tsx`)
- Analytics cards → Stagger text: reveals text (evidence: `components/slides.tsx`)
- Analytics cards → Shine wrapper: wraps highlights (evidence: `components/slides.tsx`)
- Analytics cards → Mini bar chart: renders charts (evidence: `components/slides.tsx`)
- Analytics cards → Confetti burst: renders finale (evidence: `components/slides.tsx`)
- Card deck → Ghost stack: renders stack (evidence: `components/WrappedDeck.tsx`)
- Card deck → Progress ring: renders progress (evidence: `components/WrappedDeck.tsx`)
- Upload screen → Usage counter: renders counter (evidence: `components/UploadScreen.tsx`)
- Home workflow → Count endpoint: posts usage (evidence: `app/page.tsx`)
- Count endpoint → Upstash Redis: tracks usage (evidence: `README.md`)
