# lfvelosoh/investortracker-streamlit architecture

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

- Interactive diagram: https://gitdiagram.com/lfvelosoh/investortracker-streamlit
- Repository: https://github.com/lfvelosoh/investortracker-streamlit

## Overview

##### Project Type and Purpose
- From the file tree and README, it’s clear this is a single-repository, multi-page dashboard application written in Python (likely using a framework such as Streamlit or Dash).
- Main purpose: render different financial views (portfolio, trades, products, dividends, subscriptions), allow uploads and configuration.

##### File Structure
- Top-level files:
- Dashboard.py – the application entry point that routes between pages.
- requirements.txt – enumerates Python dependencies (e.g., Streamlit/Dash, pandas).
- readme.md – project description (empty here).
- pages/ – contains numbered modules for each screen:
1. Carteira.py
2. Negociacoes.py
…
7. Configuracoes.py
- utils/ – contains shared functions (utils/functions.py) used by all pages.

##### README for Additional Insights
- README placeholder indicates no extra details, so we infer architecture solely from code layout.

##### Main Components
a. User (browser or CLI)
b. Web UI layer (Streamlit/Dash framework)
c. Application entry point (Dashboard.py)
d. Page modules (pages/1_*.py … pages/7_*.py)
e. Utilities library (utils/functions.py)
f. Data sources:
- Local files (uploads via pages/6_Upload.py)
- External APIs or databases (if referenced in requirements.txt)
g. Environment: Python runtime with dependencies

##### Relationships & Data Flows
- User → Web UI (HTTP/websocket) → Dashboard.py
- Dashboard.py ↔ imports → pages/*.py
- pages/*.py ↔ calls → utils/functions.py
- pages/*.py ↔ reads/writes → Data sources (upload folder, CSVs, DB/API)
- Results propagate back: Data sources → utils → pages → Dashboard → User

##### Architectural Patterns & Design Principles
- Modular “multi-page” pattern: each screen is its own module.
- Single-process web app: no separate backend service—UI and business logic co-located.
- Utility layer abstracting data manipulation and external integrations.

##### Technologies & Frameworks
- Python 3.x
- Streamlit or Dash (based on Dashboard.py)
- pandas/numpy (data handling), requests or SQL client (external data)
- OS/filesystem (for uploads)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User
    User["User (Browser)"]:::user

    %% Environment
    subgraph "Python Environment"
        direction TB
        Env["Python Runtime & Dependencies"]:::env
        Dashboard["Dashboard.py"]:::code
        subgraph "Pages Directory"
            direction TB
            P1["1_Carteira.py"]:::code
            P2["2_Negociacoes.py"]:::code
            P3["3_Produtos.py"]:::code
            P4["4_Proventos.py"]:::code
            P5["5_Subscricoes.py"]:::code
            P6["6_Upload.py"]:::code
            P7["7_Configuracoes.py"]:::code
        end
        subgraph "Utils Directory"
            direction TB
            Utils["functions.py"]:::code
        end
    end

    %% Data Stores and External Services
    LocalFS["Local Storage (Uploads)"]:::data
    Database["Database"]:::data
    ExternalAPI["External Financial API"]:::ext

    %% Documentation and Config
    Requirements["requirements.txt"]:::docs
    Readme["readme.md"]:::docs

    %% Relationships
    User -->|"HTTP/WebSocket"| Dashboard
    Env --> Dashboard
    Dashboard -->|"routes to"| P1
    Dashboard -->|"routes to"| P2
    Dashboard -->|"routes to"| P3
    Dashboard -->|"routes to"| P4
    Dashboard -->|"routes to"| P5
    Dashboard -->|"routes to"| P6
    Dashboard -->|"routes to"| P7

    P1 -->|"calls"| Utils
    P2 -->|"calls"| Utils
    P3 -->|"calls"| Utils
    P4 -->|"calls"| Utils
    P5 -->|"calls"| Utils
    P6 -->|"calls"| Utils
    P7 -->|"calls"| Utils

    P6 -->|"reads/writes"| LocalFS
    P1 -->|"reads"| Database
    P2 -->|"reads/writes"| Database
    P3 -->|"calls"| ExternalAPI
    P4 -->|"calls"| ExternalAPI
    P5 -->|"calls"| ExternalAPI

    %% Docs relationships
    Env -.-> Requirements
    Env -.-> Readme

    %% Click Events
    click Dashboard "https://github.com/lfvelosoh/investortracker-streamlit/blob/master/Dashboard.py"
    click P1 "https://github.com/lfvelosoh/investortracker-streamlit/blob/master/pages/1_Carteira.py"
    click P2 "https://github.com/lfvelosoh/investortracker-streamlit/blob/master/pages/2_Negociacoes.py"
    click P3 "https://github.com/lfvelosoh/investortracker-streamlit/blob/master/pages/3_Produtos.py"
    click P4 "https://github.com/lfvelosoh/investortracker-streamlit/blob/master/pages/4_Proventos.py"
    click P5 "https://github.com/lfvelosoh/investortracker-streamlit/blob/master/pages/5_Subscricoes.py"
    click P6 "https://github.com/lfvelosoh/investortracker-streamlit/blob/master/pages/6_Upload.py"
    click P7 "https://github.com/lfvelosoh/investortracker-streamlit/blob/master/pages/7_Configuracoes.py"
    click Utils "https://github.com/lfvelosoh/investortracker-streamlit/blob/master/utils/functions.py"
    click Requirements "https://github.com/lfvelosoh/investortracker-streamlit/blob/master/requirements.txt"
    click Readme "https://github.com/lfvelosoh/investortracker-streamlit/blob/master/readme.md"
    click Pages_Directory "https://github.com/lfvelosoh/investortracker-streamlit/tree/master/pages/"
    click Utils_Directory "https://github.com/lfvelosoh/investortracker-streamlit/tree/master/utils/"

    %% Styles
    classDef user fill:#f9c,stroke:#333,stroke-width:1px,shape:ellipse
    classDef env fill:#ffeb99,stroke:#333,stroke-width:1px
    classDef code fill:#bbdefb,stroke:#0b5394,stroke-width:1px
    classDef data fill:#c8e6c9,stroke:#2e7d32,stroke-width:1px,shape:cylinder
    classDef ext fill:#ffe0b2,stroke:#e65100,stroke-width:1px,shape:cloud
    classDef docs fill:#eeeeee,stroke:#666,stroke-width:1px,shape:note
```
