Feat/us01 student management#37
Merged
Merged
Conversation
- Refactor login page to use useActionState + Server Action (no client-side Supabase) - Implement src/app/actions/auth.ts: Zod validation, SSR signInWithPassword, role-based redirect - Remove insecure auto-signUp block from login flow - Add ADR-002 documenting auth architecture decisions and known gaps - Add session report for 2026-04-08 session
- Add router.refresh() after createAluno, updateAluno, deleteAluno, createMatricula to sync server-side revalidatePath with the client table view - Extract AlunoActionsCell component in columns.tsx to fix useToast() Rules of Hooks violation (hook was called inside TanStack Table cell render function) - Fix TypeScript types in alunos-client.tsx: any[] → Aluno[], any | null → Aluno | null, export FormValues from form-aluno.tsx for shared typing - Implement role-based routing in middleware.ts: unauthenticated → /login, funcionário on /aluno/** → /dashboard, aluno on /dashboard/** → /aluno - Add search/filter input and column sorting (nomeCompleto, dataCadastro, statusMatricula) to DataTable using TanStack Table getFilteredRowModel + getSortedRowModel
- Remove client-side auth (useAuth + useEffect redirect) from dashboard layout
- Get user server-side via createClient() — no loading flash, no client auth calls
- Create UserMenu client component (header dropdown with logout via Server Action)
- Add logout() Server Action to auth.ts — signOut + redirect('/login')
- Replace useAuth in DashboardNavBottom with form/Server Action for logout
- Dashboard is now fully protected by middleware (role-based routing) + layout redirect
- Server Actions: createPlanoAction, updatePlanoAction, deletePlanoAction with Zod validation, auth guard, revalidatePath, and typed error returns - FormPlano: React Hook Form + Zod dialog for create/edit (nome, preco, duracaoDias) - PlanosClient: card grid with edit/delete per card, AlertDialog for delete confirm, router.refresh() after mutations, toast feedback - PlanosPage: refactored to async Server Component with Suspense + skeleton fallback
- Dynamic route /dashboard/alunos/[id] — Server Component with notFound() guard - Displays: profile card (avatar, name, CPF, phone, DOB, enrollment date), gamification stats (level, XP bar, streak, monthly workouts), current plan with expiry, enrollment history, last 10 payments, active workouts - getAlunoDetalhes() in data.ts — Prisma query with Matriculas+Plano, Pagamentos, Treinos+Exercicios, and last 5 HistoricoTreinos - AlunoDetalhes type exported from data.ts for downstream use - 'Ver Detalhes' action added to table row dropdown (navigates to /[id] page)
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
No description provided.