Comprehensive notification system has been implemented with both global settings and per-payment notification options.
The Settings page has been completely reorganized with clear sections:
-
Browser Notifications
- Enable/Disable toggle
- Permission request button
- Status indicator
-
Days Before Due (Configurable)
- Slider control (1-30 days)
- Visual display of selected days
- Default: 3 days before due date
-
Escalated Notifications (Toggle)
- Checkbox to enable/disable
- Clear explanation of escalation schedule:
- X days before: Once
- 1 day before: Twice daily
- Due date: Every 6 hours
- Overdue: Every 12 hours
-
Email Notifications (Prepared for future)
- Toggle for email notifications
- Email address input field
- Warning note about backend requirement
- Settings saved to localStorage
- Moved from inline to dedicated section
- All category CRUD operations
- Clear all data functionality
- Warning confirmation
Both Add Payment and Edit Payment forms now include:
-
Notify Another Person (Checkbox)
- When enabled, shows additional fields:
- Email Address input
- Mobile Number input (for SMS)
- Notification triggers:
- ✓ Notify when payment is due
- ✓ Notify when payment status changes
- When enabled, shows additional fields:
-
Data Storage
- All notification preferences saved with payment
- Fields:
notifyOthers,notificationEmail,notificationMobile,notifyOnDue,notifyOnStatusChange
- Global notification settings stored in
localStorage - Per-payment notification settings stored in IndexedDB with payment data
- Settings survive page refresh and app restart
{
enabled: boolean,
daysBeforeDue: number (1-30),
enableEscalation: boolean,
emailNotifications: boolean,
userEmail: string
}Added fields:
{
// ... existing fields
notifyOthers: boolean,
notificationEmail: string,
notificationMobile: string,
notifyOnDue: boolean,
notifyOnStatusChange: boolean
}- User enables notifications in Settings
- User sets days before due (e.g., 3 days)
- User optionally enables escalation
- NotificationService checks payments hourly
- Sends browser notifications based on settings
The UI is ready for email and SMS notifications. To implement:
-
Backend Service Required:
- API endpoint to send emails (e.g., SendGrid, AWS SES)
- API endpoint to send SMS (e.g., Twilio)
-
Integration Points:
- Global email:
notificationSettings.userEmail - Per-payment email:
payment.notificationEmail - Per-payment mobile:
payment.notificationMobile
- Global email:
-
Trigger Events:
- Payment due (based on
daysBeforeDuesetting) - Status change (if
notifyOnStatusChangeenabled) - Escalation schedule (if
enableEscalationenabled)
- Payment due (based on
-
Visual Organization
- Icon-based section headers (Bell, Palette, Trash)
- Clear visual hierarchy
- Grouped related settings
-
Interactive Controls
- Range slider for days selection with live preview
- Toggle switches for enable/disable
- Collapsible sections for notification details
-
User Guidance
- Descriptive labels and placeholders
- Inline explanations of escalation schedule
- Warning notes for features requiring backend
-
Responsive Design
- Mobile-first approach maintained
- Touch-friendly controls
- Proper spacing and padding
/src/pages/Settings.jsx- Complete rewrite with organized sections/src/pages/AddPayment.jsx- Added notification settings section/src/pages/EditPayment.jsx- Added notification settings section
- Settings page reorganized into 3 main sections
- Added notification configuration UI
- Added per-payment notification fields
- Implemented localStorage persistence for global settings
- Updated payment schema to include notification fields
-
Configure Global Settings:
- Go to Settings page
- Enable browser notifications
- Set how many days before due you want to be notified
- Enable escalated notifications if desired
- (Optional) Add your email for future email notifications
-
Configure Per-Payment Notifications:
- When adding/editing a payment
- Scroll to "Notification Settings" section
- Check "Notify another person" if needed
- Enter email and/or mobile number
- Choose when to notify (due date, status change)
To enable email/SMS notifications:
- Set up backend service (Node.js/Express recommended)
- Integrate email provider (SendGrid, AWS SES, etc.)
- Integrate SMS provider (Twilio, AWS SNS, etc.)
- Update NotificationService to call backend APIs
- Remove warning notes from UI
- Email and SMS notifications are UI-ready but require backend implementation
- Browser notifications work immediately after user grants permission
- All settings are stored locally (localStorage + IndexedDB)
- No data is sent to external servers currently
- The app remains fully functional offline
- Implement backend service for email/SMS
- Add notification history/log
- Add custom notification sounds
- Add notification templates
- Add notification preview/test feature
- Add notification scheduling options
- Add notification grouping/batching