# memodlike/asterfold architecture

> Architecture diagram of the GitHub repository memodlike/asterfold, 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/memodlike/asterfold
- Repository: https://github.com/memodlike/asterfold

## Overview

Asterfold is a local-first Chrome New Tab bookmark workspace. Users open a tab, organize Pages into Boards and Bookmarks, search and launch saved sites, and manage appearance, privacy, and recovery; optional import/export supports backups and Chrome bookmarks. The graph combines documented product capabilities with relationships visible in sampled source and the SOURCE INDEX. Several feature implementations were not excerpted, so their internal calls are omitted rather than inferred.

Main entry points: [`src/app/WorkspaceApp.tsx`](https://github.com/memodlike/asterfold/blob/main/src/app/WorkspaceApp.tsx) (Workspace shell), [`src/db/repository.ts`](https://github.com/memodlike/asterfold/blob/main/src/db/repository.ts) (Workspace repository), [`src/services/exportImport.ts`](https://github.com/memodlike/asterfold/blob/main/src/services/exportImport.ts) (Import and export), [`entrypoints/popup/PopupApp.tsx`](https://github.com/memodlike/asterfold/blob/main/entrypoints/popup/PopupApp.tsx) (Extension popup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Workspace experience"]
  node_newtab["New Tab entry<br/>[main.tsx]"]
  node_onboarding["Onboarding<br/>[OnboardingGate.tsx]"]
  node_workspace["Workspace shell<br/>[WorkspaceApp.tsx]"]
  node_launcher["App launcher<br/>[AppLauncher.tsx]"]
  node_popup["Extension popup<br/>[PopupApp.tsx]"]
end

subgraph group_features["User features"]
  node_boards["Pages and Boards"]
  node_bookmarks["Bookmark editing"]
  node_searchui["Search interface<br/>[SearchPalette.tsx]"]
  node_settings["Settings and themes"]
  node_trash["Trash and restore<br/>[TrashDialog.tsx]"]
  node_privacy["Privacy mode<br/>[usePrivacyMode.ts]"]
  node_transfer["Import and export<br/>[exportImport.ts]"]
end

subgraph group_data["Local data"]
  node_repository["Workspace repository<br/>[repository.ts]"]
  node_database[("IndexedDB<br/>[database.ts]")]
  node_migrations["Schema migrations<br/>[migrations.ts]"]
end

subgraph group_platform["Browser integration"]
  node_chromeimport["Chrome bookmark import"]
  node_importworker["Import worker<br/>[importWorker.ts]"]
  node_background["Background entry<br/>[background.ts]"]
  node_browserapi["Browser API<br/>[api.ts]"]
  node_session["Privacy session storage<br/>[privacySession.ts]"]
end

subgraph group_shared["Shared services"]
  node_searchengine["Search engine<br/>[searchEngine.ts]"]
  node_appearance["Theme runtime<br/>[useThemeRuntime.ts]"]
  node_performance["Display compatibility"]
  node_wallpaper["Wallpaper processing<br/>[wallpaper.ts]"]
  node_domain["Domain rules and models"]
  node_locales["Localization<br/>[index.tsx]"]
end

node_user(("User"))
node_chrome(("Chrome New Tab"))

node_user -->|"opens tab"| node_chrome
node_chrome -->|"loads workspace"| node_newtab
node_newtab -->|"renders"| node_onboarding
node_onboarding -.->|"continues to"| node_workspace
node_user -->|"organizes bookmarks"| node_workspace
node_workspace -->|"offers controls"| node_launcher
node_workspace -->|"organizes Pages"| node_boards
node_workspace -->|"manages bookmarks"| node_bookmarks
node_workspace -->|"opens search"| node_searchui
node_searchui -->|"queries"| node_searchengine
node_searchui -->|"translates labels"| node_locales
node_workspace -->|"opens settings"| node_settings
node_settings -.->|"configures appearance"| node_appearance
node_appearance -->|"reads profile"| node_performance
node_workspace -->|"opens trash"| node_trash
node_popup -->|"opens workspace"| node_workspace
node_popup -->|"controls privacy"| node_privacy
node_privacy -->|"persists setting"| node_repository
node_privacy -->|"reads and writes"| node_session
node_user -->|"requests import"| node_chromeimport
node_popup -->|"reads bookmarks"| node_chromeimport
node_popup -->|"imports records"| node_transfer
node_user -->|"backs up or restores"| node_transfer
node_importworker -->|"delegates import"| node_transfer
node_transfer -->|"ensures workspace"| node_repository
node_transfer -->|"reads and writes data"| node_database
node_repository -->|"persists entities"| node_database
node_database -->|"registers upgrades"| node_migrations
node_repository -->|"processes uploads"| node_wallpaper
node_repository -->|"uses validation and ordering"| node_domain
node_transfer -->|"validates and normalizes"| node_domain
node_background -->|"uses workspace data"| node_repository
node_background -.->|"uses browser messages"| node_browserapi
node_searchui -->|"opens bookmark targets"| node_browserapi
node_workspace -->|"loads workspace"| node_repository
node_repository -->|"accesses database"| node_database

click node_newtab "https://github.com/memodlike/asterfold/blob/main/entrypoints/newtab/main.tsx"
click node_onboarding "https://github.com/memodlike/asterfold/blob/main/src/features/onboarding/OnboardingGate.tsx"
click node_workspace "https://github.com/memodlike/asterfold/blob/main/src/app/WorkspaceApp.tsx"
click node_launcher "https://github.com/memodlike/asterfold/blob/main/src/app/AppLauncher.tsx"
click node_boards "https://github.com/memodlike/asterfold/tree/main/src/features/boards"
click node_bookmarks "https://github.com/memodlike/asterfold/tree/main/src/features/bookmarks"
click node_searchui "https://github.com/memodlike/asterfold/blob/main/src/features/search/SearchPalette.tsx"
click node_searchengine "https://github.com/memodlike/asterfold/blob/main/src/search/searchEngine.ts"
click node_settings "https://github.com/memodlike/asterfold/tree/main/src/features/settings"
click node_appearance "https://github.com/memodlike/asterfold/blob/main/src/features/appearance/useThemeRuntime.ts"
click node_performance "https://github.com/memodlike/asterfold/blob/main/src/features/performance/performanceProfile.ts"
click node_trash "https://github.com/memodlike/asterfold/blob/main/src/features/trash/TrashDialog.tsx"
click node_popup "https://github.com/memodlike/asterfold/blob/main/entrypoints/popup/PopupApp.tsx"
click node_privacy "https://github.com/memodlike/asterfold/blob/main/src/app/usePrivacyMode.ts"
click node_chromeimport "https://github.com/memodlike/asterfold/blob/main/src/features/onboarding/chromeBookmarkImport.ts"
click node_transfer "https://github.com/memodlike/asterfold/blob/main/src/services/exportImport.ts"
click node_importworker "https://github.com/memodlike/asterfold/blob/main/src/services/importWorker.ts"
click node_wallpaper "https://github.com/memodlike/asterfold/blob/main/src/services/wallpaper.ts"
click node_repository "https://github.com/memodlike/asterfold/blob/main/src/db/repository.ts"
click node_database "https://github.com/memodlike/asterfold/blob/main/src/db/database.ts"
click node_migrations "https://github.com/memodlike/asterfold/blob/main/src/db/migrations.ts"
click node_domain "https://github.com/memodlike/asterfold/tree/main/src/domain"
click node_locales "https://github.com/memodlike/asterfold/blob/main/src/i18n/index.tsx"
click node_background "https://github.com/memodlike/asterfold/blob/main/entrypoints/background.ts"
click node_browserapi "https://github.com/memodlike/asterfold/blob/main/src/browser/api.ts"
click node_session "https://github.com/memodlike/asterfold/blob/main/src/browser/privacySession.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_newtab,node_onboarding,node_workspace,node_launcher,node_popup,node_user toneBlue
class node_boards,node_bookmarks,node_searchui,node_settings,node_trash,node_privacy,node_transfer toneAmber
class node_repository,node_database,node_migrations toneMint
class node_chromeimport,node_importworker,node_background,node_browserapi,node_session toneRose
class node_searchengine,node_appearance,node_performance,node_wallpaper,node_domain,node_locales,node_chrome toneIndigo
```

## Components

### Workspace experience

- [New Tab entry](https://github.com/memodlike/asterfold/blob/main/entrypoints/newtab/main.tsx): `entrypoints/newtab/main.tsx`
- [Onboarding](https://github.com/memodlike/asterfold/blob/main/src/features/onboarding/OnboardingGate.tsx): `src/features/onboarding/OnboardingGate.tsx`
- [Workspace shell](https://github.com/memodlike/asterfold/blob/main/src/app/WorkspaceApp.tsx): `src/app/WorkspaceApp.tsx`
- [App launcher](https://github.com/memodlike/asterfold/blob/main/src/app/AppLauncher.tsx): `src/app/AppLauncher.tsx`
- [Extension popup](https://github.com/memodlike/asterfold/blob/main/entrypoints/popup/PopupApp.tsx): `entrypoints/popup/PopupApp.tsx`

### User features

- [Pages and Boards](https://github.com/memodlike/asterfold/tree/main/src/features/boards): `src/features/boards`
- [Bookmark editing](https://github.com/memodlike/asterfold/tree/main/src/features/bookmarks): `src/features/bookmarks`
- [Search interface](https://github.com/memodlike/asterfold/blob/main/src/features/search/SearchPalette.tsx): `src/features/search/SearchPalette.tsx`
- [Settings and themes](https://github.com/memodlike/asterfold/tree/main/src/features/settings): `src/features/settings`
- [Trash and restore](https://github.com/memodlike/asterfold/blob/main/src/features/trash/TrashDialog.tsx): `src/features/trash/TrashDialog.tsx`
- [Privacy mode](https://github.com/memodlike/asterfold/blob/main/src/app/usePrivacyMode.ts): `src/app/usePrivacyMode.ts`
- [Import and export](https://github.com/memodlike/asterfold/blob/main/src/services/exportImport.ts): `src/services/exportImport.ts`

### Local data

- [Workspace repository](https://github.com/memodlike/asterfold/blob/main/src/db/repository.ts): `src/db/repository.ts`
- [IndexedDB](https://github.com/memodlike/asterfold/blob/main/src/db/database.ts): `src/db/database.ts`
- [Schema migrations](https://github.com/memodlike/asterfold/blob/main/src/db/migrations.ts): `src/db/migrations.ts`

### Browser integration

- [Chrome bookmark import](https://github.com/memodlike/asterfold/blob/main/src/features/onboarding/chromeBookmarkImport.ts): `src/features/onboarding/chromeBookmarkImport.ts`
- [Import worker](https://github.com/memodlike/asterfold/blob/main/src/services/importWorker.ts): `src/services/importWorker.ts`
- [Background entry](https://github.com/memodlike/asterfold/blob/main/entrypoints/background.ts): `entrypoints/background.ts`
- [Browser API](https://github.com/memodlike/asterfold/blob/main/src/browser/api.ts): `src/browser/api.ts`
- [Privacy session storage](https://github.com/memodlike/asterfold/blob/main/src/browser/privacySession.ts): `src/browser/privacySession.ts`

### Shared services

- [Search engine](https://github.com/memodlike/asterfold/blob/main/src/search/searchEngine.ts): `src/search/searchEngine.ts`
- [Theme runtime](https://github.com/memodlike/asterfold/blob/main/src/features/appearance/useThemeRuntime.ts): `src/features/appearance/useThemeRuntime.ts`
- [Display compatibility](https://github.com/memodlike/asterfold/blob/main/src/features/performance/performanceProfile.ts): `src/features/performance/performanceProfile.ts`
- [Wallpaper processing](https://github.com/memodlike/asterfold/blob/main/src/services/wallpaper.ts): `src/services/wallpaper.ts`
- [Domain rules and models](https://github.com/memodlike/asterfold/tree/main/src/domain): `src/domain`
- [Localization](https://github.com/memodlike/asterfold/blob/main/src/i18n/index.tsx): `src/i18n/index.tsx`

### Other components

- **User**
- **Chrome New Tab**

## Connections

- User → Chrome New Tab: opens tab
- Chrome New Tab → New Tab entry: loads workspace
- New Tab entry → Onboarding: renders (evidence: `entrypoints/newtab/main.tsx`)
- Onboarding → Workspace shell: continues to
- User → Workspace shell: organizes bookmarks
- Workspace shell → App launcher: offers controls
- Workspace shell → Pages and Boards: organizes Pages
- Workspace shell → Bookmark editing: manages bookmarks
- Workspace shell → Search interface: opens search
- Search interface → Search engine: queries (evidence: `src/features/search/SearchPalette.tsx`)
- Search interface → Localization: translates labels (evidence: `src/features/search/SearchPalette.tsx`)
- Workspace shell → Settings and themes: opens settings
- Settings and themes → Theme runtime: configures appearance
- Theme runtime → Display compatibility: reads profile (evidence: `src/features/appearance/useThemeRuntime.ts`)
- Workspace shell → Trash and restore: opens trash
- Extension popup → Workspace shell: opens workspace (evidence: `entrypoints/popup/PopupApp.tsx`)
- Extension popup → Privacy mode: controls privacy (evidence: `entrypoints/popup/PopupApp.tsx`)
- Privacy mode → Workspace repository: persists setting (evidence: `src/app/usePrivacyMode.ts`)
- Privacy mode → Privacy session storage: reads and writes (evidence: `src/app/usePrivacyMode.ts`)
- User → Chrome bookmark import: requests import
- Extension popup → Chrome bookmark import: reads bookmarks (evidence: `entrypoints/popup/PopupApp.tsx`)
- Extension popup → Import and export: imports records (evidence: `entrypoints/popup/PopupApp.tsx`)
- User → Import and export: backs up or restores
- Import worker → Import and export: delegates import (evidence: `src/services/importWorker.ts`)
- Import and export → Workspace repository: ensures workspace (evidence: `src/services/exportImport.ts`)
- Import and export → IndexedDB: reads and writes data (evidence: `src/services/exportImport.ts`)
- Workspace repository → IndexedDB: persists entities (evidence: `src/db/repository.ts`)
- IndexedDB → Schema migrations: registers upgrades (evidence: `src/db/database.ts`)
- Workspace repository → Wallpaper processing: processes uploads (evidence: `src/db/repository.ts`)
- Workspace repository → Domain rules and models: uses validation and ordering (evidence: `src/db/repository.ts`)
- Import and export → Domain rules and models: validates and normalizes (evidence: `src/services/exportImport.ts`)
- Background entry → Workspace repository: uses workspace data (evidence: `entrypoints/background.ts`)
- Background entry → Browser API: uses browser messages
- Search interface → Browser API: opens bookmark targets (evidence: `src/features/search/SearchPalette.tsx`)
- Workspace shell → Workspace repository: loads workspace
- Workspace repository → IndexedDB: accesses database (evidence: `src/db/repository.ts`)
