| name | clari-reference-architecture |
| description | Reference architecture for Clari revenue intelligence integrations.
Use when designing a forecast data platform, planning Clari integration
architecture, or establishing team patterns for revenue analytics.
Trigger with phrases like "clari architecture", "clari data platform",
"clari integration design", "clari best practices".
|
| allowed-tools | Read, Write, Edit, Grep |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","revenue-intelligence","forecasting","clari"] |
| compatibility | Designed for Claude Code |
Clari Reference Architecture
Overview
Production architecture for Clari revenue intelligence integrations: export pipeline design, data warehouse schema, analytics layer, and alerting.
Architecture Diagram
┌──────────────┐ ┌─────────────────┐ ┌──────────────────┐
│ Clari App │ │ Clari Export │ │ Data Warehouse │
│ (SaaS) │────▶│ API (v4) │────▶│ (Snowflake/BQ) │
└──────────────┘ └─────────────────┘ └────────┬─────────┘
│
┌─────────────────┐ ┌────────▼─────────┐
│ Change │ │ Analytics / │
│ Detection │────▶│ Dashboard │
└─────────────────┘ │ (Looker/Metabase)│
│ └──────────────────┘
┌──────▼──────────┐
│ Alerts │
│ (Slack/Email) │
└─────────────────┘
Project Structure
clari-data-platform/
├── src/
│ ├── clari_client.py # API client wrapper
│ ├── export_pipeline.py # ETL pipeline
│ ├── change_detector.py # Forecast change tracking
│ ├── models.py # Data models
│ └── config.py # Environment config
├── dags/
│ └── clari_export_dag.py # Airflow DAG
├── sql/
│ ├── schema.sql # Warehouse table definitions
│ ├── merge.sql # Upsert logic
│ └── analytics/
│ ├── forecast_accuracy.sql
│ ├── pipeline_coverage.sql
│ └── rep_performance.sql
├── tests/
│ ├── fixtures/ # Sample API responses
│ ├── test_pipeline.py
│ └── test_change_detector.py
├── scripts/
│ ├── run_export.sh
│ └── validate_schema.py
└── monitoring/
├── alerts.yaml # Alert rules
└── dashboard.json # Grafana/Looker config
Data Warehouse Schema
CREATE TABLE clari_forecasts (
id BIGINT GENERATED ALWAYS AS IDENTITY,
owner_name VARCHAR NOT NULL,
owner_email VARCHAR NOT NULL,
forecast_amount DECIMAL(15,2),
quota_amount DECIMAL(15,2),
crm_total DECIMAL(,),
crm_closed (,),
adjustment_amount (,),
time_period ,
forecast_name ,
exported_at ,
(owner_email, time_period, forecast_name, exported_at)
);
clari_forecast_changes (
id GENERATED ALWAYS ,
owner_email ,
time_period ,
previous_amount (,),
current_amount (,),
change_pct (,),
detected_at
);
v_forecast_accuracy
time_period,
owner_name,
forecast_amount,
crm_closed actual_closed,
ROUND(( (forecast_amount crm_closed) (forecast_amount, )) , ) accuracy_pct
clari_forecasts
exported_at ( (exported_at) clari_forecasts f2 f2.time_period clari_forecasts.time_period);