Skip to content

Backend Integration

Backend Integration

The Auth Module is designed to work with a backend that supports the following features:

  • Token Storage: Saves the token sent by the client along with the user_id.
  • Notification Trigger: Calls the Expo-notification API to trigger the notification.

Internal Implementation

The Notification Module is designed to effectively integrate with various backend solutions, ensuring efficient and seamless communication for notification delivery. Here’s a more detailed explanation:

Provider-Specific Implementation

Each notification service provider (such as Expo, Firebase Cloud Messaging, or a custom notification API) offers its own set of built-in functions and methods for handling notification tasks. The Notification Module leverages these provider-specific features by:

  1. Utilizing Native SDKs: When available, the module uses the official SDKs or libraries provided by the notification service. This ensures that we’re using the most up-to-date and efficient methods for interacting with the backend.

  2. Adapting to Provider Strengths: Different providers may have unique strengths or specialized features. The module’s internal implementation is tailored to make the best use of these provider-specific capabilities.

REST API Integration

For custom REST API implementations, the Notification Module:

  1. Follows RESTful Principles: The module adheres to RESTful architecture principles when communicating with the backend API.

  2. Implements Custom Logic: Where necessary, custom logic is implemented to bridge any gaps between the standardized Notification Module interface and the specific requirements of the REST API.

Abstraction Layer

While the internal implementation relies on provider-specific or custom REST API functions, the Notification Module presents a consistent interface to the rest of the application. This abstraction layer:

  1. Provides Uniformity: Regardless of the underlying provider, the module exposes a uniform set of methods for notification tasks.

  2. Facilitates Flexibility: The abstraction allows for easier switching between different notification providers or APIs without requiring significant changes to the application code that uses the Notification Module.

By leveraging the inherent functions of each provider or API internally, the Notification Module achieves a balance between utilizing the full capabilities of the chosen backend solution and maintaining a consistent, easy-to-use interface for the rest of the application.