# eternoseeker/stockguru architecture

> Architecture diagram of the GitHub repository eternoseeker/stockguru, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eternoseeker/stockguru
- Repository: https://github.com/eternoseeker/stockguru

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Frontend Layer (Streamlit Web Interface):
- Home page (Home.py)
- Feature pages (pages directory)
- FAQ
- Analysis
- Market
- Recommendation
- Guide
- User Management (Register/Login)
- Portfolio

b) Data Processing Layer:
- Stock Analysis Engine
- Recommendation Engine
- Market Data Processor

c) External Services:
- Alpha Vantage API (Financial Data)
- OpenAI API (Chatbot/Recommendations)
- MarketAux API (Market Data)

d) Data Storage:
- Local Data Storage (data directory)
- User Database (implied by login/register functionality)

**[User Interface Layer]**

- ▼
**[Application Layer]**

- ▼
**[Service Layer]**

- ▼
**[External Services]**

##### Specific Implementation Details

Frontend Layer:
**[Streamlit Web Interface]**
- Home Dashboard
- Analysis Module
- Market Intelligence
- Recommendation System
- User Portfolio
- Authentication

Processing Layer:
**[Data Processing]**
- Stock Analysis Engine
- Technical Indicators
- Recommendation Engine
- ML Models
- Market Data Processor
- News Aggregator

##### Key Technical Elements

- Streamlit as the web framework
- Python data science stack (Matplotlib, NumPy, Pandas)
- API integrations
- Authentication flow
- Data persistence

**[Technology Stack]**
- Streamlit
- Matplotlib
- NumPy
- Pandas
- SciPy
- Feedparser

##### The scalability of the architecture

Remember to maintain a balance between showing the high-level architecture while including enough detail to understand the system's core functionality of providing personalized stock recommendations and analysis.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef processing fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#f1c40f,stroke:#f39c12,color:black
    classDef storage fill:#9b59b6,stroke:#8e44ad,color:white
    classDef auth fill:#e74c3c,stroke:#c0392b,color:white

    %% User
    User((User))

    %% Frontend Layer
    subgraph Frontend
        UI[Streamlit Web Interface]
        Home[Home Dashboard]
        FAQ[FAQ Page]
        Analysis[Analysis Module]
        Market[Market Intelligence]
        Recommend[Recommendation System]
        Guide[User Guide]
        Register[Register]
        Login[Login]
        Portfolio[Portfolio Management]
    end

    %% Processing Layer
    subgraph Processing
        SAE[Stock Analysis Engine]
        RE[Recommendation Engine]
        MDP[Market Data Processor]
        TI[Technical Indicators]
        ML[ML Models]
        NA[News Aggregator]
    end

    %% External Services
    subgraph External
        AV[Alpha Vantage API]
        OAI[OpenAI API]
        MA[MarketAux API]
    end

    %% Data Storage
    subgraph Storage
        LocalData[Local Data Storage]
        UserDB[(User Database)]
        StockList[Stock Listings]
        Assets[Static Assets]
    end

    %% Relationships
    User --> UI
    UI --> Home
    UI --> FAQ
    UI --> Analysis
    UI --> Market
    UI --> Recommend
    UI --> Guide
    UI --> Register
    UI --> Login
    UI --> Portfolio

    Analysis --> SAE
    Market --> MDP
    Recommend --> RE

    SAE --> TI
    RE --> ML
    MDP --> NA

    SAE --> AV
    RE --> OAI
    MDP --> MA

    SAE --> LocalData
    RE --> LocalData
    MDP --> LocalData
    Register --> UserDB
    Login --> UserDB
    Portfolio --> UserDB
    Portfolio --> StockList

    %% Styling
    class UI,Home,FAQ,Analysis,Market,Recommend,Guide,Register,Login,Portfolio frontend
    class SAE,RE,MDP,TI,ML,NA processing
    class AV,OAI,MA external
    class LocalData,UserDB,StockList,Assets storage
    class Register,Login auth

    %% Click Events
    click Home "https://github.com/EternoSeeker/StockGuru/blob/main/Home.py"
    click FAQ "https://github.com/EternoSeeker/StockGuru/blob/main/pages/1_FAQ.py"
    click Analysis "https://github.com/EternoSeeker/StockGuru/blob/main/pages/2_Analysis.py"
    click Market "https://github.com/EternoSeeker/StockGuru/blob/main/pages/2_Market.py"
    click Recommend "https://github.com/EternoSeeker/StockGuru/blob/main/pages/3_Recommendation.py"
    click Guide "https://github.com/EternoSeeker/StockGuru/blob/main/pages/4_Guide.py"
    click Register "https://github.com/EternoSeeker/StockGuru/blob/main/pages/5_Register.py"
    click Login "https://github.com/EternoSeeker/StockGuru/blob/main/pages/6_Login.py"
    click Portfolio "https://github.com/EternoSeeker/StockGuru/blob/main/pages/7_Portfolio.py"
    click LocalData "https://github.com/EternoSeeker/StockGuru/tree/main/data"
    click StockList "https://github.com/EternoSeeker/StockGuru/blob/main/data/listing_status.csv"
    click Assets "https://github.com/EternoSeeker/StockGuru/tree/main/data/images"
```
