Overview
Home Manager includes a notification system that keeps all household members informed about important activities and changes. Notifications are displayed in a centralized activity feed accessible from the navigation bar.Accessing Notifications
Notification Bell Icon
The notification bell is located in the top-right corner of the navigation bar:- Look for the bell icon (🔔) in the navbar
- A red badge shows the number of unread notifications
- Click the bell icon to open the notifications modal
The notification count updates automatically when you navigate to different pages in the app.
Notification Modal
When you click the notification bell, a modal window opens displaying:- All notifications for your household
- Grouped by notification type
- Ordered by creation date (most recent first)
- Unread notifications marked with an “Unread” badge
Notification Types
Notifications are categorized by type to help you quickly identify the kind of activity:Common Notification Categories
- Bills: New bills added, bills marked as paid, upcoming due dates
- Chores: New chores created, chores completed, overdue chores
- Shopping: Items added to shopping list, items marked as purchased
- Maintenance: New maintenance tasks, tasks completed, scheduled maintenance
- Household: New members invited, role changes, member activity
Notifications are grouped by type in the modal for easier navigation. Each group displays all related notifications together.
Notification Structure
Each notification contains:- Title: Brief summary of the activity
- Body: Detailed description or context
- Type: Category of the notification
- Timestamp: When the notification was created
- Read Status: Whether you’ve viewed the notification
Managing Notifications
Viewing a Notification
To view notification details:- Open the notifications modal by clicking the bell icon
- Browse through the notification list
- Hover over a notification to highlight it
- Click on any notification to dismiss it
Clicking on a notification removes it from your notification list. This helps keep your feed clean and focused on new activity.
Dismissing Individual Notifications
To remove a single notification:- Open the notifications modal
- Click on the notification you want to dismiss
- The notification is immediately deleted
- The unread count updates automatically
Mark All as Read
To clear all notifications at once:- Open the notifications modal
- Scroll to the bottom of the modal
- Click the Mark All as Read button
- All notifications are marked as read
- The modal closes automatically
Empty Notification State
When you have no notifications:- The modal displays: “No notifications yet.”
- The notification badge disappears from the bell icon
- This indicates you’re up-to-date with all household activity
Notification Behavior
Real-Time Updates
Notifications update in real-time:- New notifications appear when household activity occurs
- The unread count updates automatically
- Opening the modal refreshes the notification list
Persistence
Notifications persist across sessions:- Your notifications remain available after logging out
- Notifications are tied to your household, not your session
- All household members see notifications relevant to shared activities
Household-Wide Notifications
Notifications are shared across the household:- All members see the same household notifications
- No role-based filtering (owners, members, and guests see all notifications)
- This keeps everyone informed about household activities
Notifications are stored per household, not per user. All members of a household receive the same notifications.
API Endpoints
Fetching Notifications
Notifications are retrieved from:- Array of notification objects
- Ordered by creation date (descending)
- Filtered by your household ID
src/app/api/notifications/route.ts:20
Deleting a Notification
Remove a single notification:- Removes the notification from the database
- Updates the unread count
Clearing All Notifications
Mark all notifications as read:- Marks all household notifications as read
- Resets the unread count to zero
Creating Notifications
Notifications are automatically created by the system when significant events occur. The notification creation function is defined insrc/app/lib/notifications.ts:13.
Notification Creation Parameters
Example Use Cases
Notifications might be created for:- New bill added: “Electric Bill added” / “Due on Jan 15, $120.00”
- Chore completed: “Kitchen Cleaning completed” / “Completed by John”
- Member joined: “New member joined” / “Sarah accepted invitation”
- Role changed: “Role updated” / “Mike promoted to Owner”
Developers can trigger notifications using the
createNotification() function from the notifications library.Notification Settings
Current Behavior
Currently, all notifications are:- Enabled by default
- Shown to all household members
- Not customizable per user
Future Enhancements
Potential notification features that could be added:- Email notifications
- Push notifications (PWA support)
- Notification preferences per user
- Notification muting or filtering
- Custom notification triggers
Troubleshooting
Notifications Not Appearing
Check:- You’re a member of an active household
- Your household has recent activity
- You’ve refreshed the page or reopened the modal
- Try clicking the notification bell to refresh
- Navigate to another page and back to trigger a refresh
- Check the browser console for any error messages
Unread Count Not Updating
Cause:- The count is calculated based on the
readfield in the database - Marking notifications as read updates this field
- Click “Mark All as Read” to reset the counter
- Dismiss individual notifications to reduce the count
- Refresh the page to recalculate the count
Modal Not Opening
Troubleshooting Steps:- Ensure you’re signed in
- Check that JavaScript is enabled in your browser
- Try refreshing the page
- Clear your browser cache if issues persist
Best Practices
Keeping Your Feed Clean
- Regularly dismiss notifications you’ve acted on
- Use “Mark All as Read” periodically to clear old notifications
- Check notifications daily to stay updated on household activities
Notification Etiquette
- Respond to important notifications promptly
- Use notifications as a communication tool with household members
- Don’t ignore overdue or urgent notifications
Performance
- The notification system fetches data on demand
- Opening the modal triggers a fresh data fetch
- This ensures you always see the latest notifications
Notifications are fetched when the navbar loads and again when you open the modal. This balances performance with real-time updates.
Technical Details
Data Model
Notifications include these fields:Frontend Implementation
The notification modal is implemented in:- Component:
src/components/modals/NotificationsModal.tsx - Navbar Integration:
src/components/layout/Navbar.tsx:86 - API Integration:
src/app/api/notifications/route.ts
State Management
Notification state is managed:- Locally within the
NotificationsModalcomponent - Unread count tracked in the
Navbarcomponent - Fetched on-demand when needed