# amruthaamara1/stockmarketdashboard architecture

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

- Interactive diagram: https://gitdiagram.com/amruthaamara1/stockmarketdashboard
- Repository: https://github.com/amruthaamara1/stockmarketdashboard

## Overview

##### Project type and purpose
- This is a desktop application built with C# and .NET WPF (Windows Presentation Foundation).
- Its purpose is to fetch real-time stock data from the Twelve Data API and present it in an interactive DataGrid UI.

##### File structure
- Top-level solution (`StockMarketDashboard.sln`) contains a single WPF project (`StockMarketDashboard`).
- UI layer:
- App.xaml / App.xaml.cs – application startup and resources
- MainWindow.xaml / MainWindow.xaml.cs – primary window and code-behind
- Application logic / services:
- StockDataService.cs – handles HTTP requests to the Twelve Data API
- Data models:
- MetaData.cs, StockData.cs, StockDataItem.cs, StockDataResponse.cs – strong-typed representations of API payloads
- Project file and configs:
- StockMarketDashboard.csproj – references, NuGet packages, build settings

##### README for additional insights
- Emphasizes “Live Stock Data,” “Interactive UI,” and “API Integration.”
- Technology stack is .NET WPF on Windows, with external dependency on Twelve Data API (8 calls/min limit).

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User Interaction
    User["User"] 

    %% UI Layer
    subgraph "UI Layer (WPF App)"
        AppXaml["App.xaml"]:::ui
        AppCS["App.xaml.cs"]:::ui
        MainXaml["MainWindow.xaml"]:::ui
        MainCS["MainWindow.xaml.cs"]:::ui
    end

    %% Service Layer
    subgraph "Service Layer"
        StockService["StockDataService.cs"]:::service
    end

    %% Data Model Layer
    subgraph "Data Model Layer"
        Meta["MetaData.cs"]:::model
        StockData["StockData.cs"]:::model
        Item["StockDataItem.cs"]:::model
        Response["StockDataResponse.cs"]:::model
    end

    %% External Service
    TwelveAPI["Twelve Data API"]:::external

    %% Connections
    User -->|"interacts with"| MainXaml
    MainXaml -->|"code-behind"| MainCS
    MainCS -->|"invokes FetchStockData()"| StockService
    StockService -->|"HTTP GET (8 calls/min)"| TwelveAPI
    TwelveAPI -->|"JSON response"| StockService
    StockService -->|"maps to objects"| Meta
    StockService -->|"maps to objects"| StockData
    StockService -->|"maps to objects"| Item
    StockService -->|"maps to objects"| Response
    Meta -->|"used for UI refresh"| MainCS
    StockData -->|"used for UI refresh"| MainCS
    Item -->|"used for UI refresh"| MainCS
    Response -->|"used for UI refresh"| MainCS

    %% Click Events
    click AppXaml "https://github.com/amruthaamara1/stockmarketdashboard/blob/master/StockMarketDashboard/App.xaml"
    click AppCS "https://github.com/amruthaamara1/stockmarketdashboard/blob/master/StockMarketDashboard/App.xaml.cs"
    click MainXaml "https://github.com/amruthaamara1/stockmarketdashboard/blob/master/StockMarketDashboard/MainWindow.xaml"
    click MainCS "https://github.com/amruthaamara1/stockmarketdashboard/blob/master/StockMarketDashboard/MainWindow.xaml.cs"
    click StockService "https://github.com/amruthaamara1/stockmarketdashboard/blob/master/StockMarketDashboard/StockDataService.cs"
    click Meta "https://github.com/amruthaamara1/stockmarketdashboard/blob/master/StockMarketDashboard/MetaData.cs"
    click StockData "https://github.com/amruthaamara1/stockmarketdashboard/blob/master/StockMarketDashboard/StockData.cs"
    click Item "https://github.com/amruthaamara1/stockmarketdashboard/blob/master/StockMarketDashboard/StockDataItem.cs"
    click Response "https://github.com/amruthaamara1/stockmarketdashboard/blob/master/StockMarketDashboard/StockDataResponse.cs"
    click Solution "https://github.com/amruthaamara1/stockmarketdashboard/blob/master/StockMarketDashboard.sln"
    click Project "https://github.com/amruthaamara1/stockmarketdashboard/blob/master/StockMarketDashboard/StockMarketDashboard.csproj"

    %% Styles
    classDef ui fill:#D0E6FF,stroke:#0366D6,stroke-width:1px
    classDef service fill:#E6FFEA,stroke:#28A745,stroke-width:1px
    classDef model fill:#FFF5BA,stroke:#DBAB09,stroke-width:1px
    classDef external fill:#F0F0F0,stroke:#666666,stroke-width:1px,stroke-dasharray: 5 5
    class User external
    class TwelveAPI external
```
