# lifearchiveproject/wechatdataanalysis architecture

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

- Interactive diagram: https://gitdiagram.com/lifearchiveproject/wechatdataanalysis
- Repository: https://github.com/lifearchiveproject/wechatdataanalysis

## Overview

WeChatDataAnalysis is a desktop and web-style application for decrypting and analyzing WeChat data. The main user journey is to select/import local account data, decrypt it, browse messages and other records, then search, export, or generate an annual summary. The README also documents live chat updates, AI summaries and alerts, optional semantic search, media/voice capabilities, and advanced paid online actions. The graph reflects those documented product branches and sampled backend relationships; several frontend-to-backend links are documented only at the product level.

Main entry points: [`src/wechat_decrypt_tool/backend_entry.py`](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/backend_entry.py) (Backend API), [`frontend/app.vue`](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/frontend/app.vue) (Application UI), [`src/wechat_decrypt_tool/chat_export_service.py`](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/chat_export_service.py) (Chat Export), [`src/wechat_decrypt_tool/wechat_decrypt.py`](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/wechat_decrypt.py) (Database Decryption)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop Runtime"]
  node_desktop_shell["Desktop Shell<br/>[main.cjs]"]
  node_backend["Backend API<br/>[backend_entry.py]"]
  node_frontend["Application UI<br/>[app.vue]"]
end

subgraph group_data["Data Access"]
  node_key_capture["macOS Key Capture<br/>[app.py]"]
  node_decrypt["Database Decryption<br/>[wechat_decrypt.py]"]
  node_account_identity["Account Identity"]
  node_native_core["Native Core"]
  node_realtime["Live Chat Reading<br/>[wcdb_realtime.py]"]
end

subgraph group_experience["Browsing &amp; Export"]
  node_chat_browse["Chat Browsing<br/>[&#91;&#91;username&#93;&#93;.vue]"]
  node_chat_helpers["Message Formatting<br/>[chat_helpers.py]"]
  node_chat_export["Chat Export"]
  node_other_exports["Record Exports"]
  node_search["Local Search<br/>[service.py]"]
end

subgraph group_insights["Analysis &amp; AI"]
  node_wrapped["Annual Summary<br/>[service.py]"]
  node_ai["AI Summaries<br/>[service.py]"]
  node_voice["Voice Transcription"]
  node_advanced["Advanced Actions"]
end

subgraph group_support["Shared Services"]
  node_media["Media Resolution<br/>[media_helpers.py]"]
  node_integrity["Export Integrity"]
  node_storage[("Runtime Storage<br/>[storage.py]")]
  node_runtime_config["Runtime Configuration"]
  node_app_paths["Application Paths<br/>[app_paths.py]"]
  node_logging["Logging<br/>[logging_config.py]"]
end

node_user(("User"))

node_user -->|"launches"| node_desktop_shell
node_desktop_shell -->|"starts"| node_backend
node_user -->|"uses"| node_frontend
node_frontend -.->|"requests data"| node_backend
node_user -->|"captures key"| node_key_capture
node_key_capture -.->|"provides key"| node_decrypt
node_backend -->|"decrypts data"| node_decrypt
node_decrypt -.->|"identifies account"| node_account_identity
node_backend -->|"uses native core"| node_native_core
node_backend -->|"reads live chats"| node_realtime
node_frontend -->|"renders chats"| node_chat_browse
node_backend -->|"formats messages"| node_chat_helpers
node_backend -->|"exports chats"| node_chat_export
node_chat_export -->|"resolves media"| node_media
node_chat_export -->|"checks integrity"| node_integrity
node_backend -->|"exports records"| node_other_exports
node_frontend -->|"searches records"| node_search
node_backend -->|"indexes locally"| node_search
node_frontend -->|"shows summary"| node_wrapped
node_backend -->|"builds summary"| node_wrapped
node_frontend -->|"requests AI"| node_ai
node_backend -->|"runs summaries"| node_ai
node_ai -.->|"stores state"| node_storage
node_frontend -->|"requests transcription"| node_voice
node_backend -->|"transcribes audio"| node_voice
node_user -->|"uses premium actions"| node_advanced
node_backend -.->|"routes actions"| node_advanced
node_chat_export -->|"exports securely"| node_native_core
node_voice -->|"reads media"| node_media
node_search -.->|"stores index state"| node_storage
node_backend -->|"loads settings"| node_runtime_config
node_backend -->|"resolves paths"| node_app_paths
node_backend -->|"configures logs"| node_logging

click node_desktop_shell "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/desktop/src/main.cjs"
click node_backend "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/backend_entry.py"
click node_frontend "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/frontend/app.vue"
click node_key_capture "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/macos-key-extractor/key_extractor/app.py"
click node_decrypt "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/wechat_decrypt.py"
click node_account_identity "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/account_identity.py"
click node_native_core "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/native_core_client.py"
click node_realtime "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/wcdb_realtime.py"
click node_chat_browse "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/frontend/pages/chat/%5B%5Busername%5D%5D.vue"
click node_chat_helpers "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/chat_helpers.py"
click node_chat_export "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/chat_export_service.py"
click node_other_exports "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/sns_export_service.py"
click node_search "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/local_search/service.py"
click node_wrapped "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/wrapped/service.py"
click node_ai "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/ai/service.py"
click node_voice "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/voice_transcription.py"
click node_advanced "https://github.com/lifearchiveproject/wechatdataanalysis/tree/main/src/wechat_decrypt_tool/routers"
click node_media "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/media_helpers.py"
click node_integrity "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/export_integrity.py"
click node_storage "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/ai/storage.py"
click node_runtime_config "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/runtime_settings.py"
click node_app_paths "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/app_paths.py"
click node_logging "https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/logging_config.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_desktop_shell,node_backend,node_frontend,node_user toneBlue
class node_key_capture,node_decrypt,node_account_identity,node_native_core,node_realtime toneAmber
class node_chat_browse,node_chat_helpers,node_chat_export,node_other_exports,node_search toneMint
class node_wrapped,node_ai,node_voice,node_advanced toneRose
class node_media,node_integrity,node_storage,node_runtime_config,node_app_paths,node_logging toneIndigo
```

## Components

### Desktop Runtime

- [Desktop Shell](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/desktop/src/main.cjs): `desktop/src/main.cjs`
- [Backend API](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/backend_entry.py): `src/wechat_decrypt_tool/backend_entry.py`
- [Application UI](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/frontend/app.vue): `frontend/app.vue`

### Data Access

- [macOS Key Capture](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/macos-key-extractor/key_extractor/app.py): `macos-key-extractor/key_extractor/app.py`
- [Database Decryption](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/wechat_decrypt.py): `src/wechat_decrypt_tool/wechat_decrypt.py`
- [Account Identity](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/account_identity.py): `src/wechat_decrypt_tool/account_identity.py`
- [Native Core](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/native_core_client.py): `src/wechat_decrypt_tool/native_core_client.py`
- [Live Chat Reading](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/wcdb_realtime.py): `src/wechat_decrypt_tool/wcdb_realtime.py`

### Browsing & Export

- [Chat Browsing](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/frontend/pages/chat/%5B%5Busername%5D%5D.vue): `frontend/pages/chat/[[username]].vue`
- [Message Formatting](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/chat_helpers.py): `src/wechat_decrypt_tool/chat_helpers.py`
- [Chat Export](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/chat_export_service.py): `src/wechat_decrypt_tool/chat_export_service.py`
- [Record Exports](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/sns_export_service.py): `src/wechat_decrypt_tool/sns_export_service.py`
- [Local Search](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/local_search/service.py): `src/wechat_decrypt_tool/local_search/service.py`

### Analysis & AI

- [Annual Summary](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/wrapped/service.py): `src/wechat_decrypt_tool/wrapped/service.py`
- [AI Summaries](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/ai/service.py): `src/wechat_decrypt_tool/ai/service.py`
- [Voice Transcription](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/voice_transcription.py): `src/wechat_decrypt_tool/voice_transcription.py`
- [Advanced Actions](https://github.com/lifearchiveproject/wechatdataanalysis/tree/main/src/wechat_decrypt_tool/routers): `src/wechat_decrypt_tool/routers`

### Shared Services

- [Media Resolution](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/media_helpers.py): `src/wechat_decrypt_tool/media_helpers.py`
- [Export Integrity](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/export_integrity.py): `src/wechat_decrypt_tool/export_integrity.py`
- [Runtime Storage](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/ai/storage.py): `src/wechat_decrypt_tool/ai/storage.py`
- [Runtime Configuration](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/runtime_settings.py): `src/wechat_decrypt_tool/runtime_settings.py`
- [Application Paths](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/app_paths.py): `src/wechat_decrypt_tool/app_paths.py`
- [Logging](https://github.com/lifearchiveproject/wechatdataanalysis/blob/main/src/wechat_decrypt_tool/logging_config.py): `src/wechat_decrypt_tool/logging_config.py`

### Other components

- **User**

## Connections

- User → Desktop Shell: launches (evidence: `README.md`)
- Desktop Shell → Backend API: starts (evidence: `desktop/src/main.cjs`)
- User → Application UI: uses (evidence: `README.md`)
- Application UI → Backend API: requests data
- User → macOS Key Capture: captures key (evidence: `macos-key-extractor/key_extractor/app.py`)
- macOS Key Capture → Database Decryption: provides key
- Backend API → Database Decryption: decrypts data (evidence: `README.md`)
- Database Decryption → Account Identity: identifies account
- Backend API → Native Core: uses native core
- Backend API → Live Chat Reading: reads live chats (evidence: `README.md`)
- Application UI → Chat Browsing: renders chats (evidence: `README.md`)
- Backend API → Message Formatting: formats messages
- Backend API → Chat Export: exports chats (evidence: `README.md`)
- Chat Export → Media Resolution: resolves media (evidence: `src/wechat_decrypt_tool/chat_export_service.py`)
- Chat Export → Export Integrity: checks integrity (evidence: `src/wechat_decrypt_tool/chat_export_service.py`)
- Backend API → Record Exports: exports records (evidence: `README.md`)
- Application UI → Local Search: searches records (evidence: `README.md`)
- Backend API → Local Search: indexes locally (evidence: `src/wechat_decrypt_tool/local_search/service.py`)
- Application UI → Annual Summary: shows summary (evidence: `README.md`)
- Backend API → Annual Summary: builds summary (evidence: `README.md`)
- Application UI → AI Summaries: requests AI (evidence: `README.md`)
- Backend API → AI Summaries: runs summaries (evidence: `README.md`)
- AI Summaries → Runtime Storage: stores state
- Application UI → Voice Transcription: requests transcription (evidence: `README.md`)
- Backend API → Voice Transcription: transcribes audio
- User → Advanced Actions: uses premium actions (evidence: `README.md`)
- Backend API → Advanced Actions: routes actions
- Chat Export → Native Core: exports securely
- Voice Transcription → Media Resolution: reads media (evidence: `src/wechat_decrypt_tool/voice_transcription.py`)
- Local Search → Runtime Storage: stores index state (evidence: `src/wechat_decrypt_tool/local_search/service.py`)
- Backend API → Runtime Configuration: loads settings
- Backend API → Application Paths: resolves paths
- Backend API → Logging: configures logs (evidence: `src/wechat_decrypt_tool/logging_config.py`)
