Bifrost, self-hosted tool to run notifications directly from your data warehouse
Tags: javascript, programming, opensource, go
Published: 2023-12-29 13:35:42

Check out more articles:

1. [Building a Scalable Notification System with gRPC and Microservices](https://dev.to/suprsend/building-a-scalable-notification-service-with-grpc-and-microservices-l6d)
2. [Adding a Notification Feed in React Websites](https://dev.to/suprsend/adding-a-notification-feed-in-react-websites-4oa0)
4. [A Complete Guide on Notification Infrastructure for Modern Applications in 2023](https://dev.to/suprsend/a-complete-guide-on-notification-infrastructure-for-modern-applications-in-2023-13b9)

---

Much like the mythical Bifrost bridge in the Marvel Universe, this tool acts as a conduit, ensuring a fast and secure journey for your data to reach the campaign workflows or [SuprSend](https://www.suprsend.com/). Let's explore how Bifrost empowers developers to run both manual and scheduled campaigns with ease.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmbb001fghbfiio5r4o9.png)


## Overview

[Bifrost](https://docs.suprsend.com/docs/bifrost) serves as a versatile tool for creating one-time or scheduled campaigns. It efficiently pulls data from your data store and transmits it to SuprSend, enabling effective communication with your audience. Here are some key features and use cases that Bifrost addresses:

### Use Cases

1. **Scheduled Tasks:** Bifrost allows for the execution and monitoring of scheduled tasks, such as daily, weekly, or periodic reminders.

2. **Manual Tasks:** It facilitates the running of manual tasks, including sending release notes and updates to specific user subsets.

### Dependencies

Bifrost, written in Go, can be deployed using the provided Docker image. Its only dependency is Redis. You have the flexibility to use a separate Redis instance or deploy one using the provided Docker Compose configuration. For streamlined deployment, the Docker Compose configuration supports automatic SSL certificate management via Caddy.

### Supported Databases

Bifrost currently supports the following databases:

- MySQL
- PostgreSQL
- BigQuery (Check [How to integrate BigQuery with Bifrost](https://docs.suprsend.com/docs/integrating-bigquery-with-bifrost))
- MongoDB (In development)
- Elasticsearch / Opensearch (In development)
- Redshift (In development)

## Getting Started with Deployment

To harness the power of Bifrost, follow these steps for a smooth deployment:

### 1. Decide Hostname and Redis Deployment

- Choose a hostname for hosting Bifrost (e.g., `bifrost.yourdomain.com`).
- Add an A record pointing to the IP where Bifrost will be deployed.

### 2. Generate OAuth Client Token and Secret

- Follow the documentation page for generating a Google OAuth client token and secret.
- Use the generated token and secret for Bifrost authentication.

### 3. Generate Config YAML File

- Create a `bifrost-config.yaml` file with your configuration settings, including workspace keys and secrets for SuprSend.

```yaml
bifrost:
  host: "https://bifrost.yourdomain.com"
  timezone: "Asia/Kolkata"
  google_clientKey: "__OAUTH_CLIENT_KEY__"
  google_clientSecret: "__OAUTH_CLIENT_SECRET__"
  suprsend:
    - name: staging
      key: "__staging_workspace_key__"
      secret: "__staging_workspace_secret__"
    - name: production
      key: "__production_workspace_key__"
      secret: "__production_workspace_secret__"
```

### 4. Configure Docker Compose File

- Create a Docker Compose file (`compose.yaml`) based on the provided reference.
- Ensure Redis container has permissions to write in the specified directory.

```yaml
services:
  redis:
    container_name: redis
    image: "bitnami/redis:latest"
    volumes:
      - ./redis-data:/bitnami/redis/data
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
  bifrost-server:
    container_name: bifrost-server
    restart: on-failure
    image: "ghcr.io/suprsend/bifrost:main"
    entrypoint: /bifrost-server
    depends_on:
      - redis
    volumes:
      - "./:/bifrost/"
  bifrost-worker:
    container_name: bifrost-worker
    restart: on-failure
    image: "ghcr.io/suprsend/bifrost:main"
    entrypoint: /bifrost-worker
    depends_on:
      - redis
    volumes:
      - "./:/bifrost/"
  caddy:
    container_name: caddy
    image: caddy:latest
    depends_on:
      - redis
      - bifrost-server
    ports:
      - "443:443"
      - "80:80"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
      - ./caddy:/data/caddy/pki
```

### 5. Start Bifrost Service


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oq0kynib5p7aho7f601t.png)


- Execute `docker-compose up -d` to start the Bifrost services.
- Wait for Caddy to generate SSL certificates.
- Visit `https://bifrost.yourdomain.com` to access the login page.

### 6. Shutdown Bifrost

- Execute `docker-compose down` to gracefully shut down Bifrost when needed.

---

> Try Now for free - [Bifrost](https://docs.suprsend.com/docs/bifrost)

---

**How SuprSend Notification Infrastructure Can Power Your Complete Stack?**

We can help you abstract your developmental layer without compromising quality and code. Our team is led by two experienced co-founders who have a combined experience of more than 20 years in building notification stacks for different early/mid-to-large-sized companies. We've been through the ups and downs, the sleepless nights, and the moments of triumph that come with creating a dependable notification infrastructure.

This is our amazing team, and we're here to make your journey unforgettable :)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ipzd4fjvafjy2izt7u8y.jpg)

Now let's see how SuprSend can benefit you:

1. **Multi-Channel Support:**
   - [Add multiple communication channels](https://www.suprsend.com/?utm_source=Dev.to&utm_medium=referral&utm_campaign=Dev.to_distribution&utm_id=A+Complete+Guide+on+Notification+Infrastructure+for+Modern+Applications+in+2023) (Email, SMS, Push, WhatsApp, Chat, App Inbox) with ease.
   - Seamless integration with various providers.
   - Flexible channel routing and management.

2. **Visual Template Editors:**
   - Powerful, user-friendly template editors for all channels.
   - Centralized template management.
   - Versioning support for templates, enabling rapid changes without code modification.

3. **Intelligent Workflows:**
   - [Efficient notification delivery](https://www.suprsend.com/products/smart-routing?utm_source=Dev.to&utm_medium=referral&utm_campaign=Dev.to_distribution&utm_id=A+Complete+Guide+on+Notification+Infrastructure+for+Modern+Applications+in+2023) through single triggers.
   - Configurable fallbacks, retries, and smart routing between channels.
   - Handle various notification types (Transactional, Crons, Delays, Broadcast) effortlessly.

4. **Enhanced User Experience:**
   - [Preference management](https://www.suprsend.com/products/preferences?utm_source=Dev.to&utm_medium=referral&utm_campaign=Dev.to_distribution&utm_id=A+Complete+Guide+on+Notification+Infrastructure+for+Modern+Applications+in+2023) for user control.
   - Multi-lingual content delivery.
   - Smart channel routing and batching to avoid message bombardment.
   - Frequency caps and duplicate prevention.

5. **Comprehensive Analytics and Logs:**
   - Real-time monitoring and logs for all channels.
   - Cross-channel analytics for message performance evaluation.
   - Receive real-time alerts for proactive troubleshooting.

6. **Developer-Friendly:**
   - Simplified API for triggering notifications on all channels.
   - SDKs available in major programming languages.
   - Comprehensive documentation for ease of integration.

7. **App Inbox:**
   - [Customizable inapp-inbox](https://www.suprsend.com/products/app-inbox?utm_source=Dev.to&utm_medium=referral&utm_campaign=Dev.to_distribution&utm_id=A+Complete+Guide+on+Notification+Infrastructure+for+Modern+Applications+in+2023) for your app and website.
   - Provides a convenient way to centralize and manage notifications for users.
   - Try our app-inbox playground here: [SuprSend_AppInbox_Playground](https://inbox-playground.suprsend.com/?utm_source=Dev.to&utm_medium=referral&utm_campaign=Dev.to_distribution&utm_id=A+Complete+Guide+on+Notification+Infrastructure+for+Modern+Applications+in+2023)

8. **Bifrost Integration:**
   - Run notifications natively on a data warehouse for enhanced data management.

9. **User-Centric Preferences:**
   - Allow users to set their notification preferences and opt-out if desired.

10. **Scalable and Time-Saving:**
    - Quickly deploy notifications within hours, saving development time.
    - Minimal effort is required to set up notifications. Get started in under 5 minutes.

11. **24*7 Customer Support:**
    - Our team is distributed around various time zones, ensuring someone is always up to cater to customer queries.
    - We also received the 'Best Customer Support' badge from G2 for our unwavering dedication. 

---


> Would appreciate if you can star us on Github - [Github](https://github.com/suprsend/suprsend-go)