webmoney/.github/copilot-instructions.md
marco 44bc999840 feat: melhorias no filtro de transações
- Filtro 'Sem Categoria' mostra lista flat ao invés de agrupada por semanas
- Transações futuras aparecem quando qualquer filtro está ativo
- Filtro de data parcial (só data inicial ou só data final)
- COALESCE para effective_date com fallback para planned_date
- Traduções i18n para filteredResults, filterActive, uncategorized
2025-12-19 14:28:27 +01:00

228 lines
5.4 KiB
Markdown
Executable File
Raw Blame History

# Copilot Instructions
## 🖥️ AMBIENTE DE DESENVOLVIMENTO - SERVIDOR DE PRODUÇÃO
**IMPORTANTE:** Estamos trabalhando diretamente no servidor de produção.
- **Hostname:** cnxifly.com
- **IP:** 213.165.93.60
- **Sistema:** Ubuntu 24.04.3 LTS
- **Workspace:** `/root/webmoney` (symlink: `/var/www/webmoney`)
### ⚠️ Consequências
Como trabalhamos diretamente em produção:
- Mudanças em arquivos PHP **afetam imediatamente** o site
- Mudanças no Frontend **requerem build** (`npm run build`)
- **NÃO** é necessário usar SSH, sshpass ou scripts de deploy
- **Testar sempre** antes de fazer commit
---
## 🔄 REPOSITÓRIO GIT - GITEA (Self-Hosted)
O repositório está em nosso Gitea, NÃO no GitHub.
### Configuração
```bash
# Remote configurado
git remote -v
# origin https://git.cnxifly.com/marco/webmoney.git
# URL Web
https://git.cnxifly.com/marco/webmoney
# Credenciais Gitea
Usuário: marco
Senha: M@ster9354
```
### 📋 Workflow de Desenvolvimento
```bash
# 1. Fazer alterações no código
# 2. Para Frontend (React) - OBRIGATÓRIO build:
cd /root/webmoney/frontend && npm run build
# 3. Para Backend (PHP) - Apenas se necessário:
cd /root/webmoney/backend && php artisan config:clear && php artisan cache:clear
# 4. Testar em https://webmoney.cnxifly.com
# 5. Se OK, commit e push:
cd /root/webmoney
git add -A && git commit -m "descrição" && git push origin main
# 6. Atualizar VERSION, README, APRENDIZEDOS_TECNICOS e CHANGELOG.md se necessário
```
### ❌ Proibições Git
- NUNCA usar GitHub (repositório descontinuado)
- NUNCA fazer push sem testar antes
---
## 🏗️ Estrutura do Projeto
```
/root/webmoney/ ← Workspace (VS Code)
↓ symlink
/var/www/webmoney/ ← Servido pelo Nginx
├── backend/ # Laravel API
│ ├── app/
│ ├── config/
│ ├── database/
│ ├── routes/api.php
│ ├── storage/logs/
│ └── .env # Configuração produção
└── frontend/
├── src/ # Código React
└── dist/ # Build (servido pelo Nginx)
```
---
## 🔧 Serviços do Servidor
| Serviço | Versão | Status |
|---------|--------|--------|
| Nginx | latest | ✅ Ativo |
| PHP-FPM | 8.4.15 | ✅ Ativo |
| MariaDB | 11.4.9 | ✅ Ativo |
| Redis | 7.0.15 | ✅ Ativo |
| Node.js | 22.21.0 | ✅ Disponível |
| Postfix | - | ✅ Ativo |
| Dovecot | - | ✅ Ativo |
| Gitea | - | ✅ Ativo |
### Comandos Úteis
```bash
# Reiniciar PHP-FPM (após mudanças em config)
systemctl restart php8.4-fpm
# Ver logs Laravel
tail -f /root/webmoney/backend/storage/logs/laravel.log
# Ver logs Nginx
tail -f /var/log/nginx/webmoney_subdomain_error.log
# Limpar cache Laravel
cd /root/webmoney/backend && php artisan optimize:clear
# Build frontend
cd /root/webmoney/frontend && npm run build
# Tinker (debug PHP)
cd /root/webmoney/backend && php artisan tinker
# MySQL
mysql -u webmoney -p'M@ster9354' webmoney -e "QUERY"
```
---
## 🔐 Credenciais
| Serviço | Usuário | Senha |
|---------|---------|-------|
| Servidor (root) | root | Master9354 |
| MySQL | webmoney | M@ster9354 |
| WebMoney App | marco@cnxifly.com | M@ster9354 |
| Gitea | marco | M@ster9354 |
---
## 🚫 Regras de UI/UX
**NUNCA use alert(), confirm() ou prompt() do navegador.**
```jsx
// ❌ PROIBIDO
alert('Erro!');
confirm('Tem certeza?');
// ✅ CORRETO
import { useToast } from '../components/Toast';
import { ConfirmModal } from '../components/Modal';
const toast = useToast();
toast.error('Erro!');
toast.success('Sucesso!');
```
---
## <20><> Padrão Visual de Modais
**TODOS os modais de formulário devem seguir este padrão:**
### Cores do Sistema
- **Background modal**: `#1e293b`
- **Background campos/cards**: `#0f172a`
- **Texto principal**: `text-white`
- **Texto secundário**: `text-slate-400`
### Estrutura Base
```jsx
<div className="modal show d-block" style={{ backgroundColor: 'rgba(0,0,0,0.8)' }}>
<div className="modal-dialog modal-dialog-centered modal-lg">
<div className="modal-content border-0" style={{ background: '#1e293b', maxHeight: '90vh' }}>
{/* Header sem borda */}
<div className="modal-header border-0 pb-0">
<h5 className="modal-title text-white">
<i className="bi bi-icon me-2 text-primary"></i>
Título
</h5>
<button className="btn-close btn-close-white" onClick={onClose}></button>
</div>
{/* Body com scroll */}
<div className="modal-body pt-3" style={{ maxHeight: '65vh', overflowY: 'auto' }}>
{/* Conteúdo */}
</div>
{/* Footer sem borda */}
<div className="modal-footer border-0">
<button className="btn btn-outline-secondary px-4">Cancelar</button>
<button className="btn btn-primary px-4">Salvar</button>
</div>
</div>
</div>
</div>
```
---
## 📝 Quando Atualizar Documentação
### VERSION
- Após cada funcionalidade completa
- Formato: X.Y.Z (Major.Minor.Patch)
### CHANGELOG.md
- Toda mudança significativa
- Formato: data, tipo, descrição
### README.md
- Nova funcionalidade importante
- Mudança de requisitos
- Novos endpoints de API
- Novos comandos
---
## 🌐 URLs do Projeto
| Serviço | URL |
|---------|-----|
| WebMoney App | https://webmoney.cnxifly.com |
| WebMoney API | https://webmoney.cnxifly.com/api |
| Gitea | https://git.cnxifly.com |
| phpMyAdmin | https://pma.cnxifly.com |
| Webmail | https://mail.cnxifly.com |