# Phase 13: Student Auth & Dashboard UI Refresh

## Date
- 2026-04-15

## Scope
- Limited to the student-facing register page, login page, Google sign-in flow, and student dashboard.
- No unrelated admin, instructor, public course, or payment modules were refactored.

## What Was Implemented
1. Student registration now collects `name`, `email`, `phone`, `gender`, and password details with both frontend and backend validation.
2. Student login was rebuilt into a TailAdmin-inspired auth experience while preserving the existing Laravel auth pipeline.
3. Google auth now auto-creates active student users when needed, restores soft-deleted matches, and updates `last_login_at`.
4. The student dashboard now uses a dedicated TailAdmin-inspired Blade view with sidebar/topbar structure, welcome content, stat placeholders, and reusable stat cards.
5. Student lesson progress checks were aligned with the actual `lesson_progress.completed` schema column used by the project.

## File Structure Changes
- Added `database/migrations/2026_04_15_093000_add_gender_to_users_table.php`
- Added reusable student UI components:
  - `resources/views/components/ui/input.blade.php`
  - `resources/views/components/ui/select.blade.php`
  - `resources/views/components/ui/button.blade.php`
  - `resources/views/components/ui/stat-card.blade.php`
- Added student-specific views:
  - `resources/views/auth/student-login.blade.php`
  - `resources/views/auth/student-register.blade.php`
  - `resources/views/student/dashboard.blade.php`

## Routes Involved
- Existing routes were reused:
  - `GET /register`
  - `POST /register`
  - `GET /login`
  - `POST /login`
  - `GET /auth/google`
  - `GET /auth/google/callback`
  - `GET /dashboard`

## Controllers Updated
- `Auth\RegisteredUserController`
- `Auth\AuthenticatedSessionController`
- `Auth\SocialAuthController`
- `StudentController`
- `Student\LessonController`

## UI Decisions
- Used TailAdmin as a design-system reference instead of copying raw template HTML directly.
- Reused CEPI logo variants from `public/assets/i/cepi-logo*`.
- Introduced reusable Blade components for inputs, selects, buttons, and stats so the student area can scale cleanly.
- Kept the dashboard metrics intentionally light and relationship-driven for Phase 1 stability.

## Assumptions
- Registration still requires a password because email/password login remains part of the required student flow.
- `phone` is the correct persistence field for the requested mobile number.
- The `student` role should only be auto-assigned for newly registering users or Google users with no existing role assignment.
