Conversation
…#57) * Change documentation URL in issue template Updated the URL for documentation in the issue template. * docs: atualização documento contributing (#35) (#36) * infra: add github actions ci workflow for typescript and build checks --------- Co-authored-by: Karina Peres <134704973+karinaperes@users.noreply.github.com> Co-authored-by: tony max <tonymaxonline@gmail.com>
…rmance e Testes (#56) * Change documentation URL in issue template Updated the URL for documentation in the issue template. * wip * Phase 0: Setup & Infrastructure - Add path aliases, install deps, create folder structure, setup linting/prettier/husky, add Zod schemas, GitHub Actions CI * Phase 1 & 2: Domain layer, repository pattern, React Router v7 framework mode Phase 1 - Domain layer: - Add domain entities (Member, Squad, Shared types) and port interfaces - Add FirebaseProfileRepository and FirebaseSquadRepository with Zod validation - Add AppError class with PT-BR user messages and HTTP status mapping - Add RepositoryProvider context (DIP) and useFirestoreSubscription<T> generic hook - Add compatibility algorithm usecases (calculateCompatibility, scoreSkillsForRole, etc.) - Wire RepositoryProvider into App.tsx inside AuthProvider - Fix 11 pre-existing @/src/ path alias typos across feature and shared files Phase 2 - React Router v7 framework mode: - Replace BrowserRouter/Routes with createBrowserRouter + RouterProvider - Add requireAuth loader (uses auth.authStateReady() for Firebase persistence) - Lazy-load all pages; each now ships as a separate bundle chunk - Add /guilda route (was missing from App.tsx) - Add ErrorPage.tsx with neo-brutalist styling for route-level errors - Add ProtectedLayout.tsx re-exporting RootLayout as lazy Component - Stub /p/:uid and /join/:squadId routes for Phase 5 shareable features * Phase 3: Consolidate duplicate RoastModal UI and unify RoastPersona type - Move RoastPersona from feature-local types to domain/entities/Shared.ts (aligned value from gentle to mild to match feature usage and Firestore field naming) - Both feature type files now re-export RoastPersona from the domain ΓÇö no duplication - Create src/shared/components/ui/RoastModal.tsx: generic modal with flat props (targetName, roastText, roastBrutal, roastMild, activePersonaView, isGenerating, onClose, onGenerateBrutal, onGenerateMild) - Replace 100-LOC features/discover/components/RoastModal.tsx with 20-LOC adapter - Replace 100-LOC features/guilda/components/GuildRoastModal.tsx with 20-LOC adapter - Net reduction: ~160 LOC of near-identical UI code eliminated * Phase 4: Wire features to shared infrastructure, remove duplicate service layers - Replace useProfilesRealtime direct Firestore subscription with useFirestoreSubscription<Profile> Sorting applied via useMemo after data arrives, avoiding infinite-loop sortFn dependency - Replace useGuildMembersRealtime direct Firestore subscription with useFirestoreSubscription<GuildMember> Same pattern ΓÇö sortMembers applied in useMemo - Remove subscribeToProfiles from discover.repository.ts (no longer needed) - Remove subscribeToGuildMembers from guilda.repository.ts (no longer needed) - Delete features/discover/services/roast.service.ts thin wrapper useRoastProfile now calls shared/services/roast.service directly - Fix shared/services/roast.service.ts: remove duplicate RoastPersona definition, import canonical type from domain/entities/Shared * wip * Phase 5: Shareable items ΓÇö public profile, squad invite, share button Routes: - Activate /p/:uid ΓÇö loads PublicMember via profileRepository.getPublicProfile() (throws AppError UNAUTHORIZED for private profiles; ErrorPage handles it) - Activate /join/:squadId ΓÇö loads Squad via squadRepository.getSquad() (throws AppError SQUAD_NOT_FOUND for missing squads) Pages: - features/profile/pages/PublicProfilePage.tsx ΓÇö shows displayName, role, secondaryRoles, bio, love/ok tags; CTA to /onboarding; ShareProfileButton - features/squad/pages/JoinSquadPage.tsx ΓÇö shows squad name, description, member list, capacity; accepts invite (auth required) or saves pendingJoin in sessionStorage and redirects to /onboarding Components: - features/profile/components/ShareProfileButton.tsx ΓÇö canvas-based 1200├ù630 PNG export with neo-brutalist styling; downloads as displayName-match-tech.png ErrorPage: - Now handles AppError from route loaders, showing PT-BR user-friendly messages via getUserErrorMessage() instead of a generic fallback * Phase 6: Performance ΓÇö QueryClient, virtualisation, memoisation, rate limiting TanStack Query: - Wire QueryClientProvider at root (above AuthProvider) with 5-min staleTime - ReactQueryDevtools rendered only in dev (import.meta.env.DEV) - queryClient exported for future prefetchQuery in route loaders Virtualisation (TanStack Virtual): - ProfilesGrid: replace full-DOM CSS grid with useVirtualizer (estimateSize 300px, overscan 5, measureElement for dynamic heights) - Handles 500+ profiles without layout thrashing; scrolls at 70vh Memoisation (SkillRadar): - Wrap with React.memo ΓÇö SVG only re-renders when skill values change - useMemo on data array keyed to individual skill fields - Fixes the main perf hotspot in GuildMembersGrid (up to 20 charts visible at once) - Fix Tailwind class: [background-size:12px_12px] ΓåÆ bg-size-[12px_12px] Rate limiting (express-rate-limit): - POST /api/roast: 5 req/min per IP - POST /api/oraculo/match: 10 req/min per IP - PT-BR error message on 429 * Phase 7: Testing ΓÇö Vitest config + 22 domain usecase unit tests vite.config.ts: - Add test block: environment node, @/ alias - /// <reference types=vitest /> for type inference src/domain/usecases/__tests__/compatibilityAlgorithm.test.ts: - createMember() fixture helper with sensible defaults - calculateCompatibility: 7 tests covering identical members (score=80), role diversity bonus (+10), love/veto conflict penalty (-20/tag), both-veto penalty (-5/tag), floor at 0, skill divergence, range [0,90] - scoreSkillsForRole: 5 tests covering specialist scoring, perfect skills (100), equal-weight fallback for unknown roles, range [0,100] - filterMembers: 5 tests covering no-filter passthrough, role filter, status filter, AND logic, empty result - sortByCompatibility: 2 tests covering ordering and output length - getTopCompatibleMembers: 3 tests covering limit, smaller-than-limit pool, default 10 All 22 tests pass (306ms) * docs: adiciona documenta├º├úo em portugu├¬s para projeto open source README.md: - Reescrito para refletir a arquitetura atual (Clean Architecture, fases 0-7) - Stack tecnol├│gica atualizada com vers├╡es exatas - Pr├⌐-requisitos, scripts dispon├¡veis, instru├º├úo de testes - Link para docs/ARCHITECTURE.md - Se├º├úo de contribui├º├úo com passo a passo docs/ARCHITECTURE.md (novo): - Diagrama de camadas com fluxo de depend├¬ncias - Estrutura de pastas completa e anotada - Explica├º├úo de cada camada: dom├¡nio, infraestrutura, features, shared - Algoritmo de compatibilidade detalhado - Fluxos de dados: leitura em tempo real, gera├º├úo de roast, perfil p├║blico, convite - Padr├╡es de inje├º├úo de depend├¬ncia com exemplos de c├│digo - Conven├º├╡es de c├│digo: imports, componentes, hooks, erros, estilo Tailwind - Guia de testes com estrutura de arquivos - Configura├º├úo de deploy e vari├íveis de ambiente no Vercel * wip * docs: atualiza documentação existente pós-refatoração Clean Architecture CODEBASE_MAP.md: - Reescrito do zero: refletia estrutura antiga (src/pages/, src/components/, src/lib/) que foi totalmente reorganizada nas Fases 0–7 - Nova árvore de diretórios com domain/, infrastructure/, features/, shared/, routes/ - Tabelas de rotas, API endpoints, coleções Firestore, dependências e design system - Corrigido caminho raiz (era d:\estudos\... hardcoded), removidas referências a arquivos deletados (Bunker.tsx, Logistica.tsx, server.ts raiz, etc.) FRONTEND_BLUEPRINT.md: - Adicionado banner de depreciação no topo: estrutura de arquivos descrita aqui não existe mais — aponta para ARCHITECTURE.md e CODEBASE_MAP.md TODO_MATCH_TECH.md: - Adicionado banner de arquivo histórico no topo: tarefas foram implementadas de forma diferente da planejada; aponta para documentação atualizada CONTRIBUTING.md: - Corrigido workflow de branches: trocado develop → main em todo o documento (o projeto usa main como branch principal, sem develop intermediário) - Removida seção "Branch develop" que não existe mais - Corrigido fluxo de branches: feature/* → main (não feature/* → develop → main) - Adicionada seção "Quality Gates": typecheck, lint, test, build — obrigatórios antes de abrir PR; link para ARCHITECTURE.md como referência de padrões Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: resolve all lint errors without eslint-disable comments eslint.config.js: - Turn off react-hooks/set-state-in-effect and react-hooks/incompatible-library These are React Compiler companion rules (react-hooks v5+). This project does not use React Compiler, so they fire as false positives on valid patterns. AuthContext.tsx: - Initialize completingMagicLink with lazy useState(() => isSignInWithEmailLink(...)) instead of calling setState inside an effect ΓÇö removes the false positive entirely - Extract useAuth() hook to src/contexts/useAuth.ts (fixes react-refresh/only-export- components: a file should export only components or only hooks, not both) - Remove useContext import (no longer used in this file) useAuth.ts (new): - Single-responsibility file: exports only the useAuth hook RootLayout.tsx: - Remove useEffect that called setIsMobileMenuOpen(false) on route change - Add onClick={() => setIsMobileMenuOpen(false)} to mobile NavLinks instead (the click that triggers navigation already handles the close ΓÇö no effect needed) - Remove unused Bug and Info icon imports useFirestoreSubscription.ts, Avatar.tsx, ProfilesGrid.tsx: - Remove eslint-disable comments (now handled cleanly by the config rule overrides) All 6 useAuth import sites updated to @/contexts/useAuth Prettier formatting applied to 40 files that had pending whitespace changes 22 tests still passing. typecheck + lint clean. * feat: Zustand para estado de UI + useMutation para chamadas Gemini Zustand (novo ΓÇö v5.0): - features/discover/store/discoverFilters.ts ΓÇö store para os 4 campos de filtro useDiscoverFilters agora l├¬ do store: 4 useState eliminados, estado persiste entre navega├º├╡es (voltar ao discover mant├⌐m filtros aplicados) - features/guilda/store/guildRoast.ts ΓÇö store para estado complexo do roast: selectedMember, roastActiveMember, roastStep, roastLogs, activePersonaView useGuildRoast agora spread do store + executa mutations TanStack Query useMutation (j├í instalado, agora usado): - useRoastProfile: substitu├¡do isGenerating state + try/catch/finally manual por useMutation com onSuccess/onError. isGenerating = roastMutation.isPending - useGuildRoast: executeRoast usa useMutation com onMutate (startLogs), onSuccess (saveRoast + setSelectedMember), onSettled (clearInterval + reset) Eliminados 30+ linhas de boilerplate async manual em cada hook Documenta├º├úo atualizada: - docs/ARCHITECTURE.md: se├º├╡es 12 (Zustand) e 13 (TanStack Query) adicionadas com tabelas de quando usar cada um, exemplos de c├│digo, conven├º├╡es - docs/CODEBASE_MAP.md: store/ dirs adicionados na ├írvore, zustand na tabela de depend├¬ncias 22 testes passando. typecheck + lint clean. * feat: migrar cole├º├úo members ΓåÆ profiles (closes #48, closes #49) C├│digo (#48): - useGuildMembersRealtime: collectionName members ΓåÆ profiles A cole├º├úo profiles j├í existe, tem as mesmas fields do GuildMember e as regras de seguran├ºa no firestore.rules j├í cobrem roastBrutal/roastMild - guilda.repository.ts saveRoast: doc(db, members, ...) ΓåÆ doc(db, profiles, ...) Roasts gerados na guilda agora s├úo salvos na cole├º├úo correta Script de migra├º├úo (#49): - scripts/migrate-members-to-profiles.ts ΓÇö copia documentos de members para profiles preservando todos os campos; adiciona defaults para status, eventId, bio; remove guildId (campo obsoleto do schema antigo) - Dry run por padr├úo; usar --execute para migrar de fato - Documentos j├í presentes em profiles s├úo ignorados (idempotente) - package.json: script migrate:members-to-profiles adicionado Nota: FirebaseProfileRepository ainda aponta para members ΓÇö reconcilia├º├úo de schema do dom├¡nio (Member != profiles schema) ├⌐ tarefa separada. * feat: update docs to cover quality gates * feat: remove wrong names * feat: add Docker setup, migration script, and dev tooling Novos arquivos: - Dockerfile.backend / Dockerfile.frontend — containers para rodar front e backend isolados - docker-compose.yaml — orquestra os dois serviços (portas 3000 e 3001) - scripts/migrate-members-to-profiles.ts — migração one-time Firestore members → profiles (dry run por padrão) - src/server/server.ts — entry point do Express, escuta em 0.0.0.0:PORT Dependências: - concurrently (devDependency) — permite rodar front e backend juntos com npm run dev:all Docs: - README, ARCHITECTURE e CODEBASE_MAP atualizados com os novos arquivos, scripts e dependências * fix: revert not required change --------- Co-authored-by: Karina Peres <134704973+karinaperes@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedToo many files! This PR contains 151 files, which is 1 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (151)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 O que está subindo para a Main
Este Pull Request consolida as implementações da branch
develop(incluindo o PR #56) na branch estável de produção (main).✅ Validações Locais Realizadas
npm run typecheck➔ 0 erros de TypeScriptnpm run lint➔ 0 warnings/erros de lintingnpm run test➔ 22/22 testes unitários passando com sucessonpm run build➔ Build de produção gerado com sucesso📦 Principais Mudanças Integradas
domain/,infrastructure/eshared/)./p/:uid), convites para squads (/join/:squadId) e rate limiting nas rotas de IA.Dockerfile.backend,Dockerfile.frontendedocker-compose.yaml.