How ryangrankin/shift-scheduler works
Restaurant Shift Scheduler is a multi-restaurant web application for account approval, staff administration, and employee scheduling. Managers create or auto-generate shifts, review availability and pickup requests, and manage staff; employees submit availability and access or pick up shifts. App administrators create restaurants and approve their first managers. The graph preserves these documented capabilities, plus authentication and availability-conflict checking. Source excerpts establish several internal calls; broader UI-to-API links are based on the README, and unsampled route behavior is not asserted.
Main entry points: db.ts Database connection · availability-conflicts.ts Conflict checking · restaurants/page.tsx Restaurant dashboard · schedule/page.tsx Schedule management
Components 27
Identity & onboarding
- Registration
app/register/page.tsx - Account registration
app/api/register/route.ts - Authentication
auth.ts - Manager invitations
app/api/manager/invitations/route.ts - Invitation acceptance
app/api/invitations/accept/route.ts
Restaurant administration
- Restaurant dashboard
app/admin/restaurants/page.tsx - Restaurant administration
app/api/admin/restaurants/route.ts - Manager approvals
app/api/admin/manager-approvals/route.ts
Staff & scheduling
- Staff management
app/manager/staff/page.tsx - Staff API
app/api/manager/staff/route.ts - Schedule management
app/manager/schedule/page.tsx - Shift management
app/api/manager/shifts/route.ts - Shift details
app/api/manager/shifts/[id]/route.ts - Auto scheduling
app/api/manager/auto-schedule/route.ts - Availability review
app/api/manager/availability-requests/route.ts - Pickup review
app/api/manager/shift-pickup-requests/route.ts
Employee tools
- Availability entry
app/employee/availability/page.tsx - Availability requests
app/api/availability-requests/route.ts - Employee schedule
app/employee/schedule/page.tsx - Available shifts
app/employee/available-shifts/page.tsx - Shift pickup requests
app/api/employee/shift-pickup-requests/route.ts
Application services
- Conflict checking
lib/availability-conflicts.ts - Database connection
lib/db.ts
Other components
- App administrator
- Restaurant manager
- Employee
- PostgreSQL
Connections 30
- App administrator → Restaurant dashboard: creates restaurants
- Restaurant dashboard → Restaurant administration: manages restaurants
- Restaurant dashboard → Manager approvals: approves managers
- Restaurant manager → Registration: registers account
- Employee → Registration: registers account
- Registration → Account registration: submits registration
- Account registration → Database connection: stores account
app/api/register/route.ts - Restaurant manager → Staff management: manages staff
- Staff management → Staff API: updates staff
- Restaurant manager → Schedule management: organizes schedule
- Schedule management → Shift management: manages shifts
- Shift management → Conflict checking: checks availability
app/api/manager/shifts/route.ts - Shift details → Conflict checking: checks availability
app/api/manager/shifts/[id]/route.ts - Auto scheduling → Conflict checking: checks availability
app/api/manager/auto-schedule/route.ts - Schedule management → Auto scheduling: generates schedules
- Employee → Availability entry: submits availability
- Availability entry → Availability requests: submits requests
- Restaurant manager → Availability review: reviews requests
- Employee → Employee schedule: views schedule
- Employee → Available shifts: accesses shifts
- Available shifts → Shift pickup requests: requests pickup
- Restaurant manager → Pickup review: reviews pickups
- Manager invitations → Database connection: stores invitation
app/api/manager/invitations/route.ts - Invitation acceptance → Database connection: accepts invitation
app/api/invitations/accept/route.ts - Authentication → Database connection: queries accounts
auth.ts - Shift management → Database connection: reads and writes shifts
app/api/manager/shifts/route.ts - Staff API → Database connection: reads and writes staff
app/api/manager/staff/route.ts - Availability requests → Database connection: reads and writes requests
app/api/availability-requests/route.ts - Conflict checking → Database connection: reads availability
lib/availability-conflicts.ts - Database connection → PostgreSQL: connects to