5.7 KiB
5.7 KiB
EduManager - Regras Globais e Escopo
🚀 Escopo do Projeto
EduManager é um Sistema de Gestão Escolar completo, focado em alta performance, usabilidade premium e automação de processos administrativos e acadêmicos.
🛠️ Stack Tecnológica
- Frontend/Backend: Remix (React)
- Banco de Dados: PostgreSQL (100% Local/Self-Hosted)
- Storage Architecture: 100% Self-Hosted (MinIO) - Decoupled from Supabase Cloud.
- Image Serving: All images are served via a backend proxy route (
/storage/:bucket/:key) to ensure cross-origin compatibility and security. - Synchronization: High-performance local API for bank reconciliation (Asaas).
- Orquestração e CI/CD: Portainer (Docker) com GitHub Actions via Self-Hosted Runner (Oracle ARM64 nativo) e Watchtower.
- Production Entry Point: All production deployments MUST use
server.selfhosted.jsrenamed/copied asserver.jsin the Docker containers to ensure full local feature availability.
⚠️ Regras de Negócio Críticas (MANDATÓRIO)
[!IMPORTANT] Migração de Dados (Legado 'schoodat'): Ao realizar a migração completa dos dados do sistema legado 'schoodat' para o nosso banco de dados local Postgres, é terminantemente proibido alterar, resetar ou re-hashear as senhas existentes. As credenciais devem ser mantidas exatamente como estão para garantir que o acesso dos usuários não seja interrompido.
📜 Padrões de Desenvolvimento
- Design System: Estética Premium, Dark Mode por padrão (ou glassmorphism), micro-animações e ausência de placeholders.
- Segurança: Todas as rotas sensíveis devem validar o token JWT local (via secrets do ambiente). Proibido usar Supabase SDK para lógica de autenticação ou sincronização no frontend.
- Resiliência: Tratamento rigoroso de erros em chamadas de API de terceiros (Asaas, Evolution API).
- Upload de Arquivos: Proibido o uso de Base64 para envio de novos arquivos ao servidor. Use obrigatoriamente
FormDatae envie o objetoFile/Blobpara as rotas de API que integram com o MinIO. - Build & Deploy Stability: O pipeline de deploy deve obrigatoriamente utilizar
runs-on: self-hostede compilar apenas a plataformalinux/arm64(sem emulação QEMU). A atualização da stack em produção deve ser automatizada via container transiente do Watchtower. - Express Compatibility: Avoid using raw
/*wildcards in Express 5 routes; use Regex paths (/^\/route\/(.+)$/) for compatibility withpath-to-regexpv8. - Frontend Independence: NEVER import files from
services/orserver.jsdirectly into React components to prevent Node.js/SDK leakage (causes White Screen). Physical isolation is enforced: backend-only services (like MinIO/S3 storage) MUST stay outside thesrc/directory in Vite/React projects. Usehelpers.tsfor UI logic and standardfetchfor API calls. - Login Persistence: Administrative sessions are persisted via
localStorage('edumanager_session'). The main entry point MUST validate the session on mount to ensure UX continuity. - Real-time & Sync: In self-hosted environments, use Intelligent Polling (30s) to synchronize notifications and critical data between Portal and Manager, as standard Supabase Realtime is disabled.
- Justification Logic: Attendance justifications MUST include
fromStudentIdin notification metadata and support botharquivoandarquivo_base64keys for attachment compatibility. Notifications SHOULD include the motive text in themessagefield (JSON format:{text, motivo}) to allow previews in the manager bell. - Modal Standards: System modals should utilize
bg-transparent(no background darkening or blur) withshadow-2xlfor depth, ensuring a clean and float-like aesthetic. - Messages Automation: Preventive reminders and overdue settings MUST be managed within their respective template modals (contextual logic), with independent manual triggers for each phase (Overdue vs. Upcoming).
- Grading & Evaluation Standards: Assessments are categorized as
exam(violet/violet labels) oractivity(sky/blue labels). The report card (Boletim) MUST support multiple evaluations per period, showing the individual breakdown (name and value). The module MUST be named "Atividades e Provas" for clarity. - Asaas Safety: All financial generation forms MUST implement a loading state (
isCreating) to disable submit buttons and prevent duplicate charges. - Retake Policy: Students ARE allowed to retake activities and exams. The system MUST delete the previous submission and overwrite the grade in
school_data.jsonto ensure only the latest attempt is valid. - Financial Categories: The system supports categories:
monthly(Mensalidade),registration(Matrícula),handout(Apostila), andothers(Outros). Automated forms must map references (Cursos -> monthly, Registration -> registration, Handout -> handout). - Modal Floating Principle: All system modals must avoid backdrop-blur and background overlays. Use
bg-transparentfor the fixed container andbg-white(solid) for the modal box, ensuring contrast via large soft shadows (shadow-2xlor equivalent). - Automated Messaging (Cron Jobs): The system uses
node-cronfor independent message scheduling (Preventive vs. Overdue). Overdue logic MUST implement safety checks usingoverdue_warnings_countandlast_overdue_warning_atto avoid spamming the student. Immediate webhook triggers forPAYMENT_OVERDUEare disabled in favor of scheduled routines. - Numerical Data Integrity: When retrieving data from PostgreSQL
NUMERICorDECIMALcolumns, values MUST be explicitly cast toNumber()in the backend before being sent to the frontend to prevent crashes when using.toFixed()in React.