# yoavwolf97/milkywayout- architecture

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

- Interactive diagram: https://gitdiagram.com/yoavwolf97/milkywayout-
- Repository: https://github.com/yoavwolf97/milkywayout-

## Overview

##### Main System Components

a) Frontend Layer
- Static Pages (Astro Components)
- Interactive Components
- Asset Management
- Client-side Utils

b) Backend Layer
- Astro SSR
- API Routes
- Data Management

c) Database Layer
- Supabase as the primary database
- Migrations management

##### Component Relationships

a) Frontend Architecture
- Component hierarchy:
- Layouts (DestinationLayout, Layout)
- Pages (destinations, calculator, countries)
- Reusable Components (navigation, common, calculator)
- Utils (calculations, formatters, imageUtils)

b) Data Flow
- Client → API Routes
- API Routes → Supabase
- Static Assets → Client
- Integration → Client

##### Specific Features to Highlight

a) Travel Calculator System
- BudgetForm
- CalculatorResults
- DestinationRecommendations

b) Destination Management
- DestinationGrid
- FilterBar
- ImageGallery

c) Integration
- MapMarker
- SeychellesMap
- Dependencies

##### Technical Details

Annotations for:

- Astro's Static Site Generation
- Supabase Integration
- Image Optimization
- Client-side Interactivity

**[Client Layer (Browser)]**
- ↕
**[Astro Static/SSR Layer]**
- ↕
**[API Layer]**
- ↕
**[Database Layer (Supabase)]**

##### Additional Elements

Include:
- Version/environment information
- Build/deployment flow
- Key dependencies and their roles

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Browser/Client Side"]
        StaticPages["Static Pages"]:::frontend
        InteractiveComponents["Interactive Components"]:::frontend
        AssetManagement["Asset Management"]:::frontend
        ClientUtils["Client-side Utils"]:::frontend
    end

    subgraph AstroLayer
        SSR["Astro SSR"]:::server
        
        subgraph Components
            Layouts["Layout Components"]:::frontend
            Calculator["Travel Calculator"]:::frontend
            Destinations["Destination Management"]:::frontend
            Maps["Map Integration"]:::frontend
            Navigation["Navigation System"]:::frontend
            Common["Common Components"]:::frontend
            Home["Home Components"]:::frontend
            Seychelles["Seychelles Features"]:::frontend
        end
        
        subgraph Utils
            CalcUtils["Calculation Utils"]:::util
            FormatUtils["Formatting Utils"]:::util
            ImageUtils["Image Utils"]:::util
            MapUtils["Map Utils"]:::util
        end
    end

    subgraph ServerLayer
        APIRoutes["API Routes"]:::server
        DataManagement["Data Management"]:::server
        Types["Type Definitions"]:::server
        DataSources["Data Sources"]:::server
    end

    subgraph DatabaseLayer
        Supabase["Supabase Database"]:::database
        Migrations["Database Migrations"]:::database
    end

    Browser --> StaticPages
    StaticPages --> Components
    InteractiveComponents --> Components
    Components --> Utils
    Components --> APIRoutes
    APIRoutes --> Supabase
    DataManagement --> Supabase
    Migrations --> Supabase

    %% Click Events
    click StaticPages "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/pages/"
    click Layouts "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/layouts/"
    click Calculator "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/components/calculator/"
    click Destinations "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/components/destinations/"
    click Maps "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/components/maps/"
    click MapUtils "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/utils/map/"
    click Navigation "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/components/navigation/"
    click Supabase "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/lib/supabase/"
    click Migrations "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/supabase/migrations/"
    click APIRoutes "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/pages/api/"
    click Types "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/types/"
    click DataSources "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/data/"
    click CalcUtils "https://github.com/yoavwolf97/MilkyWayOut-/blob/main/src/utils/calculations.ts"
    click FormatUtils "https://github.com/yoavwolf97/MilkyWayOut-/blob/main/src/utils/formatters.ts"
    click ImageUtils "https://github.com/yoavwolf97/MilkyWayOut-/blob/main/src/utils/imageUtils.ts"
    click AssetManagement "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/public/"
    click Common "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/components/common/"
    click Home "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/components/home/"
    click Seychelles "https://github.com/yoavwolf97/MilkyWayOut-/tree/main/src/components/seychelles/"

    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef server fill:#2ecc71,stroke:#27ae60,color:white
    classDef database fill:#e67e22,stroke:#d35400,color:white
    classDef util fill:#9b59b6,stroke:#8e44ad,color:white

    %% Legend
    subgraph Legend
        Frontend["Frontend Component"]:::frontend
        Server["Server Component"]:::server
        Database["Database Component"]:::database
        Utility["Utility Component"]:::util
    end
```
