Platform Architecture Modules Developers Security Integrations Articles
Modules / Reporting & Aggregation
Production-Ready Specification

Reporting & Aggregation

High-performance analytical queries, export queues, and scheduled summaries.

The Reporting module offloads computationally heavy analytical queries to background workers and read replicas, providing streaming export generation without locking operational databases or timing out HTTP connections.

Capabilities

Core Functional Capabilities

Multi-tenant analytical aggregations and metrics queries
Streaming large datasets to CSV, XLSX, and formatted PDF without memory spikes
Asynchronous export queue with downloadable signed URLs upon completion
Scheduled report generation with automated email/Slack delivery
Read replica query routing to protect primary transactional database
Configurable date dimension aggregation (hourly, daily, weekly, monthly)

Contracts

Public Interface Contracts

Other modules and domain action classes interact exclusively via these typed PHP contracts.

interface ReportGeneratorInterface
interface ExportStreamerInterface
interface AnalyticsQueryBuilderInterface
interface ScheduledReportManagerInterface

Reactivity

Dispatched Domain Events

Dispatched upon state mutation for downstream audit recording, webhook firing, and asynchronous notifications.

ReportRequested
ExportCompleted
ScheduledReportDispatched

Customization

Extension Points

  • Custom chart and visualization renderers
  • Custom data warehouse push connectors (Snowflake, BigQuery, ClickHouse)

🛡 Security & Isolation

  • Mandatory tenant scoping injected into every analytical aggregate query
  • Strict column sanitization preventing SQL injection and formula injection in CSV/XLSX

Core Entities & Models

  • ReportDefinition (Tenant_id, name, query_config, schedule, recipients)
  • ExportJob (UUID, user_id, status, file_path, row_count, created_at)