# Copilot Instructions ## 🖥️ AMBIENTE DE DESENVOLVIMENTO - SERVIDOR DE PRODUÇÃO **IMPORTANTE:** Estamos trabalhando diretamente no servidor de produção. - **Hostname:** mail.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 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!'); ``` --- ## �� 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