-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Implement staff dashboard, admin attendance page, and role-based routing #394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughThis PR introduces role-based authentication with separate staff and student dashboards. Staff users gain access to an attendance portal with real-time clock in/out tracking, activity overview, and dashboard widgets. An admin attendance management page is added for viewing and managing all staff attendance logs. Navigation and middleware are updated to route users to appropriate dashboards based on their role. Changes
Sequence DiagramsequenceDiagram
participant User
participant Browser
participant Middleware
participant Supabase
participant ProtectedLayout
participant StaffLayout
participant Dashboard
User->>Browser: Navigate to app
Browser->>Middleware: Request page
Middleware->>Supabase: Fetch user profile & role
alt Role is staff
Supabase-->>Middleware: role: 'staff'
Middleware-->>Browser: Redirect to /staff/dashboard
Browser->>StaffLayout: Load staff layout
StaffLayout->>Supabase: Fetch attendance logs
Supabase-->>StaffLayout: Attendance history
StaffLayout->>Dashboard: Render staff dashboard
Dashboard-->>User: Display dashboard with widgets
else Role is student
Supabase-->>Middleware: role: 'student'
Middleware-->>Browser: Redirect to /protected
Browser->>ProtectedLayout: Load protected layout
ProtectedLayout->>Dashboard: Render student dashboard
Dashboard-->>User: Display dashboard
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (14)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This PR introduces the new Staff Dashboard, Admin Attendance Page, and a fully updated role-based routing system across the application.
Key Changes
Added Staff Dashboard with stats, quick actions, weekly overview, and widgets.
Implemented Admin Attendance Page with mock data (DB-ready structure).
Introduced centralized, scalable role-based routing:
/staff/dashboard.Updated
middleware.tswith improved route handling logic.Added new components:
AttendanceWidgetDashboardStatsStaffSidebarWeeklyOverviewheaderanduser-iconfor role awareness.Refactored folder structure for cleaner routing and future extensibility.
Why This Matters
Testing
Additional Notes
Auhored by: @akshay0611
Summary by CodeRabbit
New Features
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.