# yashinrush/stock-trading-platform architecture

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

- Interactive diagram: https://gitdiagram.com/yashinrush/stock-trading-platform
- Repository: https://github.com/yashinrush/stock-trading-platform

## Overview

This repository combines a public brokerage-information site, a simulated trading dashboard, and a small Express/MongoDB API. The user-facing path is navigation through the public site or dashboard; the dashboard presents watchlist and portfolio views and opens a buy-order window, while the API exposes holdings, positions, and order endpoints. README capabilities such as authentication, stock analysis, notifications, and responsive behavior are documented but not fully evidenced by sampled implementations, so those relationships are not inferred. The dashboard-to-API wiring is also not shown in the excerpts.

Main entry points: [`frontend/src/index.js`](https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/index.js) (Site Router), [`dashboard/src/components/Home.js`](https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/Home.js) (Dashboard Shell), [`backend/index.js`](https://github.com/yashinrush/stock-trading-platform/blob/main/backend/index.js) (Express API), [`dashboard/src/components/WatchList.js`](https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/WatchList.js) (Watchlist)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Site"]
  node_public_entry["Site Router<br/>[index.js]"]
  node_public_nav["Site Navigation<br/>[Navbar.js]"]
  node_home_info["Home Overview<br/>[HomePage.js]"]
  node_about_info["Company Profile<br/>[AboutPage.js]"]
  node_products_info["Product Catalog<br/>[ProductsPage.js]"]
  node_pricing_info["Pricing Details<br/>[PricingPage.js]"]
  node_support_info["Support Topics<br/>[SupportPage.js]"]
  node_ticket_topics["Ticket Topics<br/>[CreateTicket.js]"]
  node_account_signup["Signup Screen<br/>[Signup.js]"]
  node_site_footer["Site Footer<br/>[Footer.js]"]
end

subgraph group_trading["Trading Dashboard"]
  node_dashboard_entry["Dashboard Router<br/>[index.js]"]
  node_dashboard_home["Dashboard Shell<br/>[Home.js]"]
  node_watchlist["Watchlist<br/>[WatchList.js]"]
  node_stock_data["Sample Market Data<br/>[data.js]"]
  node_buy_context["Buy Window Context<br/>[GeneralContext.js]"]
  node_buy_window["Buy Order Window<br/>[BuyActionWindow.js]"]
  node_holdings_view["Holdings View<br/>[Holdings.js]"]
  node_positions_view["Positions View<br/>[Positions.js]"]
  node_orders_view["Orders View<br/>[Orders.js]"]
  node_funds_view["Funds View<br/>[Funds.js]"]
  node_portfolio_summary["Portfolio Summary<br/>[Summary.js]"]
end

subgraph group_api["Trading API"]
  node_api_service["Express API<br/>[index.js]"]
end

subgraph group_storage["Persistence"]
  node_holdings_model["Holdings Model<br/>[HoldingsModel.js]"]
  node_positions_model["Positions Model<br/>[PositionsModel.js]"]
  node_orders_model["Orders Model<br/>[OrdersModel.js]"]
  node_mongo_store[("MongoDB")]
end

node_visitor(("Visitor"))
node_trader(("Trader"))

node_visitor -->|"opens site"| node_public_entry
node_public_entry -->|"renders"| node_public_nav
node_public_entry -->|"routes to"| node_home_info
node_public_entry -->|"routes to"| node_account_signup
node_public_entry -->|"routes to"| node_about_info
node_public_entry -->|"routes to"| node_products_info
node_public_entry -->|"routes to"| node_pricing_info
node_public_entry -->|"routes to"| node_support_info
node_public_entry -->|"renders"| node_site_footer
node_support_info -->|"renders"| node_ticket_topics
node_trader -->|"opens dashboard"| node_dashboard_entry
node_dashboard_entry -->|"routes to"| node_dashboard_home
node_dashboard_home -->|"renders"| node_watchlist
node_dashboard_home -.->|"renders"| node_holdings_view
node_dashboard_home -.->|"renders"| node_positions_view
node_dashboard_home -.->|"renders"| node_orders_view
node_dashboard_home -.->|"renders"| node_funds_view
node_dashboard_home -.->|"renders"| node_portfolio_summary
node_watchlist -->|"reads"| node_stock_data
node_watchlist -->|"opens buy window"| node_buy_context
node_buy_context -->|"renders"| node_buy_window
node_holdings_view -->|"reads"| node_stock_data
node_api_service -->|"queries"| node_holdings_model
node_api_service -->|"queries"| node_positions_model
node_api_service -->|"saves order"| node_orders_model
node_holdings_model -.->|"persists"| node_mongo_store
node_positions_model -.->|"persists"| node_mongo_store
node_orders_model -.->|"persists"| node_mongo_store
node_holdings_model -.->|"defines schema"| node_mongo_store
node_positions_model -.->|"defines schema"| node_mongo_store
node_orders_model -.->|"defines schema"| node_mongo_store

click node_public_entry "https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/index.js"
click node_public_nav "https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/Navbar.js"
click node_home_info "https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/home/HomePage.js"
click node_about_info "https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/about/AboutPage.js"
click node_products_info "https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/products/ProductsPage.js"
click node_pricing_info "https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/pricing/PricingPage.js"
click node_support_info "https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/support/SupportPage.js"
click node_ticket_topics "https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/support/CreateTicket.js"
click node_account_signup "https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/signup/Signup.js"
click node_site_footer "https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/Footer.js"
click node_dashboard_entry "https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/index.js"
click node_dashboard_home "https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/Home.js"
click node_watchlist "https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/WatchList.js"
click node_stock_data "https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/data/data.js"
click node_buy_context "https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/GeneralContext.js"
click node_buy_window "https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/BuyActionWindow.js"
click node_holdings_view "https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/Holdings.js"
click node_positions_view "https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/Positions.js"
click node_orders_view "https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/Orders.js"
click node_funds_view "https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/Funds.js"
click node_portfolio_summary "https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/Summary.js"
click node_api_service "https://github.com/yashinrush/stock-trading-platform/blob/main/backend/index.js"
click node_holdings_model "https://github.com/yashinrush/stock-trading-platform/blob/main/backend/model/HoldingsModel.js"
click node_positions_model "https://github.com/yashinrush/stock-trading-platform/blob/main/backend/model/PositionsModel.js"
click node_orders_model "https://github.com/yashinrush/stock-trading-platform/blob/main/backend/model/OrdersModel.js"

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_public_entry,node_public_nav,node_home_info,node_about_info,node_products_info,node_pricing_info,node_support_info,node_ticket_topics,node_account_signup,node_site_footer toneBlue
class node_dashboard_entry,node_dashboard_home,node_watchlist,node_stock_data,node_buy_context,node_buy_window,node_holdings_view,node_positions_view,node_orders_view,node_funds_view,node_portfolio_summary toneAmber
class node_api_service toneMint
class node_holdings_model,node_positions_model,node_orders_model,node_mongo_store toneRose
class node_visitor,node_trader toneIndigo
```

## Components

### Public Site

- [Site Router](https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/index.js): `frontend/src/index.js`
- [Site Navigation](https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/Navbar.js): `frontend/src/landing_page/Navbar.js`
- [Home Overview](https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/home/HomePage.js): `frontend/src/landing_page/home/HomePage.js`
- [Company Profile](https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/about/AboutPage.js): `frontend/src/landing_page/about/AboutPage.js`
- [Product Catalog](https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/products/ProductsPage.js): `frontend/src/landing_page/products/ProductsPage.js`
- [Pricing Details](https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/pricing/PricingPage.js): `frontend/src/landing_page/pricing/PricingPage.js`
- [Support Topics](https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/support/SupportPage.js): `frontend/src/landing_page/support/SupportPage.js`
- [Ticket Topics](https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/support/CreateTicket.js): `frontend/src/landing_page/support/CreateTicket.js`
- [Signup Screen](https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/signup/Signup.js): `frontend/src/landing_page/signup/Signup.js`
- [Site Footer](https://github.com/yashinrush/stock-trading-platform/blob/main/frontend/src/landing_page/Footer.js): `frontend/src/landing_page/Footer.js`

### Trading Dashboard

- [Dashboard Router](https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/index.js): `dashboard/src/index.js`
- [Dashboard Shell](https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/Home.js): `dashboard/src/components/Home.js`
- [Watchlist](https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/WatchList.js): `dashboard/src/components/WatchList.js`
- [Sample Market Data](https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/data/data.js): `dashboard/src/data/data.js`
- [Buy Window Context](https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/GeneralContext.js): `dashboard/src/components/GeneralContext.js`
- [Buy Order Window](https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/BuyActionWindow.js): `dashboard/src/components/BuyActionWindow.js`
- [Holdings View](https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/Holdings.js): `dashboard/src/components/Holdings.js`
- [Positions View](https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/Positions.js): `dashboard/src/components/Positions.js`
- [Orders View](https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/Orders.js): `dashboard/src/components/Orders.js`
- [Funds View](https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/Funds.js): `dashboard/src/components/Funds.js`
- [Portfolio Summary](https://github.com/yashinrush/stock-trading-platform/blob/main/dashboard/src/components/Summary.js): `dashboard/src/components/Summary.js`

### Trading API

- [Express API](https://github.com/yashinrush/stock-trading-platform/blob/main/backend/index.js): `backend/index.js`

### Persistence

- [Holdings Model](https://github.com/yashinrush/stock-trading-platform/blob/main/backend/model/HoldingsModel.js): `backend/model/HoldingsModel.js`
- [Positions Model](https://github.com/yashinrush/stock-trading-platform/blob/main/backend/model/PositionsModel.js): `backend/model/PositionsModel.js`
- [Orders Model](https://github.com/yashinrush/stock-trading-platform/blob/main/backend/model/OrdersModel.js): `backend/model/OrdersModel.js`
- **MongoDB**

### Other components

- **Visitor**
- **Trader**

## Connections

- Visitor → Site Router: opens site (evidence: `frontend/src/index.js`)
- Site Router → Site Navigation: renders (evidence: `frontend/src/index.js`)
- Site Router → Home Overview: routes to (evidence: `frontend/src/index.js`)
- Site Router → Signup Screen: routes to (evidence: `frontend/src/index.js`)
- Site Router → Company Profile: routes to (evidence: `frontend/src/index.js`)
- Site Router → Product Catalog: routes to (evidence: `frontend/src/index.js`)
- Site Router → Pricing Details: routes to (evidence: `frontend/src/index.js`)
- Site Router → Support Topics: routes to (evidence: `frontend/src/index.js`)
- Site Router → Site Footer: renders (evidence: `frontend/src/index.js`)
- Support Topics → Ticket Topics: renders (evidence: `frontend/src/landing_page/support/SupportPage.js`)
- Trader → Dashboard Router: opens dashboard (evidence: `dashboard/src/index.js`)
- Dashboard Router → Dashboard Shell: routes to (evidence: `dashboard/src/index.js`)
- Dashboard Shell → Watchlist: renders (evidence: `dashboard/src/components/Home.js`)
- Dashboard Shell → Holdings View: renders
- Dashboard Shell → Positions View: renders
- Dashboard Shell → Orders View: renders
- Dashboard Shell → Funds View: renders
- Dashboard Shell → Portfolio Summary: renders
- Watchlist → Sample Market Data: reads (evidence: `dashboard/src/components/WatchList.js`)
- Watchlist → Buy Window Context: opens buy window (evidence: `dashboard/src/components/WatchList.js`)
- Buy Window Context → Buy Order Window: renders (evidence: `dashboard/src/components/GeneralContext.js`)
- Holdings View → Sample Market Data: reads (evidence: `dashboard/src/components/Holdings.js`)
- Express API → Holdings Model: queries (evidence: `backend/index.js`)
- Express API → Positions Model: queries (evidence: `backend/index.js`)
- Express API → Orders Model: saves order (evidence: `backend/index.js`)
- Holdings Model → MongoDB: persists
- Positions Model → MongoDB: persists
- Orders Model → MongoDB: persists
- Holdings Model → MongoDB: defines schema
- Positions Model → MongoDB: defines schema
- Orders Model → MongoDB: defines schema
