Skip to content

Feat/us01 student management#37

Merged
EmiyaKiritsugu3 merged 10 commits into
mainfrom
feat/us01-student-management
Apr 9, 2026
Merged

Feat/us01 student management#37
EmiyaKiritsugu3 merged 10 commits into
mainfrom
feat/us01-student-management

Conversation

@EmiyaKiritsugu3

Copy link
Copy Markdown
Owner

No description provided.

- 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)
@EmiyaKiritsugu3 EmiyaKiritsugu3 merged commit d7931cc into main Apr 9, 2026
3 of 4 checks passed
@vercel

vercel Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
smartmanagementsystem Ready Ready Preview, Comment Apr 9, 2026 6:41pm

@EmiyaKiritsugu3 EmiyaKiritsugu3 deleted the feat/us01-student-management branch April 9, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant