# mal-xa/result_downloader architecture

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

- Interactive diagram: https://gitdiagram.com/mal-xa/result_downloader
- Repository: https://github.com/mal-xa/result_downloader

## Overview

The repository combines a results-downloader app with student-data administration. Its main workflow is to enter an individual or batch of student identifiers, invoke native Android result actions, preview the returned HTML, and save or export results. The app also retains recent searches and saved results, and provides Excel-based student-data management. Some native and Python implementation details are unsampled, so their internal connections are omitted rather than inferred.

Main entry points: [`src/App.tsx`](https://github.com/mal-xa/result_downloader/blob/main/src/App.tsx) (App routes), [`src/pages/Index.tsx`](https://github.com/mal-xa/result_downloader/blob/main/src/pages/Index.tsx) (Search and batch), [`src/components/PreviewCard.tsx`](https://github.com/mal-xa/result_downloader/blob/main/src/components/PreviewCard.tsx) (Result preview), [`src/pages/DataManagerPage.tsx`](https://github.com/mal-xa/result_downloader/blob/main/src/pages/DataManagerPage.tsx) (Data manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["App and navigation"]
  node_app["App routes<br/>[App.tsx]"]
  node_recentpage["Recent-search page<br/>[RecentSearches.tsx]"]
  node_savedpage["Saved-results pages<br/>[SavedResults.tsx]"]
  node_detail["Saved-result detail"]
end

subgraph group_results["Result workflow"]
  node_home["Search and batch<br/>[Index.tsx]"]
  node_preview["Result preview<br/>[PreviewCard.tsx]"]
  node_previewhtml["Preview formatting<br/>[previewHtml.ts]"]
  node_exports["Export actions<br/>[ExportCard.tsx]"]
  node_recents["Recent searches"]
  node_saved["Saved results<br/>[useSavedResults.ts]"]
end

subgraph group_native["Android and Python"]
  node_bridge["Result bridge<br/>[resultBridge.ts]"]
  node_plugin["Android bridge plugin"]
  node_nativepreview["Native preview"]
  node_fetcher["MBSE fetcher<br/>[mbse_fetcher.py]"]
  node_extract["Result extraction<br/>[extract.py]"]
  node_legacy["Python downloader<br/>[result.py]"]
  node_activity["Android activity<br/>[MainActivity.java]"]
end

subgraph group_admin["Student administration"]
  node_admin["Admin panel<br/>[AdminPanelPage.tsx]"]
  node_datamanager["Data manager"]
  node_excel["Excel parser<br/>[excelParser.ts]"]
  node_studentlist["Student list"]
  node_storage[("Student dataset store<br/>[storage.ts]")]
end

node_user(("App user"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_recentpage
node_app -->|"routes to"| node_savedpage
node_app -->|"routes to"| node_detail
node_app -->|"routes to"| node_admin
node_app -->|"routes to"| node_datamanager
node_app -->|"routes to"| node_studentlist
node_home -->|"invokes"| node_bridge
node_home -->|"renders"| node_preview
node_preview -->|"formats"| node_previewhtml
node_preview -.->|"opens"| node_nativepreview
node_home -->|"renders"| node_exports
node_home -->|"uses"| node_recents
node_home -->|"uses"| node_saved
node_recentpage -->|"uses"| node_recents
node_savedpage -->|"uses"| node_saved
node_detail -->|"uses"| node_saved
node_activity -->|"registers"| node_plugin
node_bridge -.->|"dispatches"| node_plugin
node_datamanager -->|"parses"| node_excel
node_datamanager -->|"loads and saves"| node_storage
node_studentlist -->|"reads"| node_storage
node_user -.->|"may run"| node_legacy

click node_app "https://github.com/mal-xa/result_downloader/blob/main/src/App.tsx"
click node_home "https://github.com/mal-xa/result_downloader/blob/main/src/pages/Index.tsx"
click node_bridge "https://github.com/mal-xa/result_downloader/blob/main/src/lib/resultBridge.ts"
click node_plugin "https://github.com/mal-xa/result_downloader/blob/main/android/app/src/main/java/com/result/downloader/ResultBridgePlugin.java"
click node_nativepreview "https://github.com/mal-xa/result_downloader/blob/main/android/app/src/main/java/com/result/downloader/NativePreviewActivity.java"
click node_fetcher "https://github.com/mal-xa/result_downloader/blob/main/android/app/src/main/python/mbse_fetcher.py"
click node_extract "https://github.com/mal-xa/result_downloader/blob/main/android/app/src/main/python/extract.py"
click node_legacy "https://github.com/mal-xa/result_downloader/blob/main/result.py"
click node_preview "https://github.com/mal-xa/result_downloader/blob/main/src/components/PreviewCard.tsx"
click node_previewhtml "https://github.com/mal-xa/result_downloader/blob/main/src/lib/previewHtml.ts"
click node_exports "https://github.com/mal-xa/result_downloader/blob/main/src/components/ExportCard.tsx"
click node_recents "https://github.com/mal-xa/result_downloader/blob/main/src/hooks/useRecentSearches.ts"
click node_saved "https://github.com/mal-xa/result_downloader/blob/main/src/hooks/useSavedResults.ts"
click node_recentpage "https://github.com/mal-xa/result_downloader/blob/main/src/pages/RecentSearches.tsx"
click node_savedpage "https://github.com/mal-xa/result_downloader/blob/main/src/pages/SavedResults.tsx"
click node_detail "https://github.com/mal-xa/result_downloader/blob/main/src/pages/SavedResultDetail.tsx"
click node_admin "https://github.com/mal-xa/result_downloader/blob/main/src/pages/AdminPanelPage.tsx"
click node_datamanager "https://github.com/mal-xa/result_downloader/blob/main/src/pages/DataManagerPage.tsx"
click node_excel "https://github.com/mal-xa/result_downloader/blob/main/src/utils/excelParser.ts"
click node_studentlist "https://github.com/mal-xa/result_downloader/blob/main/src/pages/StudentListPage.tsx"
click node_storage "https://github.com/mal-xa/result_downloader/blob/main/src/utils/storage.ts"
click node_activity "https://github.com/mal-xa/result_downloader/blob/main/android/app/src/main/java/com/result/downloader/MainActivity.java"

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_app,node_recentpage,node_savedpage,node_detail,node_user toneBlue
class node_home,node_preview,node_previewhtml,node_exports,node_recents,node_saved toneAmber
class node_bridge,node_plugin,node_nativepreview,node_fetcher,node_extract,node_legacy,node_activity toneMint
class node_admin,node_datamanager,node_excel,node_studentlist,node_storage toneRose
```

## Components

### App and navigation

- [App routes](https://github.com/mal-xa/result_downloader/blob/main/src/App.tsx): `src/App.tsx`
- [Recent-search page](https://github.com/mal-xa/result_downloader/blob/main/src/pages/RecentSearches.tsx): `src/pages/RecentSearches.tsx`
- [Saved-results pages](https://github.com/mal-xa/result_downloader/blob/main/src/pages/SavedResults.tsx): `src/pages/SavedResults.tsx`
- [Saved-result detail](https://github.com/mal-xa/result_downloader/blob/main/src/pages/SavedResultDetail.tsx): `src/pages/SavedResultDetail.tsx`

### Result workflow

- [Search and batch](https://github.com/mal-xa/result_downloader/blob/main/src/pages/Index.tsx): `src/pages/Index.tsx`
- [Result preview](https://github.com/mal-xa/result_downloader/blob/main/src/components/PreviewCard.tsx): `src/components/PreviewCard.tsx`
- [Preview formatting](https://github.com/mal-xa/result_downloader/blob/main/src/lib/previewHtml.ts): `src/lib/previewHtml.ts`
- [Export actions](https://github.com/mal-xa/result_downloader/blob/main/src/components/ExportCard.tsx): `src/components/ExportCard.tsx`
- [Recent searches](https://github.com/mal-xa/result_downloader/blob/main/src/hooks/useRecentSearches.ts): `src/hooks/useRecentSearches.ts`
- [Saved results](https://github.com/mal-xa/result_downloader/blob/main/src/hooks/useSavedResults.ts): `src/hooks/useSavedResults.ts`

### Android and Python

- [Result bridge](https://github.com/mal-xa/result_downloader/blob/main/src/lib/resultBridge.ts): `src/lib/resultBridge.ts`
- [Android bridge plugin](https://github.com/mal-xa/result_downloader/blob/main/android/app/src/main/java/com/result/downloader/ResultBridgePlugin.java): `android/app/src/main/java/com/result/downloader/ResultBridgePlugin.java`
- [Native preview](https://github.com/mal-xa/result_downloader/blob/main/android/app/src/main/java/com/result/downloader/NativePreviewActivity.java): `android/app/src/main/java/com/result/downloader/NativePreviewActivity.java`
- [MBSE fetcher](https://github.com/mal-xa/result_downloader/blob/main/android/app/src/main/python/mbse_fetcher.py): `android/app/src/main/python/mbse_fetcher.py`
- [Result extraction](https://github.com/mal-xa/result_downloader/blob/main/android/app/src/main/python/extract.py): `android/app/src/main/python/extract.py`
- [Python downloader](https://github.com/mal-xa/result_downloader/blob/main/result.py): `result.py`
- [Android activity](https://github.com/mal-xa/result_downloader/blob/main/android/app/src/main/java/com/result/downloader/MainActivity.java): `android/app/src/main/java/com/result/downloader/MainActivity.java`

### Student administration

- [Admin panel](https://github.com/mal-xa/result_downloader/blob/main/src/pages/AdminPanelPage.tsx): `src/pages/AdminPanelPage.tsx`
- [Data manager](https://github.com/mal-xa/result_downloader/blob/main/src/pages/DataManagerPage.tsx): `src/pages/DataManagerPage.tsx`
- [Excel parser](https://github.com/mal-xa/result_downloader/blob/main/src/utils/excelParser.ts): `src/utils/excelParser.ts`
- [Student list](https://github.com/mal-xa/result_downloader/blob/main/src/pages/StudentListPage.tsx): `src/pages/StudentListPage.tsx`
- [Student dataset store](https://github.com/mal-xa/result_downloader/blob/main/src/utils/storage.ts): `src/utils/storage.ts`

### Other components

- **App user**

## Connections

- App user → App routes: opens (evidence: `src/App.tsx`)
- App routes → Search and batch: routes to (evidence: `src/App.tsx`)
- App routes → Recent-search page: routes to (evidence: `src/App.tsx`)
- App routes → Saved-results pages: routes to (evidence: `src/App.tsx`)
- App routes → Saved-result detail: routes to (evidence: `src/App.tsx`)
- App routes → Admin panel: routes to (evidence: `src/App.tsx`)
- App routes → Data manager: routes to (evidence: `src/App.tsx`)
- App routes → Student list: routes to (evidence: `src/App.tsx`)
- Search and batch → Result bridge: invokes (evidence: `src/pages/Index.tsx`)
- Search and batch → Result preview: renders (evidence: `src/pages/Index.tsx`)
- Result preview → Preview formatting: formats (evidence: `src/components/PreviewCard.tsx`)
- Result preview → Native preview: opens
- Search and batch → Export actions: renders (evidence: `src/pages/Index.tsx`)
- Search and batch → Recent searches: uses (evidence: `src/pages/Index.tsx`)
- Search and batch → Saved results: uses (evidence: `src/pages/Index.tsx`)
- Recent-search page → Recent searches: uses (evidence: `src/pages/RecentSearches.tsx`)
- Saved-results pages → Saved results: uses (evidence: `src/pages/SavedResults.tsx`)
- Saved-result detail → Saved results: uses (evidence: `src/pages/SavedResultDetail.tsx`)
- Android activity → Android bridge plugin: registers (evidence: `android/app/src/main/java/com/result/downloader/MainActivity.java`)
- Result bridge → Android bridge plugin: dispatches
- Data manager → Excel parser: parses (evidence: `src/pages/DataManagerPage.tsx`)
- Data manager → Student dataset store: loads and saves (evidence: `src/pages/DataManagerPage.tsx`)
- Student list → Student dataset store: reads (evidence: `src/pages/StudentListPage.tsx`)
- App user → Python downloader: may run
