# 0xzee/jev-stock-decision-maker architecture

> Architecture diagram of the GitHub repository 0xzee/jev-stock-decision-maker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/0xzee/jev-stock-decision-maker
- Repository: https://github.com/0xzee/jev-stock-decision-maker

## Overview

JEV is a Streamlit stock-decision demo: users view broad market context, enter a ticker for a fundamentals deep-dive, run a structured 20-question assessment, and ask follow-up questions grounded in the same state document. The sampled code supports separate market-context and ticker-snapshot fetches, state-document construction, and TypeSafe calls; unsampled portions of the data layer may add details not represented here.

Main entry points: [`app.py`](https://github.com/0xzee/jev-stock-decision-maker/blob/main/app.py) (Streamlit App), [`data_fetcher.py`](https://github.com/0xzee/jev-stock-decision-maker/blob/main/data_fetcher.py) (Market Context), [`call_jev.py`](https://github.com/0xzee/jev-stock-decision-maker/blob/main/call_jev.py) (20-Question Scoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_app["Streamlit App<br/>[app.py]"]
end

subgraph group_market["Market Data"]
  node_market_context["Market Context<br/>[data_fetcher.py]"]
  node_ticker_snapshot["Ticker Snapshot<br/>[data_fetcher.py]"]
  node_state_document["State Document<br/>[data_fetcher.py]"]
end

subgraph group_analysis["Decision Analysis"]
  node_decision_model["20-Question Scoring<br/>[call_jev.py]"]
  node_quick_answer["Quick Q&amp;A<br/>[call_jev.py]"]
end

node_user(("Investor"))
node_typesafe{{"TypeSafe Jev API"}}
node_yfinance{{"Yahoo Finance"}}

node_user -->|"enters ticker / asks"| node_app
node_app -->|"requests context"| node_market_context
node_market_context -->|"fetches market data"| node_yfinance
node_market_context -->|"returns table"| node_app
node_app -->|"requests snapshot"| node_ticker_snapshot
node_ticker_snapshot -->|"fetches ticker data"| node_yfinance
node_ticker_snapshot -->|"returns fundamentals"| node_app
node_app -->|"builds state"| node_state_document
node_state_document -->|"returns document"| node_app
node_app -->|"requests scoring"| node_decision_model
node_decision_model -->|"submits questions"| node_typesafe
node_decision_model -->|"returns assessment"| node_app
node_app -->|"requests answer"| node_quick_answer
node_quick_answer -->|"submits question"| node_typesafe
node_quick_answer -->|"returns answer"| node_app
node_app -->|"displays results"| node_user

click node_app "https://github.com/0xzee/jev-stock-decision-maker/blob/main/app.py"
click node_market_context "https://github.com/0xzee/jev-stock-decision-maker/blob/main/data_fetcher.py"
click node_ticker_snapshot "https://github.com/0xzee/jev-stock-decision-maker/blob/main/data_fetcher.py"
click node_state_document "https://github.com/0xzee/jev-stock-decision-maker/blob/main/data_fetcher.py"
click node_decision_model "https://github.com/0xzee/jev-stock-decision-maker/blob/main/call_jev.py"
click node_quick_answer "https://github.com/0xzee/jev-stock-decision-maker/blob/main/call_jev.py"

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_app toneBlue
class node_market_context,node_ticker_snapshot,node_state_document toneAmber
class node_decision_model,node_quick_answer,node_typesafe toneMint
class node_user,node_yfinance toneIndigo
```

## Components

### User Interface

- [Streamlit App](https://github.com/0xzee/jev-stock-decision-maker/blob/main/app.py): `app.py`

### Market Data

- [Market Context](https://github.com/0xzee/jev-stock-decision-maker/blob/main/data_fetcher.py): `data_fetcher.py`
- [Ticker Snapshot](https://github.com/0xzee/jev-stock-decision-maker/blob/main/data_fetcher.py): `data_fetcher.py`
- [State Document](https://github.com/0xzee/jev-stock-decision-maker/blob/main/data_fetcher.py): `data_fetcher.py`

### Decision Analysis

- [20-Question Scoring](https://github.com/0xzee/jev-stock-decision-maker/blob/main/call_jev.py): `call_jev.py`
- [Quick Q&A](https://github.com/0xzee/jev-stock-decision-maker/blob/main/call_jev.py): `call_jev.py`

### Other components

- **Investor**
- **TypeSafe Jev API**
- **Yahoo Finance**

## Connections

- Investor → Streamlit App: enters ticker / asks
- Streamlit App → Market Context: requests context
- Market Context → Yahoo Finance: fetches market data
- Market Context → Streamlit App: returns table
- Streamlit App → Ticker Snapshot: requests snapshot
- Ticker Snapshot → Yahoo Finance: fetches ticker data
- Ticker Snapshot → Streamlit App: returns fundamentals
- Streamlit App → State Document: builds state
- State Document → Streamlit App: returns document
- Streamlit App → 20-Question Scoring: requests scoring
- 20-Question Scoring → TypeSafe Jev API: submits questions
- 20-Question Scoring → Streamlit App: returns assessment
- Streamlit App → Quick Q&A: requests answer
- Quick Q&A → TypeSafe Jev API: submits question
- Quick Q&A → Streamlit App: returns answer
- Streamlit App → Investor: displays results
