# sarbajitchatterjee/hackathon_team-6_jarvis architecture

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

- Interactive diagram: https://gitdiagram.com/sarbajitchatterjee/hackathon_team-6_jarvis
- Repository: https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis

## Overview

Jarvis is an AI-assisted investment-analysis system. Its documented workflow starts with portfolio ingestion and ticker-level requests, fetches financial and patent data in parallel, runs backtesting and Fama–French analysis, then produces portfolio decision support. The map also shows the Python services and database-driven orchestration visible in the supplied excerpts. The n8n workflow files and SQL trigger implementations are present in the tree but were not sampled, so their internal behavior is represented only where the README documents it.

Main entry points: [`database`](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/database) (PostgreSQL State), [`python_tickerConverter/app.py`](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/blob/main/python_tickerConverter/app.py) (Patent Data Service), [`n8n_workflows`](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/n8n_workflows) (Financial Ingestion), [`python_service/FFM_backtesting.py`](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/blob/main/python_service/FFM_backtesting.py) (FFM and Backtesting API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Portfolio Ingestion"]
  node_portfolio_ingest["Portfolio Ingestion"]
  node_ticker_dispatch["Ticker Request Fan-out<br/>[dispatcher.py]"]
end

subgraph group_data["Data Collection"]
  node_financial_fetch["Financial Data Service<br/>[app.py]"]
  node_financial_sources["Market Data Sources"]
  node_patent_fetch["Patent Data Service<br/>[app.py]"]
  node_yfinance["Yahoo Finance"]
  node_patentsview["PatentsView"]
  node_financial_workflows["Financial Ingestion"]
  node_patent_workflows["Patent Ingestion"]
end

subgraph group_analysis["Quantitative Analysis"]
  node_analysis_workflows["Analysis Workflows"]
  node_quant_service["FFM and Backtesting API<br/>[FFM_backtesting.py]"]
  node_ff_factors["Fama–French Factors"]
end

subgraph group_orchestration["Orchestration and State"]
  node_database[("PostgreSQL State")]
  node_db_triggers["Completion Triggers"]
end

subgraph group_decision["Decision Support"]
  node_portfolio_ai["Portfolio AI Synthesis"]
  node_investment_output["Investment Insights and Reports"]
end

node_manager(("Portfolio Manager"))

node_manager -->|"submits portfolio"| node_portfolio_ingest
node_portfolio_ingest -->|"fans out requests"| node_ticker_dispatch
node_ticker_dispatch -->|"creates requests"| node_database
node_database -->|"dispatches ingestion"| node_financial_workflows
node_database -->|"dispatches ingestion"| node_patent_workflows
node_financial_workflows -->|"requests financial data"| node_financial_fetch
node_financial_fetch -->|"fetches market data"| node_financial_sources
node_patent_workflows -->|"requests patent data"| node_patent_fetch
node_patent_fetch -->|"resolves company name"| node_yfinance
node_patent_fetch -->|"queries patent records"| node_patentsview
node_financial_workflows -->|"uploads price data"| node_quant_service
node_analysis_workflows -->|"triggers analyses"| node_quant_service
node_quant_service -.->|"retrieves factors"| node_ff_factors
node_analysis_workflows -->|"synthesizes results"| node_portfolio_ai
node_portfolio_ai -->|"generates insights"| node_investment_output
node_database -->|"tracks completion"| node_db_triggers
node_db_triggers -->|"advances workflow"| node_analysis_workflows
node_investment_output -->|"supports decisions"| node_manager

click node_portfolio_ingest "https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/n8n_workflows"
click node_ticker_dispatch "https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/blob/main/python_dispatcher/dispatcher.py"
click node_financial_fetch "https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/blob/main/python_service/app.py"
click node_patent_fetch "https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/blob/main/python_tickerConverter/app.py"
click node_financial_workflows "https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/n8n_workflows"
click node_patent_workflows "https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/n8n_workflows"
click node_analysis_workflows "https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/n8n_workflows"
click node_quant_service "https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/blob/main/python_service/FFM_backtesting.py"
click node_database "https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/database"
click node_db_triggers "https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/database"
click node_portfolio_ai "https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/n8n_workflows"
click node_investment_output "https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/n8n_workflows"

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_portfolio_ingest,node_ticker_dispatch toneBlue
class node_financial_fetch,node_financial_sources,node_patent_fetch,node_yfinance,node_patentsview,node_financial_workflows,node_patent_workflows toneAmber
class node_analysis_workflows,node_quant_service,node_ff_factors toneMint
class node_database,node_db_triggers toneRose
class node_portfolio_ai,node_investment_output,node_manager toneIndigo
```

## Components

### Portfolio Ingestion

- [Portfolio Ingestion](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/n8n_workflows): `n8n_workflows`
- [Ticker Request Fan-out](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/blob/main/python_dispatcher/dispatcher.py): `python_dispatcher/dispatcher.py`

### Data Collection

- [Financial Data Service](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/blob/main/python_service/app.py): `python_service/app.py`
- **Market Data Sources**
- [Patent Data Service](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/blob/main/python_tickerConverter/app.py): `python_tickerConverter/app.py`
- **Yahoo Finance**
- **PatentsView**
- [Financial Ingestion](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/n8n_workflows): `n8n_workflows`
- [Patent Ingestion](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/n8n_workflows): `n8n_workflows`

### Quantitative Analysis

- [Analysis Workflows](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/n8n_workflows): `n8n_workflows`
- [FFM and Backtesting API](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/blob/main/python_service/FFM_backtesting.py): `python_service/FFM_backtesting.py`
- **Fama–French Factors**

### Orchestration and State

- [PostgreSQL State](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/database): `database`
- [Completion Triggers](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/database): `database`

### Decision Support

- [Portfolio AI Synthesis](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/n8n_workflows): `n8n_workflows`
- [Investment Insights and Reports](https://github.com/sarbajitchatterjee/hackathon_team-6_jarvis/tree/main/n8n_workflows): `n8n_workflows`

### Other components

- **Portfolio Manager**

## Connections

- Portfolio Manager → Portfolio Ingestion: submits portfolio (evidence: `README.md`)
- Portfolio Ingestion → Ticker Request Fan-out: fans out requests (evidence: `README.md`)
- Ticker Request Fan-out → PostgreSQL State: creates requests (evidence: `python_dispatcher/dispatcher.py`)
- PostgreSQL State → Financial Ingestion: dispatches ingestion (evidence: `README.md`)
- PostgreSQL State → Patent Ingestion: dispatches ingestion (evidence: `README.md`)
- Financial Ingestion → Financial Data Service: requests financial data (evidence: `README.md`)
- Financial Data Service → Market Data Sources: fetches market data (evidence: `python_service/app.py`)
- Patent Ingestion → Patent Data Service: requests patent data (evidence: `README.md`)
- Patent Data Service → Yahoo Finance: resolves company name (evidence: `python_tickerConverter/app.py`)
- Patent Data Service → PatentsView: queries patent records (evidence: `python_tickerConverter/app.py`)
- Financial Ingestion → FFM and Backtesting API: uploads price data (evidence: `README.md`)
- Analysis Workflows → FFM and Backtesting API: triggers analyses (evidence: `README.md`)
- FFM and Backtesting API → Fama–French Factors: retrieves factors
- Analysis Workflows → Portfolio AI Synthesis: synthesizes results (evidence: `README.md`)
- Portfolio AI Synthesis → Investment Insights and Reports: generates insights (evidence: `README.md`)
- PostgreSQL State → Completion Triggers: tracks completion (evidence: `README.md`)
- Completion Triggers → Analysis Workflows: advances workflow (evidence: `README.md`)
- Investment Insights and Reports → Portfolio Manager: supports decisions (evidence: `README.md`)
