# medseddik1999/financeshiny architecture

> Architecture diagram of the GitHub repository medseddik1999/financeshiny, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/medseddik1999/financeshiny
- Repository: https://github.com/medseddik1999/financeshiny

## Overview

FinanceShiny is a Shiny investment-analysis application. The documented user workflow is to explore stocks and portfolios, review historical or real-time data and risk/return metrics, and compare allocation strategies. News sentiment analysis is a separate documented capability; the excerpted Python module fetches articles and scores their descriptions with a serialized model. The app and R implementation files were not sampled, so links from the Shiny entry point to specific features are not verified; dashed edges mark those gaps.

Main entry points: [`app.R`](https://github.com/medseddik1999/financeshiny/blob/main/app.R) (Shiny app), [`trypy.py`](https://github.com/medseddik1999/financeshiny/blob/main/trypy.py) (News sentiment), [`modelSVC.pkl`](https://github.com/medseddik1999/financeshiny/blob/main/modelSVC.pkl) (Sentiment model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Shiny application"]
  node_shiny["Shiny app<br/>[app.R]"]
  node_rfunctions["R functions<br/>[Functions.R]"]
end

subgraph group_portfolio["Portfolio analysis"]
  node_optimization["Portfolio optimization<br/>[app.R]"]
  node_metrics["Performance and risk<br/>[app.R]"]
  node_allocations["Allocation comparison<br/>[app.R]"]
end

subgraph group_markets["Market insights"]
  node_stockoverview["Stock overview<br/>[app.R]"]
  node_marketdata["Historical and real-time data<br/>[app.R]"]
  node_tickers["Ticker symbols"]
  node_sourcecsv["Local source data<br/>[source.csv]"]
end

subgraph group_sentiment["News sentiment"]
  node_news["News sentiment<br/>[trypy.py]"]
  node_newsapi{{"News API"}}
  node_sentimentmodel["Sentiment model<br/>[modelSVC.pkl]"]
  node_newsupdates["News and updates<br/>[app.R]"]
end

node_investor(("Investor"))

node_investor -->|"uses"| node_shiny
node_shiny -.->|"offers"| node_optimization
node_shiny -.->|"offers"| node_metrics
node_shiny -.->|"offers"| node_allocations
node_shiny -.->|"offers"| node_stockoverview
node_shiny -.->|"visualizes"| node_marketdata
node_shiny -.->|"offers"| node_newsupdates
node_news -->|"fetches articles"| node_newsapi
node_news -->|"scores articles"| node_sentimentmodel

click node_shiny "https://github.com/medseddik1999/financeshiny/blob/main/app.R"
click node_rfunctions "https://github.com/medseddik1999/financeshiny/blob/main/Functions.R"
click node_optimization "https://github.com/medseddik1999/financeshiny/blob/main/app.R"
click node_metrics "https://github.com/medseddik1999/financeshiny/blob/main/app.R"
click node_allocations "https://github.com/medseddik1999/financeshiny/blob/main/app.R"
click node_stockoverview "https://github.com/medseddik1999/financeshiny/blob/main/app.R"
click node_marketdata "https://github.com/medseddik1999/financeshiny/blob/main/app.R"
click node_tickers "https://github.com/medseddik1999/financeshiny/blob/main/local%20data/tickers_symbols.csv"
click node_sourcecsv "https://github.com/medseddik1999/financeshiny/blob/main/local%20data/source.csv"
click node_news "https://github.com/medseddik1999/financeshiny/blob/main/trypy.py"
click node_sentimentmodel "https://github.com/medseddik1999/financeshiny/blob/main/modelSVC.pkl"
click node_newsupdates "https://github.com/medseddik1999/financeshiny/blob/main/app.R"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_shiny,node_rfunctions toneBlue
class node_optimization,node_metrics,node_allocations toneAmber
class node_stockoverview,node_marketdata,node_tickers,node_sourcecsv toneMint
class node_news,node_newsapi,node_sentimentmodel,node_newsupdates toneRose
class node_investor toneIndigo
```

## Components

### Shiny application

- [Shiny app](https://github.com/medseddik1999/financeshiny/blob/main/app.R): `app.R`
- [R functions](https://github.com/medseddik1999/financeshiny/blob/main/Functions.R): `Functions.R`

### Portfolio analysis

- [Portfolio optimization](https://github.com/medseddik1999/financeshiny/blob/main/app.R): `app.R`
- [Performance and risk](https://github.com/medseddik1999/financeshiny/blob/main/app.R): `app.R`
- [Allocation comparison](https://github.com/medseddik1999/financeshiny/blob/main/app.R): `app.R`

### Market insights

- [Stock overview](https://github.com/medseddik1999/financeshiny/blob/main/app.R): `app.R`
- [Historical and real-time data](https://github.com/medseddik1999/financeshiny/blob/main/app.R): `app.R`
- [Ticker symbols](https://github.com/medseddik1999/financeshiny/blob/main/local%20data/tickers_symbols.csv): `local data/tickers_symbols.csv`
- [Local source data](https://github.com/medseddik1999/financeshiny/blob/main/local%20data/source.csv): `local data/source.csv`

### News sentiment

- [News sentiment](https://github.com/medseddik1999/financeshiny/blob/main/trypy.py): `trypy.py`
- **News API**
- [Sentiment model](https://github.com/medseddik1999/financeshiny/blob/main/modelSVC.pkl): `modelSVC.pkl`
- [News and updates](https://github.com/medseddik1999/financeshiny/blob/main/app.R): `app.R`

### Other components

- **Investor**

## Connections

- Investor → Shiny app: uses (evidence: `README.md`)
- Shiny app → Portfolio optimization: offers
- Shiny app → Performance and risk: offers
- Shiny app → Allocation comparison: offers
- Shiny app → Stock overview: offers
- Shiny app → Historical and real-time data: visualizes
- Shiny app → News and updates: offers
- News sentiment → News API: fetches articles (evidence: `trypy.py`)
- News sentiment → Sentiment model: scores articles (evidence: `trypy.py`)
