# megatron69-26/fnmf-app-test architecture

> Architecture diagram of the GitHub repository megatron69-26/fnmf-app-test, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/megatron69-26/fnmf-app-test
- Repository: https://github.com/megatron69-26/fnmf-app-test

## Overview

FNMF is an Android financial-news, market-forecasting, and simulated-trading client. The main user journey is to inspect market data and news, review forecasts, then practice trades; supporting capabilities include authenticated sessions, offline watchlists/news, and wallet/profile history. The README documents provider selection, stock polling, stale-data trade guards, and local Room storage. Source excerpts were not provided, so implementation-level call ownership and most UI-to-data links cannot be verified; only documented relationships are shown.

Main entry points: [`app/src/main/java/com/example/nhumonglenh/ui/trading`](https://github.com/megatron69-26/fnmf-app-test/tree/main/app/src/main/java/com/example/nhumonglenh/ui/trading) (Provider policies), [`app/src/main/java/com/example/nhumonglenh/TradingFragment.kt`](https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/TradingFragment.kt) (Trading screen), [`app/src/main/java/com/example/nhumonglenh/data/repository/NewsRepository.kt`](https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/data/repository/NewsRepository.kt) (News repository), [`app/src/main/java/com/example/nhumonglenh/data/local/AppDatabase.java`](https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/data/local/AppDatabase.java) (Room offline store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_market["Market Data"]
  node_trading_ui["Trading screen<br/>[TradingFragment.kt]"]
  node_ticker["Market ticker"]
  node_market_policy["Provider policies"]
  node_stock_polling["Stock polling"]
end

subgraph group_insights["News Forecasts"]
  node_news_feed["News feed"]
  node_news_data["News repository<br/>[NewsRepository.kt]"]
  node_forecast_ui["Forecast screen"]
  node_forecast_data["Forecast repository"]
end

subgraph group_trading["Trading Wallet"]
  node_order_ticket["Order ticket"]
  node_wallet["Wallet and profile<br/>[WalletFragment.kt]"]
  node_watchlist["Watchlist"]
end

subgraph group_platform["Client Platform"]
  node_local_store[("Room offline store<br/>[AppDatabase.java]")]
  node_auth["Secure sessions"]
  node_api_client["API client"]
end

node_investor(("Investor"))
node_binance{{"Binance"}}
node_alpaca{{"Alpaca"}}
node_twelve_data{{"Twelve Data"}}
node_backend{{"FNMF backend"}}

node_investor -.->|"opens"| node_trading_ui
node_market_policy -->|"streams crypto"| node_binance
node_market_policy -->|"routes stocks"| node_alpaca
node_market_policy -->|"routes stocks"| node_twelve_data
node_stock_polling -->|"polls stock data"| node_backend
node_trading_ui -.->|"offers trades"| node_order_ticket
node_trading_ui -.->|"uses provider policy"| node_market_policy
node_news_feed -.->|"loads news"| node_news_data
node_forecast_ui -.->|"loads forecasts"| node_forecast_data
node_news_data -->|"uses offline cache"| node_local_store
node_watchlist -->|"stores offline data"| node_local_store
node_api_client -->|"connects to"| node_backend

click node_trading_ui "https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/TradingFragment.kt"
click node_ticker "https://github.com/megatron69-26/fnmf-app-test/tree/main/app/src/main/java/com/example/nhumonglenh/ui/ticker"
click node_market_policy "https://github.com/megatron69-26/fnmf-app-test/tree/main/app/src/main/java/com/example/nhumonglenh/ui/trading"
click node_stock_polling "https://github.com/megatron69-26/fnmf-app-test/tree/main/app/src/main/java/com/example/nhumonglenh/ui/trading"
click node_news_feed "https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/ui/news/NewsFeedFragment.kt"
click node_news_data "https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/data/repository/NewsRepository.kt"
click node_forecast_ui "https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/ForecastFragment.kt"
click node_forecast_data "https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/data/repository/ForecastRepository.kt"
click node_order_ticket "https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/ui/trading/OrderTicketBottomSheet.kt"
click node_wallet "https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/ui/wallet/WalletFragment.kt"
click node_watchlist "https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/ui/watchlist/WatchlistFragment.kt"
click node_local_store "https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/data/local/AppDatabase.java"
click node_auth "https://github.com/megatron69-26/fnmf-app-test/tree/main/app/src/main/java/com/example/nhumonglenh/data/local"
click node_api_client "https://github.com/megatron69-26/fnmf-app-test/tree/main/app/src/main/java/com/example/nhumonglenh/data/remote"

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_trading_ui,node_ticker,node_market_policy,node_stock_polling toneBlue
class node_news_feed,node_news_data,node_forecast_ui,node_forecast_data toneAmber
class node_order_ticket,node_wallet,node_watchlist toneMint
class node_local_store,node_auth,node_api_client toneRose
class node_investor,node_binance,node_alpaca,node_twelve_data,node_backend toneIndigo
```

## Components

### Market Data

- [Trading screen](https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/TradingFragment.kt): `app/src/main/java/com/example/nhumonglenh/TradingFragment.kt`
- [Market ticker](https://github.com/megatron69-26/fnmf-app-test/tree/main/app/src/main/java/com/example/nhumonglenh/ui/ticker): `app/src/main/java/com/example/nhumonglenh/ui/ticker`
- [Provider policies](https://github.com/megatron69-26/fnmf-app-test/tree/main/app/src/main/java/com/example/nhumonglenh/ui/trading): `app/src/main/java/com/example/nhumonglenh/ui/trading`
- [Stock polling](https://github.com/megatron69-26/fnmf-app-test/tree/main/app/src/main/java/com/example/nhumonglenh/ui/trading): `app/src/main/java/com/example/nhumonglenh/ui/trading`

### News Forecasts

- [News feed](https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/ui/news/NewsFeedFragment.kt): `app/src/main/java/com/example/nhumonglenh/ui/news/NewsFeedFragment.kt`
- [News repository](https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/data/repository/NewsRepository.kt): `app/src/main/java/com/example/nhumonglenh/data/repository/NewsRepository.kt`
- [Forecast screen](https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/ForecastFragment.kt): `app/src/main/java/com/example/nhumonglenh/ForecastFragment.kt`
- [Forecast repository](https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/data/repository/ForecastRepository.kt): `app/src/main/java/com/example/nhumonglenh/data/repository/ForecastRepository.kt`

### Trading Wallet

- [Order ticket](https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/ui/trading/OrderTicketBottomSheet.kt): `app/src/main/java/com/example/nhumonglenh/ui/trading/OrderTicketBottomSheet.kt`
- [Wallet and profile](https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/ui/wallet/WalletFragment.kt): `app/src/main/java/com/example/nhumonglenh/ui/wallet/WalletFragment.kt`
- [Watchlist](https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/ui/watchlist/WatchlistFragment.kt): `app/src/main/java/com/example/nhumonglenh/ui/watchlist/WatchlistFragment.kt`

### Client Platform

- [Room offline store](https://github.com/megatron69-26/fnmf-app-test/blob/main/app/src/main/java/com/example/nhumonglenh/data/local/AppDatabase.java): `app/src/main/java/com/example/nhumonglenh/data/local/AppDatabase.java`
- [Secure sessions](https://github.com/megatron69-26/fnmf-app-test/tree/main/app/src/main/java/com/example/nhumonglenh/data/local): `app/src/main/java/com/example/nhumonglenh/data/local`
- [API client](https://github.com/megatron69-26/fnmf-app-test/tree/main/app/src/main/java/com/example/nhumonglenh/data/remote): `app/src/main/java/com/example/nhumonglenh/data/remote`

### Other components

- **Investor**
- **Binance**
- **Alpaca**
- **Twelve Data**
- **FNMF backend**

## Connections

- Investor → Trading screen: opens
- Provider policies → Binance: streams crypto (evidence: `README.md`)
- Provider policies → Alpaca: routes stocks (evidence: `README.md`)
- Provider policies → Twelve Data: routes stocks (evidence: `README.md`)
- Stock polling → FNMF backend: polls stock data (evidence: `README.md`)
- Trading screen → Order ticket: offers trades
- Trading screen → Provider policies: uses provider policy
- News feed → News repository: loads news
- Forecast screen → Forecast repository: loads forecasts
- News repository → Room offline store: uses offline cache (evidence: `README.md`)
- Watchlist → Room offline store: stores offline data (evidence: `README.md`)
- API client → FNMF backend: connects to (evidence: `README.md`)
