notion-workspace-app 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. notion_workspace_app-0.3.0/.gitignore +14 -0
  2. notion_workspace_app-0.3.0/LICENSE +21 -0
  3. notion_workspace_app-0.3.0/PKG-INFO +268 -0
  4. notion_workspace_app-0.3.0/README.md +222 -0
  5. notion_workspace_app-0.3.0/front/README.md +52 -0
  6. notion_workspace_app-0.3.0/pyproject.toml +70 -0
  7. notion_workspace_app-0.3.0/server/__init__.py +1 -0
  8. notion_workspace_app-0.3.0/server/api/__init__.py +0 -0
  9. notion_workspace_app-0.3.0/server/api/apps.py +10 -0
  10. notion_workspace_app-0.3.0/server/api/serializers.py +26 -0
  11. notion_workspace_app-0.3.0/server/api/urls.py +22 -0
  12. notion_workspace_app-0.3.0/server/api/views.py +285 -0
  13. notion_workspace_app-0.3.0/server/config/__init__.py +6 -0
  14. notion_workspace_app-0.3.0/server/config/asgi.py +17 -0
  15. notion_workspace_app-0.3.0/server/config/settings.py +74 -0
  16. notion_workspace_app-0.3.0/server/config/urls.py +32 -0
  17. notion_workspace_app-0.3.0/server/config/wsgi.py +17 -0
  18. notion_workspace_app-0.3.0/server/core/__init__.py +12 -0
  19. notion_workspace_app-0.3.0/server/core/config.py +128 -0
  20. notion_workspace_app-0.3.0/server/integrations/__init__.py +6 -0
  21. notion_workspace_app-0.3.0/server/integrations/github.py +21 -0
  22. notion_workspace_app-0.3.0/server/integrations/notion.py +47 -0
  23. notion_workspace_app-0.3.0/server/integrations/openrouter.py +31 -0
  24. notion_workspace_app-0.3.0/server/manage.py +30 -0
  25. notion_workspace_app-0.3.0/server/mcp_server.py +864 -0
  26. notion_workspace_app-0.3.0/server/operations/__init__.py +0 -0
  27. notion_workspace_app-0.3.0/server/operations/apps.py +10 -0
  28. notion_workspace_app-0.3.0/server/operations/migrations/0001_initial.py +40 -0
  29. notion_workspace_app-0.3.0/server/operations/migrations/__init__.py +0 -0
  30. notion_workspace_app-0.3.0/server/operations/models.py +49 -0
  31. notion_workspace_app-0.3.0/server/services/__init__.py +9 -0
  32. notion_workspace_app-0.3.0/server/services/clonagem.py +21 -0
  33. notion_workspace_app-0.3.0/server/services/conteudo.py +21 -0
  34. notion_workspace_app-0.3.0/server/services/exploracao.py +21 -0
  35. notion_workspace_app-0.3.0/server/services/ia.py +21 -0
  36. notion_workspace_app-0.3.0/server/services/ingestao.py +21 -0
  37. notion_workspace_app-0.3.0/server/services/inventario_github.py +21 -0
  38. notion_workspace_app-0.3.0/server/services/normalizacao.py +21 -0
  39. notion_workspace_app-0.3.0/server/services/projetos.py +21 -0
  40. notion_workspace_app-0.3.0/server/services/sincronizar_github.py +21 -0
  41. notion_workspace_app-0.3.0/server/services/tarefas.py +21 -0
  42. notion_workspace_app-0.3.0/server/static/css/app.css +416 -0
  43. notion_workspace_app-0.3.0/server/static/frontend/assets/index-BOknsUR7.css +2 -0
  44. notion_workspace_app-0.3.0/server/static/frontend/assets/index-sNKiokOM.js +16 -0
  45. notion_workspace_app-0.3.0/server/static/frontend/favicon.svg +1 -0
  46. notion_workspace_app-0.3.0/server/static/frontend/index.html +13 -0
  47. notion_workspace_app-0.3.0/server/static/js/app.js +334 -0
  48. notion_workspace_app-0.3.0/server/templates/tarefas.html +128 -0
  49. notion_workspace_app-0.3.0/start_app.py +1710 -0
@@ -0,0 +1,14 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .env
4
+ .venv/
5
+ venv/
6
+ .pytest_cache/
7
+ .ruff_cache/
8
+ *.sqlite3
9
+ dist/
10
+ build/
11
+ *.egg-info/
12
+ node_modules/
13
+ staticfiles/
14
+ server/static/frontend/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Felipe Alcantara
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,268 @@
1
+ Metadata-Version: 2.5
2
+ Name: notion-workspace-app
3
+ Version: 0.3.0
4
+ Summary: Aplicação local para operar o Notion: API Django, SPA React, servidor MCP e launcher TUI (start_app.py).
5
+ Project-URL: Homepage, https://github.com/Felipe-Alcantara/notion-workspace-app
6
+ Project-URL: Repository, https://github.com/Felipe-Alcantara/notion-workspace-app
7
+ Author: Felipe Alcantara
8
+ License: MIT License
9
+
10
+ Copyright (c) 2026 Felipe Alcantara
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ License-File: LICENSE
30
+ Requires-Python: >=3.10
31
+ Requires-Dist: django>=5.0
32
+ Requires-Dist: mcp<2,>=1.28
33
+ Requires-Dist: notion-starter<0.4.0,>=0.3.0
34
+ Requires-Dist: questionary>=2.0
35
+ Requires-Dist: requests>=2.25
36
+ Requires-Dist: rich>=13.0
37
+ Provides-Extra: dev
38
+ Requires-Dist: pytest>=7.0; extra == 'dev'
39
+ Requires-Dist: responses>=0.23; extra == 'dev'
40
+ Requires-Dist: ruff>=0.4; extra == 'dev'
41
+ Provides-Extra: mcp
42
+ Requires-Dist: mcp<2,>=1.28; extra == 'mcp'
43
+ Provides-Extra: server
44
+ Requires-Dist: django>=5.0; extra == 'server'
45
+ Description-Content-Type: text/markdown
46
+
47
+ # 🧭 notion-workspace-app
48
+
49
+ <div align="center">
50
+
51
+ ![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-3776AB?style=for-the-badge&logo=python&logoColor=white)
52
+ ![Django 5+](https://img.shields.io/badge/Django-5%2B-092E20?style=for-the-badge&logo=django&logoColor=white)
53
+ ![React 18](https://img.shields.io/badge/React-18-61DAFB?style=for-the-badge&logo=react&logoColor=black)
54
+ ![Vite 8](https://img.shields.io/badge/Vite-8-646CFF?style=for-the-badge&logo=vite&logoColor=white)
55
+ ![Licença MIT](https://img.shields.io/badge/Licen%C3%A7a-MIT-green?style=for-the-badge)
56
+
57
+ **Aplicação local completa para operar o Notion com API Django, SPA React, servidor MCP e launcher TUI.**
58
+
59
+ [📖 Sobre](#-sobre-o-projeto) • [🚀 Componentes](#-componentes) • [🎯 Como usar](#-como-usar) • [✅ Qualidade](#-qualidade)
60
+
61
+ </div>
62
+
63
+ ---
64
+
65
+ ## 📋 Índice
66
+
67
+ - [📖 Sobre o Projeto](#-sobre-o-projeto)
68
+ - [📁 Estrutura do Projeto](#-estrutura-do-projeto)
69
+ - [🚀 Componentes](#-componentes)
70
+ - [✨ Funcionalidades](#-funcionalidades)
71
+ - [🎯 Como Usar](#-como-usar)
72
+ - [🔐 Configuração e Segurança](#-configuração-e-segurança)
73
+ - [✅ Qualidade](#-qualidade)
74
+ - [📄 Licença](#-licença)
75
+ - [👤 Autor](#-autor)
76
+ - [🤝 Contribuições](#-contribuições)
77
+
78
+ ---
79
+
80
+ ## 📖 Sobre o Projeto
81
+
82
+ O `notion-workspace-app` reúne quatro interfaces sobre o mesmo núcleo de dados:
83
+ uma **API REST Django**, uma **SPA React**, um **servidor MCP** para clientes de IA
84
+ e um **launcher TUI** que prepara e inicia o ambiente. A aplicação permite
85
+ gerenciar tarefas em kanban, grade ou lista, explorar o workspace e sincronizar
86
+ repositórios do GitHub com databases do Notion.
87
+
88
+ A regra de negócio compartilhada vem da biblioteca
89
+ [notion-starter](https://github.com/Felipe-Alcantara/notion-starter). Este
90
+ repositório mantém as bordas Django, React e MCP, além da configuração específica
91
+ do produto. A porta de entrada recomendada é `python start_app.py`.
92
+
93
+ O projeto integra o ecossistema
94
+ [Automações do Notion](https://github.com/Felipe-Alcantara/Automa-es-do-Notion).
95
+
96
+ ---
97
+
98
+ ## 📁 Estrutura do Projeto
99
+
100
+ ```text
101
+ notion-workspace-app/
102
+ │
103
+ ├── 📁 server/ # Backend Django e servidor MCP
104
+ │ ├── 📁 api/ # Views, serializers e rotas REST
105
+ │ ├── 📁 config/ # Configuração do projeto Django
106
+ │ ├── 📁 integrations/ # Notion local e shims de adaptadores
107
+ │ ├── 📁 operations/ # Estado operacional em SQLite
108
+ │ ├── 📁 services/ # Shims dos casos de uso compartilhados
109
+ │ └── mcp_server.py # Ferramentas notion.*
110
+ │
111
+ ├── 📁 front/ # SPA React com Vite
112
+ │ ├── 📁 src/components/ # Interface, tarefas e exploração
113
+ │ ├── 📁 src/hooks/ # Estado e acesso à API
114
+ │ └── package-lock.json # Resolução reproduzível do frontend
115
+ │
116
+ ├── 📁 tests/ # Suíte Python automatizada
117
+ ├── .github/workflows/ci.yml # Gates Python e frontend
118
+ ├── start_app.py # Menu interativo de entrada
119
+ ├── requirements.txt # Dependências Python
120
+ ├── QUALIDADE.md # Contrato de qualidade do módulo
121
+ ├── README.md # Este arquivo
122
+ └── LICENSE # Licença MIT
123
+ ```
124
+
125
+ Na distribuição `0.3.0`, `front/` é usado apenas no desenvolvimento: o workflow
126
+ de release compila a SPA para `server/static/frontend/` e o wheel leva esse
127
+ bundle. Assim, a instalação de usuário não precisa de Node/npm.
128
+
129
+ ---
130
+
131
+ ## 🚀 Componentes
132
+
133
+ | Camada | Pasta | Descrição |
134
+ | --- | --- | --- |
135
+ | Launcher | `start_app.py` | TUI que instala dependências, configura e sobe servidor e front |
136
+ | API | `server/api/` | REST Django para tarefas, exploração e opções |
137
+ | Services | `server/services/` | Shims para tarefas, clonagem, ingestão, IA e GitHub |
138
+ | Integrações | `server/integrations/` | Notion local e shims para GitHub/OpenRouter |
139
+ | MCP | `server/mcp_server.py` | Servidor que expõe operações `notion.*` para IAs |
140
+ | Front | `front/` | SPA React com kanban, filtros e exploração do workspace |
141
+
142
+ ---
143
+
144
+ ## ✨ Funcionalidades
145
+
146
+ - visualizar tarefas em kanban, grade e lista;
147
+ - buscar e filtrar tarefas por status, duração e área;
148
+ - criar e editar tarefas pela interface;
149
+ - explorar páginas e databases compartilhados;
150
+ - sincronizar repositórios GitHub com databases do Notion;
151
+ - expor operações para clientes de IA via MCP;
152
+ - iniciar Django e Vite em conjunto pelo launcher interativo.
153
+
154
+ Exemplo de fluxo: ação na SPA → API Django → serviço compartilhado → API do
155
+ Notion.
156
+
157
+ ---
158
+
159
+ ## 🎯 Como Usar
160
+
161
+ ### Instalação distribuída
162
+
163
+ Para usar o ecossistema completo, instale a fachada única:
164
+
165
+ ```bash
166
+ pipx install "notion-automacoes[app]"
167
+ # ou: uv tool install "notion-automacoes[app]"
168
+ notion-automacoes doctor
169
+ notion-automacoes app start
170
+ notion-automacoes mcp start
171
+ ```
172
+
173
+ O release técnico candidato é `0.3.0`; a publicação no PyPI aguarda confirmação
174
+ de nome/ownership/metadados legais. Consulte o guia do hub para a sequência de
175
+ release e o smoke em Windows, macOS e Linux.
176
+
177
+ ### Início rápido
178
+
179
+ O fluxo abaixo é o de desenvolvimento pelo checkout:
180
+
181
+ ```bash
182
+ # Clone o repositório
183
+ git clone https://github.com/Felipe-Alcantara/notion-workspace-app.git
184
+ cd notion-workspace-app
185
+
186
+ # Instale as dependências Python de desenvolvimento
187
+ python -m pip install -e ".[dev]"
188
+
189
+ # Crie a configuração local e preencha os valores necessários
190
+ cp .env.example .env
191
+
192
+ # Abra o menu que instala, configura e inicia o produto
193
+ python start_app.py
194
+ ```
195
+
196
+ No checkout, o launcher aplica as migrações, sobe Django e Vite e abre o navegador. Pelo menu
197
+ também é possível instalar dependências, configurar o ambiente e conferir o
198
+ status dos componentes.
199
+
200
+ Quando executado a partir do wheel, o mesmo launcher sobe apenas o Django e
201
+ serve a SPA empacotada; Node/npm não são consultados.
202
+
203
+ ---
204
+
205
+ ## 🔐 Configuração e Segurança
206
+
207
+ Use `.env.example` como modelo e mantenha o `.env` apenas na máquina local. Para
208
+ operar o workspace, configure `NOTION_TOKEN` e, quando aplicável,
209
+ `NOTION_DATABASE_ID`.
210
+
211
+ Nunca versione tokens, IDs reais ou bancos SQLite. Os testes usam mocks e não
212
+ dependem de credenciais reais.
213
+
214
+ ---
215
+
216
+ ## ✅ Qualidade
217
+
218
+ Gate Python, executado na raiz:
219
+
220
+ ```bash
221
+ python -m ruff check .
222
+ python -m pytest
223
+ ```
224
+
225
+ Gate da SPA:
226
+
227
+ ```bash
228
+ cd front
229
+ npm run lint
230
+ npm run build
231
+ ```
232
+
233
+ A CI executa Python 3.10–3.13 e um job Node 22 com `npm ci`. Consulte
234
+ [`QUALIDADE.md`](QUALIDADE.md) para o critério de pronto e a política de
235
+ dependências.
236
+
237
+ ---
238
+
239
+ ## 📄 Licença
240
+
241
+ Este projeto está sob a licença MIT — veja [`LICENSE`](LICENSE).
242
+
243
+ ---
244
+
245
+ ## 👤 Autor
246
+
247
+ **Felipe Martin**
248
+
249
+ - GitHub: [@Felipe-Alcantara](https://github.com/Felipe-Alcantara)
250
+ - Repositório: [notion-workspace-app](https://github.com/Felipe-Alcantara/notion-workspace-app)
251
+
252
+ ---
253
+
254
+ ## 🤝 Contribuições
255
+
256
+ Contribuições são bem-vindas. Algumas ideias para quem quiser colaborar:
257
+
258
+ - ampliar a escrita genérica na aba Explorar;
259
+ - criar novas visualizações e interações no kanban;
260
+ - melhorar o empacotamento do launcher;
261
+ - expandir acessibilidade, testes e documentação.
262
+
263
+ Leia [`CONTRIBUTING.md`](CONTRIBUTING.md) antes de enviar uma mudança.
264
+
265
+ ---
266
+
267
+ ⭐ Se o app foi útil, considere dar uma estrela no
268
+ [GitHub](https://github.com/Felipe-Alcantara/notion-workspace-app).
@@ -0,0 +1,222 @@
1
+ # 🧭 notion-workspace-app
2
+
3
+ <div align="center">
4
+
5
+ ![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-3776AB?style=for-the-badge&logo=python&logoColor=white)
6
+ ![Django 5+](https://img.shields.io/badge/Django-5%2B-092E20?style=for-the-badge&logo=django&logoColor=white)
7
+ ![React 18](https://img.shields.io/badge/React-18-61DAFB?style=for-the-badge&logo=react&logoColor=black)
8
+ ![Vite 8](https://img.shields.io/badge/Vite-8-646CFF?style=for-the-badge&logo=vite&logoColor=white)
9
+ ![Licença MIT](https://img.shields.io/badge/Licen%C3%A7a-MIT-green?style=for-the-badge)
10
+
11
+ **Aplicação local completa para operar o Notion com API Django, SPA React, servidor MCP e launcher TUI.**
12
+
13
+ [📖 Sobre](#-sobre-o-projeto) • [🚀 Componentes](#-componentes) • [🎯 Como usar](#-como-usar) • [✅ Qualidade](#-qualidade)
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ ## 📋 Índice
20
+
21
+ - [📖 Sobre o Projeto](#-sobre-o-projeto)
22
+ - [📁 Estrutura do Projeto](#-estrutura-do-projeto)
23
+ - [🚀 Componentes](#-componentes)
24
+ - [✨ Funcionalidades](#-funcionalidades)
25
+ - [🎯 Como Usar](#-como-usar)
26
+ - [🔐 Configuração e Segurança](#-configuração-e-segurança)
27
+ - [✅ Qualidade](#-qualidade)
28
+ - [📄 Licença](#-licença)
29
+ - [👤 Autor](#-autor)
30
+ - [🤝 Contribuições](#-contribuições)
31
+
32
+ ---
33
+
34
+ ## 📖 Sobre o Projeto
35
+
36
+ O `notion-workspace-app` reúne quatro interfaces sobre o mesmo núcleo de dados:
37
+ uma **API REST Django**, uma **SPA React**, um **servidor MCP** para clientes de IA
38
+ e um **launcher TUI** que prepara e inicia o ambiente. A aplicação permite
39
+ gerenciar tarefas em kanban, grade ou lista, explorar o workspace e sincronizar
40
+ repositórios do GitHub com databases do Notion.
41
+
42
+ A regra de negócio compartilhada vem da biblioteca
43
+ [notion-starter](https://github.com/Felipe-Alcantara/notion-starter). Este
44
+ repositório mantém as bordas Django, React e MCP, além da configuração específica
45
+ do produto. A porta de entrada recomendada é `python start_app.py`.
46
+
47
+ O projeto integra o ecossistema
48
+ [Automações do Notion](https://github.com/Felipe-Alcantara/Automa-es-do-Notion).
49
+
50
+ ---
51
+
52
+ ## 📁 Estrutura do Projeto
53
+
54
+ ```text
55
+ notion-workspace-app/
56
+ │
57
+ ├── 📁 server/ # Backend Django e servidor MCP
58
+ │ ├── 📁 api/ # Views, serializers e rotas REST
59
+ │ ├── 📁 config/ # Configuração do projeto Django
60
+ │ ├── 📁 integrations/ # Notion local e shims de adaptadores
61
+ │ ├── 📁 operations/ # Estado operacional em SQLite
62
+ │ ├── 📁 services/ # Shims dos casos de uso compartilhados
63
+ │ └── mcp_server.py # Ferramentas notion.*
64
+ │
65
+ ├── 📁 front/ # SPA React com Vite
66
+ │ ├── 📁 src/components/ # Interface, tarefas e exploração
67
+ │ ├── 📁 src/hooks/ # Estado e acesso à API
68
+ │ └── package-lock.json # Resolução reproduzível do frontend
69
+ │
70
+ ├── 📁 tests/ # Suíte Python automatizada
71
+ ├── .github/workflows/ci.yml # Gates Python e frontend
72
+ ├── start_app.py # Menu interativo de entrada
73
+ ├── requirements.txt # Dependências Python
74
+ ├── QUALIDADE.md # Contrato de qualidade do módulo
75
+ ├── README.md # Este arquivo
76
+ └── LICENSE # Licença MIT
77
+ ```
78
+
79
+ Na distribuição `0.3.0`, `front/` é usado apenas no desenvolvimento: o workflow
80
+ de release compila a SPA para `server/static/frontend/` e o wheel leva esse
81
+ bundle. Assim, a instalação de usuário não precisa de Node/npm.
82
+
83
+ ---
84
+
85
+ ## 🚀 Componentes
86
+
87
+ | Camada | Pasta | Descrição |
88
+ | --- | --- | --- |
89
+ | Launcher | `start_app.py` | TUI que instala dependências, configura e sobe servidor e front |
90
+ | API | `server/api/` | REST Django para tarefas, exploração e opções |
91
+ | Services | `server/services/` | Shims para tarefas, clonagem, ingestão, IA e GitHub |
92
+ | Integrações | `server/integrations/` | Notion local e shims para GitHub/OpenRouter |
93
+ | MCP | `server/mcp_server.py` | Servidor que expõe operações `notion.*` para IAs |
94
+ | Front | `front/` | SPA React com kanban, filtros e exploração do workspace |
95
+
96
+ ---
97
+
98
+ ## ✨ Funcionalidades
99
+
100
+ - visualizar tarefas em kanban, grade e lista;
101
+ - buscar e filtrar tarefas por status, duração e área;
102
+ - criar e editar tarefas pela interface;
103
+ - explorar páginas e databases compartilhados;
104
+ - sincronizar repositórios GitHub com databases do Notion;
105
+ - expor operações para clientes de IA via MCP;
106
+ - iniciar Django e Vite em conjunto pelo launcher interativo.
107
+
108
+ Exemplo de fluxo: ação na SPA → API Django → serviço compartilhado → API do
109
+ Notion.
110
+
111
+ ---
112
+
113
+ ## 🎯 Como Usar
114
+
115
+ ### Instalação distribuída
116
+
117
+ Para usar o ecossistema completo, instale a fachada única:
118
+
119
+ ```bash
120
+ pipx install "notion-automacoes[app]"
121
+ # ou: uv tool install "notion-automacoes[app]"
122
+ notion-automacoes doctor
123
+ notion-automacoes app start
124
+ notion-automacoes mcp start
125
+ ```
126
+
127
+ O release técnico candidato é `0.3.0`; a publicação no PyPI aguarda confirmação
128
+ de nome/ownership/metadados legais. Consulte o guia do hub para a sequência de
129
+ release e o smoke em Windows, macOS e Linux.
130
+
131
+ ### Início rápido
132
+
133
+ O fluxo abaixo é o de desenvolvimento pelo checkout:
134
+
135
+ ```bash
136
+ # Clone o repositório
137
+ git clone https://github.com/Felipe-Alcantara/notion-workspace-app.git
138
+ cd notion-workspace-app
139
+
140
+ # Instale as dependências Python de desenvolvimento
141
+ python -m pip install -e ".[dev]"
142
+
143
+ # Crie a configuração local e preencha os valores necessários
144
+ cp .env.example .env
145
+
146
+ # Abra o menu que instala, configura e inicia o produto
147
+ python start_app.py
148
+ ```
149
+
150
+ No checkout, o launcher aplica as migrações, sobe Django e Vite e abre o navegador. Pelo menu
151
+ também é possível instalar dependências, configurar o ambiente e conferir o
152
+ status dos componentes.
153
+
154
+ Quando executado a partir do wheel, o mesmo launcher sobe apenas o Django e
155
+ serve a SPA empacotada; Node/npm não são consultados.
156
+
157
+ ---
158
+
159
+ ## 🔐 Configuração e Segurança
160
+
161
+ Use `.env.example` como modelo e mantenha o `.env` apenas na máquina local. Para
162
+ operar o workspace, configure `NOTION_TOKEN` e, quando aplicável,
163
+ `NOTION_DATABASE_ID`.
164
+
165
+ Nunca versione tokens, IDs reais ou bancos SQLite. Os testes usam mocks e não
166
+ dependem de credenciais reais.
167
+
168
+ ---
169
+
170
+ ## ✅ Qualidade
171
+
172
+ Gate Python, executado na raiz:
173
+
174
+ ```bash
175
+ python -m ruff check .
176
+ python -m pytest
177
+ ```
178
+
179
+ Gate da SPA:
180
+
181
+ ```bash
182
+ cd front
183
+ npm run lint
184
+ npm run build
185
+ ```
186
+
187
+ A CI executa Python 3.10–3.13 e um job Node 22 com `npm ci`. Consulte
188
+ [`QUALIDADE.md`](QUALIDADE.md) para o critério de pronto e a política de
189
+ dependências.
190
+
191
+ ---
192
+
193
+ ## 📄 Licença
194
+
195
+ Este projeto está sob a licença MIT — veja [`LICENSE`](LICENSE).
196
+
197
+ ---
198
+
199
+ ## 👤 Autor
200
+
201
+ **Felipe Martin**
202
+
203
+ - GitHub: [@Felipe-Alcantara](https://github.com/Felipe-Alcantara)
204
+ - Repositório: [notion-workspace-app](https://github.com/Felipe-Alcantara/notion-workspace-app)
205
+
206
+ ---
207
+
208
+ ## 🤝 Contribuições
209
+
210
+ Contribuições são bem-vindas. Algumas ideias para quem quiser colaborar:
211
+
212
+ - ampliar a escrita genérica na aba Explorar;
213
+ - criar novas visualizações e interações no kanban;
214
+ - melhorar o empacotamento do launcher;
215
+ - expandir acessibilidade, testes e documentação.
216
+
217
+ Leia [`CONTRIBUTING.md`](CONTRIBUTING.md) antes de enviar uma mudança.
218
+
219
+ ---
220
+
221
+ ⭐ Se o app foi útil, considere dar uma estrela no
222
+ [GitHub](https://github.com/Felipe-Alcantara/notion-workspace-app).
@@ -0,0 +1,52 @@
1
+ # Front React
2
+
3
+ SPA do Ciclo 2 para operar tarefas do Notion pelo contrato REST em `docs/CONTRATOS.md`.
4
+
5
+ ## Rodar localmente
6
+
7
+ ```bash
8
+ cd front
9
+ npm install
10
+ npm run dev
11
+ ```
12
+
13
+ O Vite exige Node 20.19+ ou 22.12+. Ele sobe em `http://localhost:5173` e proxia
14
+ `/api` para `http://127.0.0.1:8000`.
15
+
16
+ O app usa o Notion como fonte de verdade por meio da API Django. Se a API falhar,
17
+ o front mostra erro; mock só roda quando você ativar explicitamente:
18
+
19
+ ```bash
20
+ VITE_MOCK_API=true npm run dev
21
+ ```
22
+
23
+ ## Qualidade
24
+
25
+ ```bash
26
+ npm run lint
27
+ npm run build
28
+ ```
29
+
30
+ O gate completo do repositório roda a partir da raiz:
31
+
32
+ ```bash
33
+ python3 scripts/quality_check.py
34
+ ```
35
+
36
+ ## Funcionalidades
37
+
38
+ - Duas abas: **Tarefas** (a todolist, com escrita) e **Explorar** (read-only).
39
+ - **Explorar** lista os databases visíveis à integração e mostra qualquer um
40
+ numa tabela genérica que se adapta ao schema — não só a todolist. Usa
41
+ `GET /api/databases` e `GET /api/databases/{id}`. Só leitura por enquanto.
42
+ - Visualizações em grade, lista e kanban.
43
+ - Indicação explícita da **database ativa** e da **data source** do Notion, com link
44
+ para abrir a tabela atual e conferir se a interface está apontando para a fonte certa.
45
+ - Busca, filtros persistentes por etapa/esforço/área e ordenação. Os valores
46
+ de etapa/esforço/área vêm do Notion e são enviados de volta sem tradução
47
+ local.
48
+ - **Clicar numa tarefa abre a página dela no Notion** (a nota, em nova aba), usando
49
+ a `url` do contrato. A edição fica no **botão de lápis** de cada tarefa.
50
+ - Modal de criação/edição usando `POST /api/tarefas`, `PATCH /api/tarefas/{id}` e
51
+ `GET /api/opcoes`.
52
+ - Estados de carregamento, vazio e erro com feedback acessível.
@@ -0,0 +1,70 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "notion-workspace-app"
7
+ version = "0.3.0"
8
+ description = "Aplicação local para operar o Notion: API Django, SPA React, servidor MCP e launcher TUI (start_app.py)."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { file = "LICENSE" }
12
+ authors = [{ name = "Felipe Alcantara" }]
13
+ dependencies = [
14
+ "notion-starter>=0.3.0,<0.4.0",
15
+ "Django>=5.0",
16
+ "requests>=2.25",
17
+ "questionary>=2.0",
18
+ "rich>=13.0",
19
+ "mcp>=1.28,<2",
20
+ ]
21
+
22
+ [project.optional-dependencies]
23
+ server = [
24
+ "Django>=5.0",
25
+ ]
26
+ mcp = [
27
+ "mcp>=1.28,<2",
28
+ ]
29
+ dev = [
30
+ "pytest>=7.0",
31
+ "responses>=0.23",
32
+ "ruff>=0.4",
33
+ ]
34
+
35
+ [project.scripts]
36
+ notion-automacoes-app = "start_app:main"
37
+ notion-automacoes-mcp = "server.mcp_server:main"
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/Felipe-Alcantara/notion-workspace-app"
41
+ Repository = "https://github.com/Felipe-Alcantara/notion-workspace-app"
42
+
43
+ [tool.hatch.build.targets.wheel]
44
+ packages = ["server"]
45
+ include = ["start_app.py"]
46
+ artifacts = ["server/static/frontend/**"]
47
+
48
+ [tool.hatch.build.targets.wheel.force-include]
49
+ "start_app.py" = "start_app.py"
50
+
51
+ [tool.hatch.build.targets.sdist]
52
+ include = [
53
+ "server",
54
+ "start_app.py",
55
+ "README.md",
56
+ "LICENSE",
57
+ "pyproject.toml",
58
+ ]
59
+ artifacts = ["server/static/frontend/**"]
60
+
61
+ [tool.ruff]
62
+ line-length = 100
63
+ target-version = "py310"
64
+ extend-exclude = ["server/**/migrations/*.py"]
65
+
66
+ [tool.ruff.lint]
67
+ select = ["E", "F", "I", "UP", "B"]
68
+
69
+ [tool.pytest.ini_options]
70
+ testpaths = ["tests"]
@@ -0,0 +1 @@
1
+ """Pacote empacotável do servidor Django e MCP."""
File without changes
@@ -0,0 +1,10 @@
1
+ """Registro do app ``api`` (borda HTTP do servidor)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from django.apps import AppConfig
6
+
7
+
8
+ class ApiConfig(AppConfig):
9
+ default_auto_field = "django.db.models.BigAutoField"
10
+ name = "api"
@@ -0,0 +1,26 @@
1
+ """Serialização da borda HTTP: objetos de domínio → dicts prontos para JSON.
2
+
3
+ Mantém as views finas e o contrato de saída num lugar só. Não expõe o JSON cru
4
+ do Notion (o campo ``bruto`` da :class:`Tarefa` fica fora da resposta pública).
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from typing import Any
10
+
11
+ from notion_starter import Tarefa
12
+
13
+
14
+ def tarefa_para_dict(tarefa: Tarefa) -> dict[str, Any]:
15
+ """Converte uma :class:`Tarefa` no objeto JSON público da API (sem ``bruto``)."""
16
+
17
+ return {
18
+ "id": tarefa.id,
19
+ "nome": tarefa.nome,
20
+ "status": tarefa.status,
21
+ "prazo": tarefa.prazo,
22
+ "duracao": tarefa.duracao,
23
+ "areas": tarefa.areas,
24
+ "areas_nomes": tarefa.areas_nomes,
25
+ "url": tarefa.url,
26
+ }