# shibinsp/geo-visualizer-upload architecture

> Architecture diagram of the GitHub repository shibinsp/geo-visualizer-upload, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shibinsp/geo-visualizer-upload
- Repository: https://github.com/shibinsp/geo-visualizer-upload

## Overview

##### Project type and purpose
- This is a single-page web application (SPA) built with React and TypeScript, bootstrapped by Vite.
- It provides a GIS-focused user interface for uploading files, viewing maps, and summarizing spatial data, while relying on Supabase as its backend (authentication, database, storage).

##### File structure
- Top-level directories and key files:
- public/ – static assets (robots.txt, favicon, index.html)
- src/ – all React source code
– components/ – feature components (GISApplication, MapView, FileUploader, DataSummary)
– components/ui/ – shadcn-ui building blocks (buttons, dialogs, navigation, etc.)
– hooks/ – custom React hooks (useMobile, useToast)
– integrations/supabase/ – Supabase client initialization and types
– lib/ – utility functions
– pages/ – top-level routes (Index, NotFound)
– main.tsx – SPA bootstrap
- supabase/ – supabase CLI config.toml (for migrations, local dev)
- vite.config.ts, tsconfig*.json, tailwind.config.ts – build and styling configs

##### README for insights
- Tech stack: Vite, TypeScript, React, shadcn-ui, Tailwind CSS
- Deployment flows via Lovable (automates commits, preview, publish)
- Supabase is the only backend—no custom server code

##### Elements
- Clear, descriptive labels for each component or service
- Circles for UI components
- Rectangles for services/APIs

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Entities
    Browser(("User Browser")):::external
    CDN["Static Hosting / CDN"]:::service

    %% React SPA Container
    subgraph "React SPA" 
        direction TB
        HTML["HTML Entry Point"]:::service
        Bootstrap["SPA Bootstrap"]:::service
        App["Root App Component"]:::ui

        subgraph "UI Layer"
            direction TB
            UIBlocks(("UI Building Blocks")):::ui
        end

        subgraph "Feature Components"
            direction TB
            GISApp(("GISApplication")):::ui
            MapView(("MapView")):::ui
            FileUploader(("FileUploader")):::ui
            DataSummary(("DataSummary")):::ui
        end

        subgraph "Business Logic"
            direction TB
            UseMobile(("useMobile Hook")):::logic
            UseToast(("useToast Hook")):::logic
            Utils(("Utility Functions")):::logic
        end

        subgraph "Data Integration"
            direction TB
            SupabaseClient["Supabase Client Module"]:::service
            SupabaseTypes["Supabase Types"]:::service
        end

        subgraph "Top-Level Routes"
            direction TB
            HomePage(("Index Page")):::ui
            NotFound(("404 Page")):::ui
        end
    end

    %% Supabase Services
    subgraph "Supabase Services"
        direction TB
        AuthService["Auth Service"]:::service
        Database[(Database)]:::db
        Storage[(Storage)]:::db
        SupabaseConfig["CLI Configuration"]:::service
    end

    ExternalMapAPI["External Map API"]:::service

    %% Connections
    Browser -->|"GET index.html and assets"| CDN
    CDN -->|serves| HTML
    HTML -->|loads| Bootstrap
    Bootstrap -->|initializes| App
    App -->|renders| UIBlocks
    App -->|routes to| HomePage
    App -->|routes to| NotFound

    App -->|uses| GISApp
    App -->|uses| MapView
    App -->|uses| FileUploader
    App -->|uses| DataSummary

    GISApp -->|calls| UseMobile
    GISApp -->|calls| UseToast
    MapView -->|calls| UseMobile
    MapView -->|calls| Utils
    FileUploader -->|calls| UseToast
    FileUploader -->|calls| Utils
    DataSummary -->|calls| Utils

    GISApp -->|queries/uploads| SupabaseClient
    MapView -->|tile requests| ExternalMapAPI
    FileUploader -->|upload to| SupabaseClient
    DataSummary -->|fetch metadata| SupabaseClient

    SupabaseClient -->|auth flows| AuthService
    SupabaseClient -->|data queries| Database
    SupabaseClient -->|file storage| Storage

    %% Click Events
    click Browser "https://github.com/shibinsp/geo-visualizer-upload/tree/main/public/"
    click HTML "https://github.com/shibinsp/geo-visualizer-upload/blob/main/index.html"
    click Bootstrap "https://github.com/shibinsp/geo-visualizer-upload/blob/main/src/main.tsx"
    click App "https://github.com/shibinsp/geo-visualizer-upload/blob/main/src/App.tsx"
    click GISApp "https://github.com/shibinsp/geo-visualizer-upload/blob/main/src/components/GISApplication.tsx"
    click MapView "https://github.com/shibinsp/geo-visualizer-upload/blob/main/src/components/MapView.tsx"
    click FileUploader "https://github.com/shibinsp/geo-visualizer-upload/blob/main/src/components/FileUploader.tsx"
    click DataSummary "https://github.com/shibinsp/geo-visualizer-upload/blob/main/src/components/DataSummary.tsx"
    click UIBlocks "https://github.com/shibinsp/geo-visualizer-upload/tree/main/src/components/ui/"
    click UseMobile "https://github.com/shibinsp/geo-visualizer-upload/blob/main/src/hooks/use-mobile.tsx"
    click UseToast "https://github.com/shibinsp/geo-visualizer-upload/blob/main/src/hooks/use-toast.ts"
    click Utils "https://github.com/shibinsp/geo-visualizer-upload/blob/main/src/lib/utils.ts"
    click SupabaseClient "https://github.com/shibinsp/geo-visualizer-upload/blob/main/src/integrations/supabase/client.ts"
    click SupabaseTypes "https://github.com/shibinsp/geo-visualizer-upload/blob/main/src/integrations/supabase/types.ts"
    click HomePage "https://github.com/shibinsp/geo-visualizer-upload/blob/main/src/pages/Index.tsx"
    click NotFound "https://github.com/shibinsp/geo-visualizer-upload/blob/main/src/pages/NotFound.tsx"
    click SupabaseConfig "https://github.com/shibinsp/geo-visualizer-upload/blob/main/supabase/config.toml"

    %% Styles
    classDef external fill:#f9f,stroke:#333,stroke-width:2px
    classDef service fill:#b3e5fc,stroke:#0288d1,stroke-width:1px
    classDef ui fill:#ffecb3,stroke:#f9a825,stroke-width:1px
    classDef logic fill:#c8e6c9,stroke:#2e7d32,stroke-width:1px
    classDef db fill:#ffe0b2,stroke:#ef6c00,stroke-width:1px
```
