# septima/qgis-geosearch architecture

> Architecture diagram of the GitHub repository septima/qgis-geosearch, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/septima/qgis-geosearch
- Repository: https://github.com/septima/qgis-geosearch

## Overview

##### Main Components

a. User Interface Layer:
- Settings Dialog (settings_dialog.py)
- UI Components (ui_search.ui)

b. Core Services:
- GSearch Fetcher (gsearchfetcher.py)
- Suggester Service (suggester.py)
- Multi Getter Service (multigetter.py)

c. Configuration Management:
- Settings Manager (config/settings.py)
- Options Factory (config/options_factory.py)

d. External Services:
- SDFI's Gsearch API
- Dataforsyningen Authentication

**[QGIS Application]**
- ↕
**[UI Layer (Plugin Panel)]**
- ↕
**[Core Services Layer]**
- ↕
**[Configuration Layer]**
- ↕
**[External Services]**

##### Key Relationships to Highlight

- How the searchbox.py interfaces with both the UI layer and core services
- Configuration flow from settings through the QGIS Setting Manager
- Demonstrate the authentication flow for the Dataforsyningen service
- Internationalization support (i18n) connection

##### Technical Details

- Python-QGIS integration points
- API endpoints and authentication flow
- Configuration storage and retrieval paths
- Search result processing pipeline

##### Implementation Notes

- Use UML-style notation for class relationships
- Clear labels for all components
- Version compatibility information

##### User interaction flow

Keep the abstraction level focused on the architectural components while showing enough detail to understand the plugin's operation within QGIS and its interaction with external services.

- QGIS Plugin Architecture
- Python
- Qt UI Framework
- Gsearch API
- Dataforsyningen Authentication

This will create a comprehensive system design that accurately represents the plugin's architecture while maintaining clarity and usefulness for development and documentation purposes.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Layers
    subgraph QGIS["QGIS Application"]
        QP["Plugin Integration"]:::qgis
    end

    subgraph UI["User Interface Layer"]
        SBP["Search Box Panel"]:::ui
        SD["Settings Dialog"]:::ui
        UIC["UI Components"]:::ui
    end

    subgraph Core["Core Services Layer"]
        GSF["GSearch Fetcher"]:::core
        SS["Suggester Service"]:::core
        MGS["Multi Getter Service"]:::core
    end

    subgraph Config["Configuration Layer"]
        SM["Settings Manager"]:::config
        OF["Options Factory"]:::config
        SC["Settings Configuration"]:::config
        I18N["Internationalization"]:::config
    end

    subgraph External["External Services"]
        GSAPI["SDFI GSearch API"]:::external
        DFS["Dataforsyningen Auth"]:::external
    end

    %% Relationships
    QP --> SBP
    QP --> SD
    
    SBP --> GSF
    SBP --> SS
    SD --> SM
    
    GSF --> MGS
    SS --> MGS
    MGS --> GSAPI
    
    SM --> OF
    OF --> SC
    SC --> DFS
    
    %% Component Mappings
    click SBP "https://github.com/Septima/qgis-geosearch/blob/master/src/geosearch_dk/searchbox.py"
    click SD "https://github.com/Septima/qgis-geosearch/blob/master/src/geosearch_dk/config/settings_dialog.py"
    click UIC "https://github.com/Septima/qgis-geosearch/blob/master/src/geosearch_dk/ui_search.ui"
    click GSF "https://github.com/Septima/qgis-geosearch/blob/master/src/geosearch_dk/gsearchfetcher.py"
    click SS "https://github.com/Septima/qgis-geosearch/blob/master/src/geosearch_dk/suggester.py"
    click MGS "https://github.com/Septima/qgis-geosearch/blob/master/src/geosearch_dk/multigetter.py"
    click SM "https://github.com/Septima/qgis-geosearch/blob/master/src/geosearch_dk/config/qgissettingmanager/setting_manager.py"
    click OF "https://github.com/Septima/qgis-geosearch/blob/master/src/geosearch_dk/config/options_factory.py"
    click SC "https://github.com/Septima/qgis-geosearch/blob/master/src/geosearch_dk/config/settings.py"
    click QP "https://github.com/Septima/qgis-geosearch/blob/master/src/geosearch_dk/__init__.py"
    click I18N "https://github.com/Septima/qgis-geosearch/tree/master/src/geosearch_dk/i18n"

    %% Styling
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef core fill:#2ecc71,stroke:#27ae60,color:white
    classDef config fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef qgis fill:#9b59b6,stroke:#8e44ad,color:white

    %% Legend
    subgraph Legend
        L1["UI Components"]:::ui
        L2["Core Services"]:::core
        L3["Configuration"]:::config
        L4["External Services"]:::external
        L5["QGIS Integration"]:::qgis
    end
```
