Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
takeonepilot committed Feb 2, 2024
0 parents commit ed6f9a0
Show file tree
Hide file tree
Showing 32 changed files with 218,086 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
__pycache__
*.pyc
*.pyo
*.pyd
.Python
env
venv
pip-log.txt
pip-delete-this-directory.txt
.tox
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.log
.git
.mypy_cache
.pytest_cache
.hypothesis
3 changes: 3 additions & 0 deletions .envExemple
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
OPENAI_API_KEY='Your Open AI API key here'
username_td='Your username for Trading view here'
password_td='Your password for Trading view here'
114 changes: 114 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
### User defined ###

# Access credentials
credentials.py



# Log files
*.log
*.out

# Csv files
# *.csv

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__
components/__pycache__/
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
plots/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule.*

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.11


WORKDIR /app
COPY . ./

RUN pip install -r requirements.txt

EXPOSE 8080

CMD python index.py
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Felipe Roratto Muner

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
71 changes: 71 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# SmartInvest AI

## Visão Geral

O SmartInvest AI é um painel de análise de investimentos para o mercado de ações, projetado para ajudar investidores a monitorar e analisar o desempenho dos ativos em suas carteiras em tempo real. Com funcionalidades que incluem o registro de transações, visualizações gráficas detalhadas e a comparação com o índice IBOV, o SmartInvest AI auxilia na tomada de decisões de investimento mais informadas. A integração com a API do ChatGPT oferece um consultor financeiro inteligente, proporcionando análises aprofundadas e recomendações personalizadas.

## Estrutura do Código

O aplicativo é composto por diversos componentes principais, organizados da seguinte forma:

- `app.py`: Inicializa o aplicativo, configura estilos, gerencia exceções de callback e define configurações do servidor.
- `index.py`: Responsável por rodar o aplicativo e gerenciar as rotas ou páginas do aplicativo.
- `utils/functions.py`: Funções utilitárias para manipulação de dados e interação com a API do TradingView.
- `components/`: Diretório contendo os componentes do Dash, como a carteira (`wallet.py`), modal de cadastro de ativos (`modal.py`), página inicial (`home.py`), cabeçalho (`header.py`), integração ChatGPT (`chatgpt.py`), e outros.
- `tvdatafeed/`: Módulos para interação com a API do TradingView, incluindo `consumer.py`, `datafeed.py`, `main.py` e `seis.py`.

## Funcionalidades

- Monitoramento em tempo real dos ativos
- Registro e acompanhamento de transações de compra e venda
- Visualizações gráficas para análise dos ativos
- Comparação do desempenho da carteira com o IBOV
- Consultoria financeira através da integração com o ChatGPT

## Instalação

Clone o repositório para obter a última versão do SmartInvest AI:

```
git clone https://github.com/takeonepilot/Smart_Invest_AI.git
```

## Docker

Instalção via Docker, execute os seguintes comandos:

```
docker build -t smart_invest_ai .
```

```
docker run -d --name mart_invest_ai -p 8080:8080 smart_invest_ai
```

## Local

Instale as dependências necessárias para executar o aplicativo:

```
pip install -r requirements.txt
```

## Execução

Para iniciar o aplicativo, execute:

```
python index.py
```

## Contribuição

Contribuições são sempre bem-vindas! Se você tem alguma sugestão para melhorar o aplicativo, sinta-se à vontade para criar uma issue ou enviar um pull request.

## Contato

Para dúvidas, sugestões ou contribuições, sinta-se à vontade para abrir uma [Issue](https://github.com/takeonepilot/Smart_Invest_AI/issues) aqui no GitHub ou me seguir e entrar em contato através do [meu perfil no GitHub](https://github.com/takeonepilot).

## Licença

SmartInvest AI é distribuído sob a licença MIT.
10 changes: 10 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import dash
import dash_bootstrap_components as dbc

estilos = ["https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css", "https://fonts.googleapis.com/icon?family=Material+Icons"]

app = dash.Dash(external_stylesheets= estilos + [dbc.themes.BOOTSTRAP])

app.config['suppress_callback_exceptions'] = True
app.scripts.config.serve_locally = True
server = app.server
Binary file added assets/logo_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 67 additions & 0 deletions assets/menu_styles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
COR_LEGENDA = 'rgba(255,255,255,0.4)'

#menu radar graph
INDICADORES = 'rgba(255,255,255,0.4)'
BACKGROUND_RADAR = 'rgba(178, 45, 178, 1)'
LINHA_X = 'white'
LINHA_Y = 'white'
LINHAS_CIRCULARES = '#0d0834'
LINHA_CIRCULAR_EXTERNA = '#0d0834'
LINHAS_PREENCHIMENTO_1 = 'white'
LINHAS_PREENCHIMENTO_2 = '#0d0834'
CAIXA_LEGENDA = 'rgba(255,255,255,0.1)'
AXIS_X_VALUES_COLOR = 'rgba(0,0,0,0)'
TAMANHO_INDICADORES = 15
TAMANHO_RADAR = 190

#menu line graph
AXIS_FONT_SIZE = 20
AXIS_VALUES_COLOR = 'white'
LINHAS_DE_GRADE = 'rgba(255,255,255,0.1)'
LINHA_ZERO_X = 'rgba(255,255,255,0.2)'
LINHA_EVOLUCAO_PATRIMONIAL = 'rgba(178, 45, 178, 1)'
LISTA_DE_CORES_LINHAS = ['rgba(178, 45, 178, 1)', 'rgba(76,0,176,0.4)', 'rgba(138,0,176,0.4)', 'rgba(103,0,103,0.4)', 'rgba(87,53,106,0.4)', 'rgba(177,0,205,0.4)', 'rgba(190,46,214,0.4)', 'white']
HOVER_LINE_GRAPH = {
"bgcolor":"rgba(32, 36, 73, 0.7)",
"font" : {'color':COR_LEGENDA}
}
#PREENCHIMENTO_LINE_GRAPH = 'rgba(178, 45, 178, 0.1)'

#cards fixed_row
CARD_GRAPHS_LINE_COLOR = 'rgba(178, 45, 178, 0.5)'

#radar graph
MAIN_CONFIG = {
"hovermode": "x unified",
"legend": {"yanchor":"top",
"y":1.0,
"xanchor":"left",
"x":1.0,
"title": {"text": None},
"bgcolor": CAIXA_LEGENDA},
"font" : {'color': COR_LEGENDA},
"margin": {"l":0, "r":0, "t":10, "b":0},
}

#line graph
MAIN_CONFIG_2 = {
"hovermode": "x unified",
"legend": {"yanchor":"top",
"y":0.25,
"xanchor":"left",
"x":0.05,
"bgcolor": CAIXA_LEGENDA},
"font" : {'color': COR_LEGENDA},
"margin": {"l":0, "r":0, "t":10, "b":0},
}

#cards graph
MAIN_CONFIG_3 = {
# "hovermode": "x unified",
"legend": {"bgcolor": 'rgba(0,0,0,0)'},
"font" : None,
"margin": {"l":0, "r":0, "t":0, "b":0},
}


HEIGHT={'height': '100%'}
Binary file added assets/nexa-extralight.ttf
Binary file not shown.
Binary file added assets/nexa-heavy.ttf
Binary file not shown.
Binary file added assets/nexa-regular.otf
Binary file not shown.
Loading

0 comments on commit ed6f9a0

Please sign in to comment.