# mkhairulhan/siftstrym architecture

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

- Interactive diagram: https://gitdiagram.com/mkhairulhan/siftstrym
- Repository: https://github.com/mkhairulhan/siftstrym

## Overview

#### Purpose and Runtime

Siftstrym is a privacy-centric, browser-only React dashboard for importing and exploring X/Twitter bookmark JSON archives. It parses and analyzes data locally; no backend, API, or data-transmission service is described. The application runs as a Vite-built SPA, locally or as static hosting such as Vercel.

Entry points: `src/main.jsx` mounts React; `src/App.jsx` composes the application shell and views; `index.html` is Vite’s browser document.

#### Application Shell and Navigation

The root application coordinates the active dashboard/feed experience and shared styles. The sidebar provides primary navigation, while a keyboard-shortcut layer supports rapid interaction.

Paths: `src/App.jsx`, `src/components/layout/Sidebar.jsx`, `src/components/layout/KeyboardShortcuts.jsx`.

#### Central Client State

A Zustand store decouples UI state from presentation components. It is the likely shared boundary for imported records, filters, selected view/layout, and worker-produced analysis results, allowing the dashboard and feed to react without direct component coupling.

Path: `src/store/useStore.js`.

#### Local Ingestion Pipeline

Large bookmark JSON archives are handed to a dedicated Web Worker so parsing and transformation do not block the React/UI thread. The ingestion worker is the primary compute boundary between user-provided raw export data and application-ready bookmark records.

Paths: `src/workers/ingest.worker.js`, `src/lib/normalizer.js`, `src/lib/db.js`.

#### Normalized Local Data Layer

Normalization translates source archive structures into consistent records suitable for rendering, filtering, and analytics. The database module provides the local persistence/access boundary; its location under `src/lib/db.js` indicates browser-side storage rather than a server database.

Paths: `src/lib/normalizer.js`, `src/lib/db.js`, `src/lib/utils.js`.

#### Offline Insights Processing

A separate insights worker computes metadata-derived analytics—such as engagement ratios, creation latency, media health, and geolocation—off the main thread. Results flow back into shared state for dashboard rendering, preserving interactivity with large datasets.

Paths: `src/workers/insights.worker.js`, `src/components/dashboard/Insights.jsx`, `src/store/useStore.js`.

#### Presentation Surfaces

The dashboard exposes analytics and settings, while the feed renders individual bookmark/tweet records. `TweetCard` is the content-rendering boundary; feed layout/virtualization is implied by the declared React visualization dependencies, though the feed container is not present in this tree.

Paths: `src/components/dashboard/Insights.jsx`, `src/components/dashboard/Settings.jsx`, `src/components/feed/TweetCard.jsx`.

#### Infrastructure and External Boundaries

Runtime infrastructure is Node.js 18+ for development and Vite for bundling/dev serving (`vite.config.js`). Deployment can be static/Vercel-hosted. Material browser capabilities are Web Workers, in-memory processing, and likely local browser persistence via `db.js`. The archive file is the principal external input; the stated architecture intentionally avoids external data APIs and telemetry.

Paths: `vite.config.js`, `package.json`, `src/workers/ingest.worker.js`.

Main entry points: [`src/store/useStore.js`](https://github.com/mkhairulhan/siftstrym/blob/main/src/store/useStore.js) (Shared client state), [`src/App.jsx`](https://github.com/mkhairulhan/siftstrym/blob/main/src/App.jsx) (Application shell), [`src/main.jsx`](https://github.com/mkhairulhan/siftstrym/blob/main/src/main.jsx) (React mount), [`src/workers/ingest.worker.js`](https://github.com/mkhairulhan/siftstrym/blob/main/src/workers/ingest.worker.js) (Ingestion worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser UI"]
  node_main["React mount<br/>SPA entry<br/>[main.jsx]"]
  node_app["Application shell<br/>React root<br/>[App.jsx]"]
  node_sidebar["Sidebar navigation<br/>[Sidebar.jsx]"]
  node_shortcuts["Keyboard shortcuts<br/>interaction layer"]
  node_store[("Shared client state<br/>Zustand store<br/>[useStore.js]")]
  node_insights["Insights dashboard<br/>analytics view<br/>[Insights.jsx]"]
  node_settings["Settings<br/>dashboard view<br/>[Settings.jsx]"]
  node_tweet_card["Tweet card<br/>record renderer<br/>[TweetCard.jsx]"]
end

subgraph group_processing["Local Processing"]
  node_ingest{{"Ingestion worker<br/>Web Worker<br/>[ingest.worker.js]"}}
  node_normalizer["Record normalizer<br/>data transformation<br/>[normalizer.js]"]
  node_db[("Local data layer<br/>browser persistence<br/>[db.js]")]
  node_insights_worker{{"Insights worker<br/>Web Worker<br/>[insights.worker.js]"}}
end

subgraph group_runtime["Build &amp; Hosting"]
  node_html["Browser document<br/>Vite HTML entry<br/>[index.html]"]
  node_vite{{"Vite<br/>bundler &amp; dev server<br/>[vite.config.js]"}}
  node_package["Node.js runtime<br/>development runtime<br/>[package.json]"]
end

node_archive["Bookmark JSON archive<br/>external input"]

node_package -->|"runs"| node_vite
node_vite -->|"serves/builds"| node_html
node_html -->|"loads"| node_main
node_main -->|"mounts"| node_app
node_app -->|"composes"| node_sidebar
node_app -->|"composes"| node_shortcuts
node_app -->|"reads and updates"| node_store
node_archive -->|"imported locally"| node_ingest
node_ingest -->|"transforms"| node_normalizer
node_normalizer -->|"stores normalized records"| node_db
node_db -->|"loads records"| node_store
node_store -->|"provides records"| node_insights_worker
node_insights_worker -->|"returns analytics"| node_store
node_store -->|"supplies analytics"| node_insights
node_store -->|"supplies preferences"| node_settings
node_store -->|"supplies bookmark records"| node_tweet_card

click node_html "https://github.com/mkhairulhan/siftstrym/blob/main/index.html"
click node_vite "https://github.com/mkhairulhan/siftstrym/blob/main/vite.config.js"
click node_package "https://github.com/mkhairulhan/siftstrym/blob/main/package.json"
click node_main "https://github.com/mkhairulhan/siftstrym/blob/main/src/main.jsx"
click node_app "https://github.com/mkhairulhan/siftstrym/blob/main/src/App.jsx"
click node_sidebar "https://github.com/mkhairulhan/siftstrym/blob/main/src/components/layout/Sidebar.jsx"
click node_shortcuts "https://github.com/mkhairulhan/siftstrym/blob/main/src/components/layout/KeyboardShortcuts.jsx"
click node_store "https://github.com/mkhairulhan/siftstrym/blob/main/src/store/useStore.js"
click node_ingest "https://github.com/mkhairulhan/siftstrym/blob/main/src/workers/ingest.worker.js"
click node_normalizer "https://github.com/mkhairulhan/siftstrym/blob/main/src/lib/normalizer.js"
click node_db "https://github.com/mkhairulhan/siftstrym/blob/main/src/lib/db.js"
click node_insights_worker "https://github.com/mkhairulhan/siftstrym/blob/main/src/workers/insights.worker.js"
click node_insights "https://github.com/mkhairulhan/siftstrym/blob/main/src/components/dashboard/Insights.jsx"
click node_settings "https://github.com/mkhairulhan/siftstrym/blob/main/src/components/dashboard/Settings.jsx"
click node_tweet_card "https://github.com/mkhairulhan/siftstrym/blob/main/src/components/feed/TweetCard.jsx"

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_main,node_app,node_sidebar,node_shortcuts,node_store,node_insights,node_settings,node_tweet_card toneBlue
class node_ingest,node_normalizer,node_db,node_insights_worker toneAmber
class node_html,node_vite,node_package toneMint
class node_archive toneNeutral
```

## Components

### Browser UI

- [React mount](https://github.com/mkhairulhan/siftstrym/blob/main/src/main.jsx): SPA entry · `src/main.jsx`
- [Application shell](https://github.com/mkhairulhan/siftstrym/blob/main/src/App.jsx): React root · Coordinates dashboard/feed experience and shared styles. · `src/App.jsx`
- [Sidebar navigation](https://github.com/mkhairulhan/siftstrym/blob/main/src/components/layout/Sidebar.jsx): navigation · `src/components/layout/Sidebar.jsx`
- [Keyboard shortcuts](https://github.com/mkhairulhan/siftstrym/blob/main/src/components/layout/KeyboardShortcuts.jsx): interaction layer · `src/components/layout/KeyboardShortcuts.jsx`
- [Shared client state](https://github.com/mkhairulhan/siftstrym/blob/main/src/store/useStore.js): Zustand store · Holds records, filters, views, and analysis results. · `src/store/useStore.js`
- [Insights dashboard](https://github.com/mkhairulhan/siftstrym/blob/main/src/components/dashboard/Insights.jsx): analytics view · `src/components/dashboard/Insights.jsx`
- [Settings](https://github.com/mkhairulhan/siftstrym/blob/main/src/components/dashboard/Settings.jsx): dashboard view · `src/components/dashboard/Settings.jsx`
- [Tweet card](https://github.com/mkhairulhan/siftstrym/blob/main/src/components/feed/TweetCard.jsx): record renderer · Renders individual bookmark/tweet records. · `src/components/feed/TweetCard.jsx`

### Local Processing

- [Ingestion worker](https://github.com/mkhairulhan/siftstrym/blob/main/src/workers/ingest.worker.js): Web Worker · Parses archives off the UI thread. · `src/workers/ingest.worker.js`
- [Record normalizer](https://github.com/mkhairulhan/siftstrym/blob/main/src/lib/normalizer.js): data transformation · `src/lib/normalizer.js`
- [Local data layer](https://github.com/mkhairulhan/siftstrym/blob/main/src/lib/db.js): browser persistence · Local persistence and record access boundary. · `src/lib/db.js`
- [Insights worker](https://github.com/mkhairulhan/siftstrym/blob/main/src/workers/insights.worker.js): Web Worker · Computes offline metadata analytics. · `src/workers/insights.worker.js`

### Build & Hosting

- [Browser document](https://github.com/mkhairulhan/siftstrym/blob/main/index.html): Vite HTML entry · `index.html`
- [Vite](https://github.com/mkhairulhan/siftstrym/blob/main/vite.config.js): bundler & dev server · `vite.config.js`
- [Node.js runtime](https://github.com/mkhairulhan/siftstrym/blob/main/package.json): development runtime · Node.js 18+ runs local tooling. · `package.json`

### Other components

- **Bookmark JSON archive**: external input · User-provided X/Twitter bookmark export.

## Connections

- Node.js runtime → Vite: runs
- Vite → Browser document: serves/builds
- Browser document → React mount: loads
- React mount → Application shell: mounts
- Application shell → Sidebar navigation: composes
- Application shell → Keyboard shortcuts: composes
- Application shell → Shared client state: reads and updates
- Bookmark JSON archive → Ingestion worker: imported locally
- Ingestion worker → Record normalizer: transforms
- Record normalizer → Local data layer: stores normalized records
- Local data layer → Shared client state: loads records
- Shared client state → Insights worker: provides records
- Insights worker → Shared client state: returns analytics
- Shared client state → Insights dashboard: supplies analytics
- Shared client state → Settings: supplies preferences
- Shared client state → Tweet card: supplies bookmark records
