# eugene234466/marketsync architecture

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

- Interactive diagram: https://gitdiagram.com/eugene234466/marketsync
- Repository: https://github.com/eugene234466/marketsync

## Overview

MarketSync is a financial-market dashboard for searching quotes, reviewing market information, and managing user portfolios and alerts, with documented news and AI insights. The README identifies Flask as the product stack; the tree also contains a substantial Express/TypeScript server and database implementation, so both runtime branches are represented without assuming they share a workflow. Flask source excerpts show quote lookup and portfolio handling; feature links documented only by the README are cited there. Some route and template details are unsampled.

Main entry points: [`app.py`](https://github.com/eugene234466/marketsync/blob/main/app.py) (Flask routes), [`yahoo_service.py`](https://github.com/eugene234466/marketsync/blob/main/yahoo_service.py) (Quote service), [`db.ts`](https://github.com/eugene234466/marketsync/blob/main/db.ts) (TypeScript data service), [`static/js/main.js`](https://github.com/eugene234466/marketsync/blob/main/static/js/main.js) (Browser interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flask["Flask application"]
  node_flask_app["Flask routes<br/>[app.py]"]
  node_templates["Jinja views"]
  node_client["Browser interface<br/>[main.js]"]
end

subgraph group_market["Market intelligence"]
  node_dashboard["Market dashboard<br/>[app.py]"]
  node_search["Quote search<br/>[app.py]"]
  node_quotes["Quote service<br/>[yahoo_service.py]"]
  node_news["Market news<br/>[app.py]"]
  node_insights["AI insights<br/>[app.py]"]
end

subgraph group_userdata["User data"]
  node_portfolio["Portfolio management<br/>[app.py]"]
  node_alerts["Price alerts<br/>[app.py]"]
  node_auth["Authentication<br/>[app.py]"]
  node_models[("SQL data models<br/>[models.py]")]
end

subgraph group_typescript["TypeScript runtime"]
  node_express_app["Express server<br/>[server.ts]"]
  node_ts_db[("TypeScript data service<br/>[db.ts]")]
end

node_visitor(("Market user"))
node_yahoo["Yahoo Finance"]
node_groq["Groq AI"]
node_postgres[("PostgreSQL")]

node_visitor -->|"requests"| node_flask_app
node_flask_app -->|"serves"| node_dashboard
node_flask_app -->|"handles"| node_search
node_flask_app -->|"handles"| node_portfolio
node_flask_app -->|"handles"| node_alerts
node_flask_app -->|"handles"| node_auth
node_flask_app -->|"provides"| node_news
node_flask_app -->|"provides"| node_insights
node_flask_app -->|"calls"| node_quotes
node_quotes -->|"fetches quotes"| node_yahoo
node_flask_app -->|"uses"| node_models
node_flask_app -->|"renders"| node_templates
node_client -.->|"submits requests"| node_flask_app
node_express_app -->|"uses"| node_ts_db
node_ts_db -->|"queries"| node_postgres
node_insights -->|"analyzes with"| node_groq

click node_flask_app "https://github.com/eugene234466/marketsync/blob/main/app.py"
click node_dashboard "https://github.com/eugene234466/marketsync/blob/main/app.py"
click node_search "https://github.com/eugene234466/marketsync/blob/main/app.py"
click node_quotes "https://github.com/eugene234466/marketsync/blob/main/yahoo_service.py"
click node_news "https://github.com/eugene234466/marketsync/blob/main/app.py"
click node_insights "https://github.com/eugene234466/marketsync/blob/main/app.py"
click node_portfolio "https://github.com/eugene234466/marketsync/blob/main/app.py"
click node_alerts "https://github.com/eugene234466/marketsync/blob/main/app.py"
click node_auth "https://github.com/eugene234466/marketsync/blob/main/app.py"
click node_models "https://github.com/eugene234466/marketsync/blob/main/models.py"
click node_templates "https://github.com/eugene234466/marketsync/tree/main/templates"
click node_client "https://github.com/eugene234466/marketsync/blob/main/static/js/main.js"
click node_express_app "https://github.com/eugene234466/marketsync/blob/main/server.ts"
click node_ts_db "https://github.com/eugene234466/marketsync/blob/main/db.ts"

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_flask_app,node_templates,node_client,node_visitor toneBlue
class node_dashboard,node_search,node_quotes,node_news,node_insights,node_postgres toneAmber
class node_portfolio,node_alerts,node_auth,node_models toneMint
class node_express_app,node_ts_db toneRose
class node_yahoo,node_groq toneIndigo
```

## Components

### Flask application

- [Flask routes](https://github.com/eugene234466/marketsync/blob/main/app.py): `app.py`
- [Jinja views](https://github.com/eugene234466/marketsync/tree/main/templates): `templates`
- [Browser interface](https://github.com/eugene234466/marketsync/blob/main/static/js/main.js): `static/js/main.js`

### Market intelligence

- [Market dashboard](https://github.com/eugene234466/marketsync/blob/main/app.py): `app.py`
- [Quote search](https://github.com/eugene234466/marketsync/blob/main/app.py): `app.py`
- [Quote service](https://github.com/eugene234466/marketsync/blob/main/yahoo_service.py): `yahoo_service.py`
- [Market news](https://github.com/eugene234466/marketsync/blob/main/app.py): `app.py`
- [AI insights](https://github.com/eugene234466/marketsync/blob/main/app.py): `app.py`

### User data

- [Portfolio management](https://github.com/eugene234466/marketsync/blob/main/app.py): `app.py`
- [Price alerts](https://github.com/eugene234466/marketsync/blob/main/app.py): `app.py`
- [Authentication](https://github.com/eugene234466/marketsync/blob/main/app.py): `app.py`
- [SQL data models](https://github.com/eugene234466/marketsync/blob/main/models.py): `models.py`

### TypeScript runtime

- [Express server](https://github.com/eugene234466/marketsync/blob/main/server.ts): `server.ts`
- [TypeScript data service](https://github.com/eugene234466/marketsync/blob/main/db.ts): `db.ts`

### Other components

- **Market user**
- **Yahoo Finance**
- **Groq AI**
- **PostgreSQL**

## Connections

- Market user → Flask routes: requests (evidence: `README.md`)
- Flask routes → Market dashboard: serves (evidence: `app.py`)
- Flask routes → Quote search: handles (evidence: `README.md`)
- Flask routes → Portfolio management: handles (evidence: `app.py`)
- Flask routes → Price alerts: handles (evidence: `README.md`)
- Flask routes → Authentication: handles (evidence: `README.md`)
- Flask routes → Market news: provides (evidence: `README.md`)
- Flask routes → AI insights: provides (evidence: `README.md`)
- Flask routes → Quote service: calls (evidence: `app.py`)
- Quote service → Yahoo Finance: fetches quotes (evidence: `README.md`)
- Flask routes → SQL data models: uses (evidence: `app.py`)
- Flask routes → Jinja views: renders (evidence: `README.md`)
- Browser interface → Flask routes: submits requests
- Express server → TypeScript data service: uses (evidence: `server.ts`)
- TypeScript data service → PostgreSQL: queries (evidence: `db.ts`)
- AI insights → Groq AI: analyzes with (evidence: `README.md`)
