add readme
Deploy service message-delivery-method-web-push / service message-delivery-method-web-push (push) Has been cancelled
Deploy service message-delivery-method-web-push / service message-delivery-method-web-push (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,57 @@
|
|||||||
|
# Web Push Notification Service
|
||||||
|
This service delivers web push notifications for chat messages and QR code events in HereConnect. It listens for changes in CouchDB and sends push notifications to users.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
- Monitors CouchDB for new messages.
|
||||||
|
- Sends push notifications to owners and guests.
|
||||||
|
- Configurable notification settings.
|
||||||
|
- Health server for monitoring.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
- Node.js >= 14.x
|
||||||
|
- CouchDB server
|
||||||
|
- VAPID credentials
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
```bash
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running the Service
|
||||||
|
```bash
|
||||||
|
npm start
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
The service listens for changes in messages and sends notifications when a new message is created if the recipient has enabled push notifications.
|
||||||
|
|
||||||
|
## Notifications are sent for:
|
||||||
|
1. Messages from Guests: Sends to owners.
|
||||||
|
2. Messages from Owners: Sends to guests if enabled.
|
||||||
|
|
||||||
|
## Key Components
|
||||||
|
- CouchDBChangesStream: Listens to CouchDB changes.
|
||||||
|
- ServiceSeqTracker: Tracks sequence numbers to prevent missed messages.
|
||||||
|
- Web Push Notifications: Uses web-push library.
|
||||||
|
- Health Server: Monitors service status.
|
||||||
|
|
||||||
|
## Notifications
|
||||||
|
New messages: Sends a push notification with title, body, and link to the chat.
|
||||||
|
|
||||||
|
## Error Handling
|
||||||
|
Logs errors when sending notifications.
|
||||||
|
Tracks sequence to avoid missed messages.
|
||||||
|
|
||||||
|
## Graceful Shutdown
|
||||||
|
Handles SIGINT to stop CouchDB changes stream and clean up.
|
||||||
|
|
||||||
|
## Health Monitoring
|
||||||
|
Includes a health server for checking service status.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
https://web-push-book.gauntface.com/demos/notification-examples/
|
||||||
|
|
||||||
Reference in New Issue
Block a user