Skip to main content

Aleteia Reports

Aleteia Reports is a Rails application that serves as a central hub for managing and automating editorial, marketing, and analytics processes for the Aleteia network. The application integrates multiple external services and provides APIs, scheduled jobs, and web interfaces to support the network's daily operations.

The application is built with Ruby on Rails 7.0 and a React/TypeScript frontend, using PostgreSQL as the database and Redis/Sidekiq for background jobs.


Macro Features​

Below are the main features currently in use on the platform.

Reports Author for Payments​

The system generates detailed reports on WordPress authors (AuthorReport), produced on demand from the admin panel as Excel exports. This feature provides comprehensive author management capabilities, including tracking author contributions, article counts, and related metrics needed for payment processing.

The WordPress author synchronization job (SyncWordpressAuthorsJob) runs hourly to keep author data up to date across all locales.

Dailymotion Report​

The application generates daily reports on the performance of video content published on Dailymotion. The DailyMotionExportJob runs every day at 1:00 AM (America/Los_Angeles timezone) and produces an export of video performance data.

The reports are used by the analytics team to monitor views, engagement, and monetization metrics for Aleteia network video content.

TikTok Report​

The TikTok integration allows generating daily reports on the performance of connected TikTok accounts. The system uses OAuth with LoginKit for authentication and automatically generates CSVs with view statistics.

Reports are uploaded to S3 for import into the big data system. Accounts must be re-authorized annually due to refresh token expiration.

📄 Documentation: TikTok Integration

SendGrid and Newsletter Subscriptions​

The system manages newsletter subscriptions through SendGrid, supporting multiple distribution lists organized by language and type. The integration includes:

  • Welcome Email: Automatic welcome email delivery to new daily newsletter subscribers
  • Extra and Special Lists: Advanced suppression group management for special and optional lists
  • Segmentation: Support for segments by locale (IT, EN, FR, ES, PT, PL, AR, SI)

The APIs allow reading and updating contact subscription status with deterministic subscribe/unsubscribe logic.

📄 Documentation: Welcome Email | Extra and Special Lists

Email Campaign Delivery API, Scheduler and Slack Notifications​

The application provides a complete system for planning and sending email campaigns. Campaigns can be scheduled for future delivery and the system sends Slack notifications upon delivery completion.

The API allows creation, modification, and scheduling of campaigns with support for dynamic templates and content personalization based on the recipient.

OneSignal Integration and Push Notifications Delivery​

The system exposes API wrappers for the OneSignal service, enabling push notification delivery to millions of users on web and mobile. The integration supports:

  • Creating notifications with title, message, link, and images
  • Targeting by language/locale
  • Retrieving notification delivery status
  • JWT authentication for API security

The OneSignalAppImportJob periodically synchronizes OneSignal app configuration.

📄 Documentation: OneSignal Push Notification API

WordPress Post Webhook​

When a post is published or updated on WordPress, the application receives a webhook that triggers a Facebook Open Graph re-scrape of the article url (FacebookScrapeJob).

Algolia search indexing used to run from the same webhook; it was removed after the backend cutover (#1106), since site search no longer reads our indices.

Donations Platform, Donors Profile Page and Reporting​

The donations platform is a central component of the application, built on Stripe for payment processing. It supports:

  • Single and recurring donations: One-time payments or monthly subscriptions
  • Multi-currency: EUR, USD, and other optional currencies (BRL, PLN, MXN, COP, ARS)
  • Payment methods: Credit cards, SEPA Direct Debit, Przelewy24, PayPal
  • Donor profile: Personal page to view donation history
  • Reporting: Daily reports on payments, abandoned sessions, and conversion metrics
  • Campaigns: Tracking donations by specific campaign

📄 Documentation: Stripe + Donation Platform Overview

Premium Subscription System​

The Premium subscription system integrates Stripe for payment processing with Firebase Authentication for user management and Firestore for premium status persistence. Key features include:

  • Automated User Provisioning: Creates Firebase Auth users automatically when subscriptions are created
  • Premium Status Management: Tracks premium status and plan tier in Firestore
  • Newsletter Auto-Subscription: Automatically subscribes new users to daily and Vatican newsletter segments
  • Multi-Language Support: All communications respect subscriber's locale preference
  • Email Notifications: Sends welcome and goodbye emails via SendGrid templates

📄 Documentation: Premium Integration Overview

One Shot Tasks for Batch Operations​

The application includes jobs for batch operations that run periodically or on demand. Examples include:

  • Slovenian Picture Reports: Monthly export of image data for the Slovenian editorial team (SlovenianArticleExportJob)
  • Monthly media export: Monthly CSV export of each edition's media library, read straight from WordPress (MonthlyPictureReportJob)
  • Clean Bounce Users: Periodic cleanup of users with invalid emails

These tasks automate operations that would otherwise require repetitive manual intervention.

Scheduled Reports in schedule.yml​

The application uses Sidekiq-Cron to schedule recurring jobs. The config/schedule.yml file defines all periodic jobs, including:

JobFrequencyDescription
SyncWordpressAuthorsJobHourlyWordPress author synchronization
OneSignalAppImportJobHourlyOneSignal app list synchronization
DailyMotionExportJobDailyDailymotion metrics export
Tiktok::UploadReportJobDailyTikTok report upload to S3
Donations::PaymentsReportJobDailyDonation payments report
MonthlyPictureReportJobMonthlyMedia library export per edition

📄 Documentation: Sidekiq-Cron Upgrade Guide

WordPress Copy Pictures (retired)​

Images used to be copied automatically between the WordPress editions, with a local ledger of master images and their copies that fed the yearly pictures report. The pipeline, the report and the ledger were all removed after the move to the Clever Cloud backend.

📄 Documentation: WordPress Media Copy Overview


Use the sidebar to explore detailed documentation for each feature.