# bastien-baloup/cryptostars architecture

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

- Interactive diagram: https://gitdiagram.com/bastien-baloup/cryptostars
- Repository: https://github.com/bastien-baloup/cryptostars

## Overview

##### Main Components Identification
The system can be broken down into these key components:

- Frontend Application (Vue.js)
- External Data Provider (Polygon.io API)
- Data Visualization Layer (D3.js)

##### Client Layer (Blue rectangle)
- Vue Router (src/router)
- Vue Components
- Views (Home, CryptoPage)
- Reusable Components (SearchBar, Scatter)

##### Service Layer (Green rectangle)
- PoligonIO Service (API Integration)
- Data Processing Services

##### Visualization Layer (Purple rectangle)
- D3.js Integration
- Custom Helpers

##### External Services (Gray cloud)
- Polygon.io API

**[Client Browser] ←→ [Vue.js Frontend]**
- ↓
- [Router]
- ↓
- [Views & Components Layer]
- ↓
- [Services Layer] ←→ [Polygon.io API]
- ↓
- [Visualization Layer]

##### Detailed Component Breakdown

For each major component, include:

Frontend (Vue.js):
- Router configuration (src/router/index.js)
- Views:
- Home.vue (Market Overview)
- CryptoPage.vue (Currency Pair History)
- Components:
- SearchBar.vue (Accessible Search)
- Scatter.vue (Data Visualization)

Services:
- PoligonIO.js (API Integration)
- Composables (now.js)

Visualization:
- D3 Helper (d3Helper.js)
- Interactive Features:
- Zoom/Pan
- Tooltips
- Point Highlighting

##### Technical Stack Indicators

- Vue.js 3
- D3.js
- Axios
- Vite (Build tool)

##### Interaction Patterns

Highlight:
- Search functionality flow
- Data visualization interaction patterns
- Currency pair selection flow
- Time period selection mechanism

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
    end

    subgraph "Vue.js Frontend"
        App["App.vue"]:::vue
        Main["main.js"]:::vue
        Router["Vue Router"]:::vue
        
        subgraph "Views Layer"
            Home["Home View"]:::vue
            Crypto["CryptoPage View"]:::vue
        end
        
        subgraph "Components Layer"
            Search["SearchBar"]:::vue
            ScatterPlot["Scatter Plot"]:::vue
        end
    end

    subgraph "Services Layer"
        API["PoligonIO Service"]:::service
        Time["Time Composable"]:::service
    end

    subgraph "Visualization Layer"
        D3["D3.js Helper"]:::viz
    end

    subgraph "External Services"
        PolygonAPI["Polygon.io API"]:::external
    end

    Browser --> App
    App --> Router
    Router --> Home
    Router --> Crypto
    Home --> Search
    Crypto --> Search
    Home --> ScatterPlot
    Crypto --> ScatterPlot
    ScatterPlot --> D3
    Search --> API
    API <--> PolygonAPI
    Time --> Home
    Time --> Crypto

    %% Click Events
    click Router "https://github.com/Bastien-Baloup/CryptoStars/blob/main/src/router/index.js"
    click Home "https://github.com/Bastien-Baloup/CryptoStars/blob/main/src/views/Home.vue"
    click Crypto "https://github.com/Bastien-Baloup/CryptoStars/blob/main/src/views/CryptoPage.vue"
    click Search "https://github.com/Bastien-Baloup/CryptoStars/blob/main/src/components/SearchBar.vue"
    click ScatterPlot "https://github.com/Bastien-Baloup/CryptoStars/blob/main/src/components/Scatter.vue"
    click API "https://github.com/Bastien-Baloup/CryptoStars/blob/main/src/services/PoligonIO.js"
    click D3 "https://github.com/Bastien-Baloup/CryptoStars/blob/main/src/helpers/d3Helper.js"
    click Time "https://github.com/Bastien-Baloup/CryptoStars/blob/main/src/composables/now.js"
    click App "https://github.com/Bastien-Baloup/CryptoStars/blob/main/src/App.vue"
    click Main "https://github.com/Bastien-Baloup/CryptoStars/blob/main/src/main.js"

    %% Styling
    classDef vue fill:#41B883,stroke:#35495E,color:white
    classDef service fill:#64B5F6,stroke:#1976D2,color:white
    classDef viz fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef external fill:#90A4AE,stroke:#546E7A,color:white

    %% Legend
    subgraph Legend
        L1["Vue.js Component"]:::vue
        L2["Service Component"]:::service
        L3["Visualization Component"]:::viz
        L4["External Service"]:::external
    end
```
