Skip to content

feat/central tagger, journey engine and notification dispatcher #98

@fulleni

Description

@fulleni

The Central Tagger & Data Hub

The backend API's role expands from a simple data provider to the central nervous system for user state.

  • Responsibility: To track and store user attributes and behaviors that are valuable for segmentation. This data will be stored directly in our own database.

The "Journey" Engine

This service becomes the heart of our automated engagement, replacing the concept of external "Journeys" or "Sequences."

  • Responsibility: To run scheduled jobs (e.g., cron jobs) that query our user database to identify segments and trigger notifications.
  • Enhancements:
    • Segmentation Logic: The service will contain the logic to build complex queries. For example: "Find all standardUsers who have followedTopicsCount > 3 but whose lastSeenAt is older than 14 days."
    • Payload Personalization: Upon identifying a user segment, the service can perform further lookups (e.g., fetch the names of their most followed topics) to create highly personalized notification payloads.
    • Dispatching: It will send the userId and the constructed PushNotificationPayload to a new, internal "Notification Dispatcher Service."

The Notification Dispatcher Service

This new internal service is the single point of contact for sending a notification.

  • Responsibility: To abstract away the push providers. It receives a userId and a PushNotificationPayload.
  • Logic:
    1. It queries the PushNotificationDevice collection for the given userId.
    2. It determines the correct provider (firebase or oneSignal) and retrieves the corresponding device token.
    3. It makes the final API call to the appropriate external provider (FCM or OneSignal) to deliver the message.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions