# bottle-note/bottle-note-app architecture

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

- Interactive diagram: https://gitdiagram.com/bottle-note/bottle-note-app
- Repository: https://github.com/bottle-note/bottle-note-app

## Overview

This repository is the Bottle Note official Flutter app. The likely user path is entering the app, viewing its web content, and using bridge-backed device or social features; the tree also shows connectivity/offline handling and Firebase configuration. The available source excerpts are native platform files rather than Dart runtime code, so most Flutter relationships below are shown as unverified dashed links, not asserted call paths.

Main entry points: [`lib/main.dart`](https://github.com/bottle-note/bottle-note-app/blob/main/lib/main.dart) (Flutter entry), [`lib/bridge/web_view_bridge_handler.dart`](https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/web_view_bridge_handler.dart) (Web bridge), [`lib/web_view/web_view.dart`](https://github.com/bottle-note/bottle-note-app/blob/main/lib/web_view/web_view.dart) (Web view), [`lib/bridge/handlers/auth_bridge_handler.dart`](https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/handlers/auth_bridge_handler.dart) (Auth bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_entry["Flutter entry<br/>[main.dart]"]
  node_offline["Offline screen"]
  node_loading["Loading UI"]
  node_logo["Branding"]
  node_actions["Back action"]
end

subgraph group_web["Web integration"]
  node_webview["Web view<br/>[web_view.dart]"]
  node_bridge["Bridge setup"]
  node_webbridge["Web bridge"]
  node_navigation["Web navigation"]
  node_handlerbase["Bridge base"]
  node_auth["Auth bridge"]
  node_device["Device bridge"]
  node_media["Media bridge"]
  node_share["Share bridge"]
  node_social["Social login"]
end

subgraph group_services["Platform services"]
  node_connectivity["Connectivity"]
  node_restore["URL restore"]
  node_firebase["Firebase config"]
  node_firebaseoptions["Firebase options"]
  node_environment["Environment config<br/>[env.dart]"]
  node_android["Android intent host<br/>[MainActivity.kt]"]
  node_ios["iOS host<br/>[AppDelegate.swift]"]
end

node_user(("App user"))

node_user -.->|"opens"| node_entry
node_entry -.->|"presents"| node_webview
node_webview -.->|"sets up"| node_bridge
node_webview -.->|"handles navigation"| node_navigation
node_webview -.->|"dispatches"| node_webbridge
node_webbridge -.->|"uses handlers"| node_handlerbase
node_webbridge -.->|"dispatches"| node_auth
node_webbridge -.->|"dispatches"| node_device
node_webbridge -.->|"dispatches"| node_media
node_webbridge -.->|"dispatches"| node_share
node_auth -.->|"supports login"| node_social
node_entry -.->|"handles back"| node_actions
node_entry -.->|"checks status"| node_connectivity
node_entry -.->|"shows offline"| node_offline
node_webview -.->|"restores URL"| node_restore
node_entry -.->|"shows loading"| node_loading
node_entry -.->|"uses branding"| node_logo
node_entry -.->|"configures"| node_firebase
node_firebase -.->|"uses options"| node_firebaseoptions
node_entry -.->|"reads settings"| node_environment
node_android -.->|"handles app intents"| node_user
node_ios -.->|"hosts Flutter"| node_entry

click node_entry "https://github.com/bottle-note/bottle-note-app/blob/main/lib/main.dart"
click node_webview "https://github.com/bottle-note/bottle-note-app/blob/main/lib/web_view/web_view.dart"
click node_offline "https://github.com/bottle-note/bottle-note-app/blob/main/lib/ui/offline_screen.dart"
click node_loading "https://github.com/bottle-note/bottle-note-app/blob/main/lib/ui/loading_widget.dart"
click node_logo "https://github.com/bottle-note/bottle-note-app/blob/main/lib/ui/bottle_note_logo_path.dart"
click node_connectivity "https://github.com/bottle-note/bottle-note-app/blob/main/lib/utils/network/connectivity_service.dart"
click node_restore "https://github.com/bottle-note/bottle-note-app/blob/main/lib/utils/url_restore_manager.dart"
click node_bridge "https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/bridge_setup_script.dart"
click node_webbridge "https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/web_view_bridge_handler.dart"
click node_navigation "https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/web_view_navigation_handler.dart"
click node_handlerbase "https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/handlers/bridge_handler_base.dart"
click node_auth "https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/handlers/auth_bridge_handler.dart"
click node_device "https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/handlers/device_bridge_handler.dart"
click node_media "https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/handlers/media_bridge_handler.dart"
click node_share "https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/handlers/share_bridge_handler.dart"
click node_social "https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/social_login_handler.dart"
click node_actions "https://github.com/bottle-note/bottle-note-app/blob/main/lib/actions/back_action_handler.dart"
click node_firebase "https://github.com/bottle-note/bottle-note-app/blob/main/lib/permissions/FirebaseConfig.dart"
click node_firebaseoptions "https://github.com/bottle-note/bottle-note-app/blob/main/lib/firebase_options.dart"
click node_environment "https://github.com/bottle-note/bottle-note-app/blob/main/lib/utils/env/env.dart"
click node_android "https://github.com/bottle-note/bottle-note-app/blob/main/android/app/src/main/kotlin/com/bottlenote/official/app/MainActivity.kt"
click node_ios "https://github.com/bottle-note/bottle-note-app/blob/main/ios/Runner/AppDelegate.swift"

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_entry,node_offline,node_loading,node_logo,node_actions,node_user toneBlue
class node_webview,node_bridge,node_webbridge,node_navigation,node_handlerbase,node_auth,node_device,node_media,node_share,node_social toneAmber
class node_connectivity,node_restore,node_firebase,node_firebaseoptions,node_environment,node_android,node_ios toneMint
```

## Components

### App experience

- [Flutter entry](https://github.com/bottle-note/bottle-note-app/blob/main/lib/main.dart): `lib/main.dart`
- [Offline screen](https://github.com/bottle-note/bottle-note-app/blob/main/lib/ui/offline_screen.dart): `lib/ui/offline_screen.dart`
- [Loading UI](https://github.com/bottle-note/bottle-note-app/blob/main/lib/ui/loading_widget.dart): `lib/ui/loading_widget.dart`
- [Branding](https://github.com/bottle-note/bottle-note-app/blob/main/lib/ui/bottle_note_logo_path.dart): `lib/ui/bottle_note_logo_path.dart`
- [Back action](https://github.com/bottle-note/bottle-note-app/blob/main/lib/actions/back_action_handler.dart): `lib/actions/back_action_handler.dart`

### Web integration

- [Web view](https://github.com/bottle-note/bottle-note-app/blob/main/lib/web_view/web_view.dart): `lib/web_view/web_view.dart`
- [Bridge setup](https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/bridge_setup_script.dart): `lib/bridge/bridge_setup_script.dart`
- [Web bridge](https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/web_view_bridge_handler.dart): `lib/bridge/web_view_bridge_handler.dart`
- [Web navigation](https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/web_view_navigation_handler.dart): `lib/bridge/web_view_navigation_handler.dart`
- [Bridge base](https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/handlers/bridge_handler_base.dart): `lib/bridge/handlers/bridge_handler_base.dart`
- [Auth bridge](https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/handlers/auth_bridge_handler.dart): `lib/bridge/handlers/auth_bridge_handler.dart`
- [Device bridge](https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/handlers/device_bridge_handler.dart): `lib/bridge/handlers/device_bridge_handler.dart`
- [Media bridge](https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/handlers/media_bridge_handler.dart): `lib/bridge/handlers/media_bridge_handler.dart`
- [Share bridge](https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/handlers/share_bridge_handler.dart): `lib/bridge/handlers/share_bridge_handler.dart`
- [Social login](https://github.com/bottle-note/bottle-note-app/blob/main/lib/bridge/social_login_handler.dart): `lib/bridge/social_login_handler.dart`

### Platform services

- [Connectivity](https://github.com/bottle-note/bottle-note-app/blob/main/lib/utils/network/connectivity_service.dart): `lib/utils/network/connectivity_service.dart`
- [URL restore](https://github.com/bottle-note/bottle-note-app/blob/main/lib/utils/url_restore_manager.dart): `lib/utils/url_restore_manager.dart`
- [Firebase config](https://github.com/bottle-note/bottle-note-app/blob/main/lib/permissions/FirebaseConfig.dart): `lib/permissions/FirebaseConfig.dart`
- [Firebase options](https://github.com/bottle-note/bottle-note-app/blob/main/lib/firebase_options.dart): `lib/firebase_options.dart`
- [Environment config](https://github.com/bottle-note/bottle-note-app/blob/main/lib/utils/env/env.dart): `lib/utils/env/env.dart`
- [Android intent host](https://github.com/bottle-note/bottle-note-app/blob/main/android/app/src/main/kotlin/com/bottlenote/official/app/MainActivity.kt): `android/app/src/main/kotlin/com/bottlenote/official/app/MainActivity.kt`
- [iOS host](https://github.com/bottle-note/bottle-note-app/blob/main/ios/Runner/AppDelegate.swift): `ios/Runner/AppDelegate.swift`

### Other components

- **App user**

## Connections

- App user → Flutter entry: opens
- Flutter entry → Web view: presents
- Web view → Bridge setup: sets up
- Web view → Web navigation: handles navigation
- Web view → Web bridge: dispatches
- Web bridge → Bridge base: uses handlers
- Web bridge → Auth bridge: dispatches
- Web bridge → Device bridge: dispatches
- Web bridge → Media bridge: dispatches
- Web bridge → Share bridge: dispatches
- Auth bridge → Social login: supports login
- Flutter entry → Back action: handles back
- Flutter entry → Connectivity: checks status
- Flutter entry → Offline screen: shows offline
- Web view → URL restore: restores URL
- Flutter entry → Loading UI: shows loading
- Flutter entry → Branding: uses branding
- Flutter entry → Firebase config: configures
- Firebase config → Firebase options: uses options
- Flutter entry → Environment config: reads settings
- Android intent host → App user: handles app intents
- iOS host → Flutter entry: hosts Flutter
