Skip to main content

Staff Dashboard

The Staff Dashboard is your central hub for daily work activities, providing quick access to time clock, schedule overview, and important notifications.


Overview

Dashboard Purpose

The Staff Dashboard provides:

  1. Time Clock - Clock in/out for your shifts
  2. Today's Schedule - View your shifts for today
  3. Quick Stats - Hours worked this week/month
  4. Notifications - Important updates and alerts
  5. Quick Actions - Common tasks at your fingertips

Accessing the Dashboard

  1. Log in to Shyfts with your credentials
  2. The Staff Dashboard loads as your default home page
  3. Use the sidebar to navigate to other sections

Time Clock Widget

Clock In

To start your shift:

  1. Click Clock In on the time clock widget
  2. Confirm the current time is correct
  3. Your shift timer begins automatically
// Time entry created on clock in
{
staff_id: "your-uuid",
clock_in_time: "2025-01-14T09:00:00Z",
status: "draft"
}

Clock Out

To end your shift:

  1. Click Clock Out when your shift ends
  2. Review your total hours for the day
  3. Add any break time if applicable
  4. Confirm to save your time entry

Break Recording

Breaks can be recorded during your shift:

  1. Click Start Break when taking a break
  2. Click End Break when returning
  3. Break duration is automatically calculated

Today's Schedule

Viewing Your Shifts

The dashboard displays your shifts for today:

ElementDescription
Shift TimeStart and end times (24-hour format)
RoomAssigned room or location
Shift TypeType of shift (Standard, Night, etc.)
StatusConfirmed, Pending, or Cancelled

Schedule Card

// Shift display structure
{
start_time: "09:00",
end_time: "17:30",
room: "Consultation Room 1",
shift_type: "Standard",
status: "confirmed"
}

No Shifts Today

If you have no shifts scheduled:

  • The schedule section shows "No shifts scheduled for today"
  • Check your weekly schedule for upcoming shifts
  • Contact your manager if you believe this is incorrect

Quick Statistics

Weekly Summary

MetricDescription
Hours This WeekTotal hours worked Monday-Sunday
Scheduled HoursHours scheduled for the week
OvertimeHours above weekly threshold

Monthly Overview

MetricDescription
Hours This MonthTotal hours worked this month
Leave DaysLeave days taken this month
Pending RequestsUnapproved time or leave requests

Statistics Calculation

// Weekly hours calculation
const weeklyStats = {
total_hours: entries.reduce((sum, e) => sum + e.total_hours, 0),
regular_hours: Math.min(total_hours, 40),
overtime_hours: Math.max(total_hours - 40, 0)
}

Notifications

Notification Types

TypeIconDescription
Schedule UpdateCalendarShift changes or additions
Leave ResponseCheck/XLeave request approved/rejected
Swap RequestSwapColleague wants to swap shifts
ReminderClockUpcoming shift or deadline
SystemInfoGeneral announcements

Managing Notifications

  • Click a notification to view details
  • Mark as Read to dismiss
  • Mark All Read to clear all notifications
  • Unread count shown in sidebar badge

Notification Settings

Control which notifications you receive:

  1. Go to ProfilePreferences
  2. Toggle notification types on/off
  3. Set email notification preferences

Quick Actions

Available Actions

ActionDescription
Clock In/OutStart or end your shift
Request LeaveSubmit a new leave request
View ScheduleOpen full weekly schedule
Submit TimesheetSubmit hours for approval
View TimesheetCheck your timesheet entries

Action Shortcuts

Quick actions are available from:

  • Dashboard cards (click to expand)
  • Sidebar navigation
  • Keyboard shortcuts (where supported)

Dashboard Widgets

Time Clock Widget

Displays:

  • Current clock status (In/Out)
  • Current time (UK timezone)
  • Today's accumulated hours
  • Clock in/out button

Schedule Widget

Shows:

  • Today's shifts (if any)
  • Next upcoming shift
  • Quick link to full schedule

Leave Balance Widget

Displays:

  • Annual leave remaining
  • Sick leave balance
  • Quick request button

Recent Activity Widget

Shows:

  • Recent timesheet entries
  • Recent leave requests
  • Status of pending items

Mobile Dashboard

Responsive Layout

On mobile devices:

  • Widgets stack vertically
  • Time clock is prominent at top
  • Swipe to navigate between sections
  • Touch-friendly 44px+ buttons

Mobile-Specific Features

  • GPS confirmation for clock in (if enabled)
  • Push notifications for schedule changes
  • Simplified navigation menu

Dashboard API

Fetch Dashboard Data

Endpoint: GET /api/staff/stats

// Dashboard statistics response
{
success: true,
data: {
today: {
shifts: [...],
hours_worked: 4.5,
is_clocked_in: true
},
this_week: {
total_hours: 24.5,
scheduled_hours: 40,
overtime_hours: 0
},
notifications: {
unread_count: 3,
recent: [...]
},
leave_balance: {
annual_remaining: 18,
sick_remaining: 5
}
}
}

Troubleshooting

Common Issues

IssueCauseSolution
Cannot clock inAlready clocked inCheck current status
Time incorrectTimezone issueVerify UK timezone setting
No shifts showingNone scheduledCheck full schedule
Stats not updatingCache delayRefresh the page

Error Messages

ErrorMeaningAction
"Already clocked in"Active time entry existsClock out first
"No scheduled shift"No shift for current timeContact manager
"Session expired"Login timeoutLog in again

Best Practices

Daily Workflow

  1. Start of Day

    • Check dashboard for today's schedule
    • Clock in at shift start time
    • Review any notifications
  2. During Shift

    • Record breaks accurately
    • Check for schedule updates
    • Respond to swap requests
  3. End of Day

    • Clock out when shift ends
    • Review hours worked
    • Submit timesheet if end of period

Time Accuracy

  • Clock in within 5 minutes of shift start
  • Clock out when actually leaving
  • Record all breaks honestly
  • Report any time discrepancies promptly


Source Files:

  • src/app/api/staff/stats/route.ts - Dashboard statistics API
  • src/app/api/staff/timesheet/route.ts - Time entries API
  • src/app/api/staff/shifts/route.ts - Staff shifts API
  • src/components/staff/StaffScheduleCalendar.tsx - Schedule component