# koaie/browser architecture

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

- Interactive diagram: https://gitdiagram.com/koaie/browser
- Repository: https://github.com/koaie/browser

## Overview

This is a GTK desktop web browser: users enter or revisit a URL, the main window requests and displays the page, and successful visits are added to history. It also provides history, favorites, and homepage settings windows, backed by SQLite through Entity Framework and in-memory maps. The README only documents building; this map follows the supplied source excerpts, so omitted handlers and implementations are not assumed.

Main entry points: [`TabWindow.cs`](https://github.com/koaie/browser/blob/main/TabWindow.cs) (Browser Window), [`Program.cs`](https://github.com/koaie/browser/blob/main/Program.cs) (Application Startup), [`Http.cs`](https://github.com/koaie/browser/blob/main/Http.cs) (HTTP Requests), [`Options.cs`](https://github.com/koaie/browser/blob/main/Options.cs) (Browser Options)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browsing"]
  node_program["Application Startup<br/>[Program.cs]"]
  node_tab["Browser Window<br/>[TabWindow.cs]"]
  node_http["HTTP Requests<br/>[Http.cs]"]
end

subgraph group_windows["Browser Windows"]
  node_historywindow["History Window<br/>[History.cs]"]
  node_favoriteswindow["Favorites Window<br/>[FavoritesWindow.cs]"]
  node_optionswindow["Options Window<br/>[OptionsWindow.cs]"]
end

subgraph group_data["Browser Data"]
  node_history["Visit History<br/>[History.cs]"]
  node_favorites["Saved Favorites<br/>[Favorites.cs]"]
  node_options["Browser Options<br/>[Options.cs]"]
  node_map["Key-Value Maps<br/>[Map.cs]"]
  node_context["Database Context<br/>[ListContext.cs]"]
  node_sqlite[("SQLite Database<br/>[ListContext.cs]")]
end

node_user(("User"))
node_remote(("Web Servers"))

node_user -->|"launches"| node_program
node_program -->|"opens"| node_tab
node_program -->|"loads defaults"| node_options
node_program -->|"reloads"| node_history
node_program -->|"reloads"| node_favorites
node_user -->|"navigates"| node_tab
node_tab -->|"requests URL"| node_http
node_http -->|"sends HTTP"| node_remote
node_remote -->|"returns response"| node_http
node_http -->|"returns request"| node_tab
node_tab -->|"records visit"| node_history
node_tab -->|"opens"| node_historywindow
node_tab -->|"opens"| node_favoriteswindow
node_tab -->|"opens"| node_optionswindow
node_historywindow -->|"reads and deletes"| node_history
node_historywindow -->|"revisits URL"| node_tab
node_favoriteswindow -->|"manages favorites"| node_favorites
node_favoriteswindow -->|"revisits URL"| node_tab
node_optionswindow -->|"updates homepage"| node_options
node_options -->|"provides homepage"| node_tab
node_history -->|"uses map"| node_map
node_favorites -->|"uses map"| node_map
node_options -->|"uses map"| node_map
node_map -->|"queries and saves"| node_context
node_context -->|"reads and writes"| node_sqlite

click node_program "https://github.com/koaie/browser/blob/main/Program.cs"
click node_tab "https://github.com/koaie/browser/blob/main/TabWindow.cs"
click node_http "https://github.com/koaie/browser/blob/main/Http.cs"
click node_historywindow "https://github.com/koaie/browser/blob/main/History.cs"
click node_favoriteswindow "https://github.com/koaie/browser/blob/main/FavoritesWindow.cs"
click node_optionswindow "https://github.com/koaie/browser/blob/main/OptionsWindow.cs"
click node_history "https://github.com/koaie/browser/blob/main/History.cs"
click node_favorites "https://github.com/koaie/browser/blob/main/Favorites.cs"
click node_options "https://github.com/koaie/browser/blob/main/Options.cs"
click node_map "https://github.com/koaie/browser/blob/main/Map.cs"
click node_context "https://github.com/koaie/browser/blob/main/ListContext.cs"
click node_sqlite "https://github.com/koaie/browser/blob/main/ListContext.cs"

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_program,node_tab,node_http,node_user toneBlue
class node_historywindow,node_favoriteswindow,node_optionswindow toneAmber
class node_history,node_favorites,node_options,node_map,node_context,node_sqlite,node_remote toneMint
```

## Components

### Browsing

- [Application Startup](https://github.com/koaie/browser/blob/main/Program.cs): `Program.cs`
- [Browser Window](https://github.com/koaie/browser/blob/main/TabWindow.cs): `TabWindow.cs`
- [HTTP Requests](https://github.com/koaie/browser/blob/main/Http.cs): `Http.cs`

### Browser Windows

- [History Window](https://github.com/koaie/browser/blob/main/History.cs): `History.cs`
- [Favorites Window](https://github.com/koaie/browser/blob/main/FavoritesWindow.cs): `FavoritesWindow.cs`
- [Options Window](https://github.com/koaie/browser/blob/main/OptionsWindow.cs): `OptionsWindow.cs`

### Browser Data

- [Visit History](https://github.com/koaie/browser/blob/main/History.cs): `History.cs`
- [Saved Favorites](https://github.com/koaie/browser/blob/main/Favorites.cs): `Favorites.cs`
- [Browser Options](https://github.com/koaie/browser/blob/main/Options.cs): `Options.cs`
- [Key-Value Maps](https://github.com/koaie/browser/blob/main/Map.cs): `Map.cs`
- [Database Context](https://github.com/koaie/browser/blob/main/ListContext.cs): `ListContext.cs`
- [SQLite Database](https://github.com/koaie/browser/blob/main/ListContext.cs): `ListContext.cs`

### Other components

- **User**
- **Web Servers**

## Connections

- User → Application Startup: launches
- Application Startup → Browser Window: opens
- Application Startup → Browser Options: loads defaults
- Application Startup → Visit History: reloads
- Application Startup → Saved Favorites: reloads
- User → Browser Window: navigates
- Browser Window → HTTP Requests: requests URL
- HTTP Requests → Web Servers: sends HTTP
- Web Servers → HTTP Requests: returns response
- HTTP Requests → Browser Window: returns request
- Browser Window → Visit History: records visit
- Browser Window → History Window: opens
- Browser Window → Favorites Window: opens
- Browser Window → Options Window: opens
- History Window → Visit History: reads and deletes
- History Window → Browser Window: revisits URL
- Favorites Window → Saved Favorites: manages favorites
- Favorites Window → Browser Window: revisits URL
- Options Window → Browser Options: updates homepage
- Browser Options → Browser Window: provides homepage
- Visit History → Key-Value Maps: uses map
- Saved Favorites → Key-Value Maps: uses map
- Browser Options → Key-Value Maps: uses map
- Key-Value Maps → Database Context: queries and saves
- Database Context → SQLite Database: reads and writes
