# shokolaa/discordreader architecture

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

- Interactive diagram: https://gitdiagram.com/shokolaa/discordreader
- Repository: https://github.com/shokolaa/discordreader

## Overview

DiscordReader is a local Flask application for browsing exported Discord archives, viewing channel messages, and searching message text. The main workflow is a browser loading the rendered page, requesting the channel list, then requesting and displaying a selected channel’s chronologically sorted messages. Channel names are resolved from the archive index or channel metadata. A separate Python search script scans the same local archive for a configured phrase. The README describes the UI and local-only privacy goal; template behavior beyond Flask rendering was not sampled.

Main entry points: [`app.py`](https://github.com/shokolaa/discordreader/blob/main/app.py) (Archive reader), [`search.py`](https://github.com/shokolaa/discordreader/blob/main/search.py) (Phrase search), [`templates/index.html`](https://github.com/shokolaa/discordreader/blob/main/templates/index.html) (Browser page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Local web app"]
  node_reader["Archive reader<br/>[app.py]"]
  node_page["Browser page<br/>[index.html]"]
end

subgraph group_archive["Archive access"]
  node_channel_catalog["Channel catalog<br/>[app.py]"]
  node_message_loader["Channel message loader<br/>[app.py]"]
  node_archive_data[("Discord export files")]
end

subgraph group_search["Message search"]
  node_phrase_search["Phrase search<br/>[search.py]"]
end

node_browser(("Local user"))

node_browser -->|"opens locally"| node_reader
node_reader -->|"renders"| node_page
node_reader -->|"lists channels"| node_channel_catalog
node_channel_catalog -->|"reads metadata"| node_archive_data
node_reader -->|"loads channel"| node_message_loader
node_message_loader -->|"reads messages"| node_archive_data
node_phrase_search -->|"scans messages"| node_archive_data

click node_reader "https://github.com/shokolaa/discordreader/blob/main/app.py"
click node_page "https://github.com/shokolaa/discordreader/blob/main/templates/index.html"
click node_channel_catalog "https://github.com/shokolaa/discordreader/blob/main/app.py"
click node_message_loader "https://github.com/shokolaa/discordreader/blob/main/app.py"
click node_phrase_search "https://github.com/shokolaa/discordreader/blob/main/search.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_reader,node_page,node_browser toneBlue
class node_channel_catalog,node_message_loader,node_archive_data toneAmber
class node_phrase_search toneMint
```

## Components

### Local web app

- [Archive reader](https://github.com/shokolaa/discordreader/blob/main/app.py): `app.py`
- [Browser page](https://github.com/shokolaa/discordreader/blob/main/templates/index.html): `templates/index.html`

### Archive access

- [Channel catalog](https://github.com/shokolaa/discordreader/blob/main/app.py): `app.py`
- [Channel message loader](https://github.com/shokolaa/discordreader/blob/main/app.py): `app.py`
- **Discord export files**

### Message search

- [Phrase search](https://github.com/shokolaa/discordreader/blob/main/search.py): `search.py`

### Other components

- **Local user**

## Connections

- Local user → Archive reader: opens locally (evidence: `ReadMe.md`)
- Archive reader → Browser page: renders (evidence: `app.py`)
- Archive reader → Channel catalog: lists channels (evidence: `app.py`)
- Channel catalog → Discord export files: reads metadata (evidence: `app.py`)
- Archive reader → Channel message loader: loads channel (evidence: `app.py`)
- Channel message loader → Discord export files: reads messages (evidence: `app.py`)
- Phrase search → Discord export files: scans messages (evidence: `search.py`)
