How tesspitch/nurse-shift works
This is a Thai nurse-shift and estimated-income LIFF app. The main user flow is entering settings and shifts, reviewing calendar/month history, and calculating an estimate; the remote path authenticates LINE users and persists versioned state through Supabase. Separate backend capabilities include configurable LINE reminders, a LINE bot/Rich Menu webhook, CSV/JSON transfer, and PDF summaries. Edges reflect excerpts, SOURCE INDEX references, or README claims; several UI and notification details are unsampled, so their links are shown only where documented or explicitly left unverified.
Main entry points: app.js LIFF web app · service.js Local and remote service · index.ts App API endpoint · app-api-actions.js API actions
Components 27
Shift planner
- LIFF web app
src/app.js - Calendar and shifts
src/app.js - Bulk shift planning
src/modules/shifts/application/bulk-shifts.js - Month history
src/modules/history/application/get-month-history.js - Local and remote service
src/service.js - History cache
src/infrastructure/history/cached-history-repository.js
Payroll domain
- Thai calendar dates
src/date.js - Income estimate
src/calculations.js - Shift time rules
supabase/functions/_shared/domain/shift-time.js - Payroll summary
supabase/functions/_shared/domain/payroll.js
Application API
- App API endpoint
supabase/functions/app-api/index.ts - HTTP responses
supabase/functions/_shared/http/app-api-http.js - API actions
supabase/functions/_shared/application/app-api-actions.js - State validation
supabase/functions/_shared/domain/user-state-validation.js - User state repository
supabase/functions/_shared/infrastructure/supabase/user-state-repository.js - History repository
supabase/functions/_shared/infrastructure/supabase/history-repository.js - History use case
supabase/functions/_shared/application/get-month-history.js
LINE notifications
- Notification rules
supabase/functions/_shared/infrastructure/supabase/notification-rule-repository.js - Schedule calculation
supabase/functions/_shared/notification-scheduling.js - Reminder function
supabase/functions/send-reminders/index.ts - Expiration notices
supabase/functions/_shared/expiration-notification.js - LINE delivery
supabase/functions/_shared/line-delivery.js - LINE webhook
supabase/functions/line-webhook/index.ts - LINE bot responses
supabase/functions/_shared/line-bot.js
Personal data tools
- CSV and JSON transfer
src/data-transfer.js
Other components
- Nurse
- LINE platform
Connections 30
- Nurse → LIFF web app: uses
README.md - LIFF web app → Calendar and shifts: renders
src/app.js - LIFF web app → Bulk shift planning: builds plan
src/app.js - Bulk shift planning → Shift time rules: checks overlap
src/modules/shifts/application/bulk-shifts.js - LIFF web app → Thai calendar dates: renders dates
src/app.js - LIFF web app → Income estimate: calculates
src/app.js - Income estimate → Shift time rules: uses time rules
src/calculations.js - Income estimate → Payroll summary: uses summary
src/calculations.js - LIFF web app → Local and remote service: loads and saves
src/app.js - Local and remote service → History cache: caches months
src/service.js - Local and remote service → Month history: requests history
src/service.js - Month history → History cache: loads months
src/modules/history/application/get-month-history.js - LIFF web app → CSV and JSON transfer: exports and imports
src/app.js - Nurse → LIFF web app: downloads PDF
README.md - Local and remote service → App API endpoint: posts actions
src/service.js - App API endpoint → HTTP responses: formats responses
supabase/functions/app-api/index.ts - App API endpoint → API actions: dispatches
supabase/functions/app-api/index.ts - App API endpoint → User state repository: loads and saves state
supabase/functions/app-api/index.ts - API actions → State validation: validates state
supabase/functions/_shared/application/app-api-actions.js - API actions → Notification rules: updates rules
supabase/functions/_shared/application/app-api-actions.js - API actions → History use case: requests history
supabase/functions/app-api/index.ts - History use case → History repository: reads month
supabase/functions/_shared/application/get-month-history.js - Reminder function → Schedule calculation: claims due jobs
supabase/functions/send-reminders/index.ts - Reminder function → Expiration notices: checks expiration
supabase/functions/send-reminders/index.ts - Reminder function → LINE delivery: sends notices
supabase/functions/send-reminders/index.ts - LINE delivery → LINE platform: pushes message
supabase/functions/_shared/line-delivery.js - Nurse → LINE platform: configures reminders
README.md - LINE platform → LINE webhook: posts events
README.md - LINE webhook → LINE bot responses: routes postbacks
supabase/functions/line-webhook/index.ts - LINE bot responses → LINE platform: replies
README.md