# bishalspkt/geojson-app architecture

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

- Interactive diagram: https://gitdiagram.com/bishalspkt/geojson-app
- Repository: https://github.com/bishalspkt/geojson-app

## Overview

##### Component Relationships

Key relationships to highlight:
- Component ↔ MapLibre
- Controls → Map Component
- UI Components → Map Controls
- Utils Services → All Components

##### Detailed Component Breakdown

Controls Section:
**MapControls**
- Panels
- CreatePanel
- LayersPanel
- UploadPanel
- BasePanel
- PasteGeoJSON
- UploadGeoJSON

##### Data Flow Highlights

Flow of GeoJSON data:
- File Import → GeoJSON Utils → Map Component
- User Input → Map Controls → Map Component
- Component → Export Function

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "User Interface Layer"
        direction TB
        MapComponent["Map Component"]:::ui
        MapControls["Map Controls"]:::ui
        UIComponents["UI Components"]:::ui
        
        subgraph "Map Controls Components"
            direction TB
            Panels["Control Panels"]:::ui
            CreatePanel["Create Panel"]:::ui
            LayersPanel["Layers Panel"]:::ui
            UploadPanel["Upload Panel"]:::ui
            BasePanel["Base Panel"]:::ui
            PasteGeoJSON["Paste GeoJSON"]:::ui
            UploadGeoJSON["Upload GeoJSON"]:::ui
            
            Panels --> CreatePanel
            Panels --> LayersPanel
            Panels --> UploadPanel
            Panels --> BasePanel
            MapControls --> Panels
            MapControls --> PasteGeoJSON
            MapControls --> UploadGeoJSON
        end
        
        MapLabel["Map Label"]:::ui
        MapComponent --> MapLabel
    end
    
    subgraph "Core Services Layer"
        direction TB
        GeoJSONUtils["GeoJSON Utils"]:::service
        MapUtils["Map Utils"]:::service
        GeneralUtils["General Utils"]:::service
    end
    
    subgraph "External Services Layer"
        direction TB
        MapLibre["MapLibre"]:::external
        FileSystem["File System"]:::external
    end
    
    subgraph "Assets"
        direction TB
        MapAssets["Map Styles/Assets"]:::asset
        SampleData["Sample GeoJSON Data"]:::asset
    end
    
    %% Relationships
    MapComponent <--> MapLibre
    MapControls --> MapComponent
    UIComponents --> MapControls
    GeoJSONUtils --> MapComponent
    GeoJSONUtils --> MapControls
    MapUtils --> MapComponent
    GeneralUtils --> MapComponent
    GeneralUtils --> MapControls
    FileSystem <--> UploadGeoJSON
    FileSystem <--> PasteGeoJSON
    MapAssets --> MapComponent
    SampleData --> MapComponent
    
    %% Click Events
    click MapComponent "https://github.com/bishalspkt/geojson-app/blob/main/src/components/map/map.tsx"
    click MapControls "https://github.com/bishalspkt/geojson-app/blob/main/src/components/map-controls/map-controls.tsx"
    click UIComponents "https://github.com/bishalspkt/geojson-app/tree/main/src/components/ui/"
    click GeoJSONUtils "https://github.com/bishalspkt/geojson-app/blob/main/src/lib/geojson-utils.tsx"
    click MapUtils "https://github.com/bishalspkt/geojson-app/blob/main/src/lib/map-utils.tsx"
    click GeneralUtils "https://github.com/bishalspkt/geojson-app/blob/main/src/lib/utils.ts"
    click CreatePanel "https://github.com/bishalspkt/geojson-app/blob/main/src/components/map-controls/panels/create-panel.tsx"
    click LayersPanel "https://github.com/bishalspkt/geojson-app/blob/main/src/components/map-controls/panels/layers-panel.tsx"
    click UploadPanel "https://github.com/bishalspkt/geojson-app/blob/main/src/components/map-controls/panels/upload-panel.tsx"
    click BasePanel "https://github.com/bishalspkt/geojson-app/blob/main/src/components/map-controls/panels/panel.tsx"
    click PasteGeoJSON "https://github.com/bishalspkt/geojson-app/blob/main/src/components/map-controls/paste-geojson.tsx"
    click UploadGeoJSON "https://github.com/bishalspkt/geojson-app/blob/main/src/components/map-controls/upload-geojson.tsx"
    click MapAssets "https://github.com/bishalspkt/geojson-app/tree/main/public/map-assets/"
    click SampleData "https://github.com/bishalspkt/geojson-app/tree/main/src/assets/samples/"
    click MapLabel "https://github.com/bishalspkt/geojson-app/blob/main/src/components/map/map-label.tsx"
    
    %% Styling
    classDef ui fill:#2563eb,color:white,stroke:none
    classDef service fill:#16a34a,color:white,stroke:none
    classDef external fill:#ea580c,color:white,stroke:none
    classDef asset fill:#6b7280,color:white,stroke:none
    
    %% Legend
    subgraph Legend
        direction TB
        UI[UI Component]:::ui
        Service[Service]:::service
        External[External Service]:::external
        Asset[Asset]:::asset
    end
```
