Maverick Docs
Technical Reference

Architecture

Service topology, Celery queues, Docker services, and system diagrams

System Overview

Maverick is a lead-generation and client-management platform for insurance marketing. It processes contacts through a multi-stage pipeline: scraping, filtering, verification, batching, and upload to Email Bison campaigns.

graph TB
    Internet["Internet"]-->|HTTPS :443|Nginx["Nginx<br/>SSL Termination"]
    Nginx-->|:3000|Dashboard["Dashboard<br/>Next.js 14"]
    Nginx-->|:8000|API["API<br/>FastAPI + Uvicorn"]
    Nginx-->|:5555|Flower["Flower<br/>Task Monitor"]
    Nginx-->|:3003|Docs["Docs Site<br/>Fumadocs"]
 
    API-->Redis[("Redis<br/>Message Broker")]
    API-->Supabase[("Supabase<br/>PostgreSQL + Auth")]
 
    Redis-->W1["Scraping Worker<br/>Playwright Browser"]
    Redis-->W2["CSV Processing Worker"]
    Redis-->W3["Filtering Worker"]
    Redis-->W4["Verification Worker<br/>Debounce API"]
    Redis-->W5["Batching + Bison Worker"]
 
    W1-->|CSV files|W2
    W5-->Bison["Email Bison<br/>Campaign Platform"]
 
    API-->Pushgateway["Pushgateway"]-->Prometheus["Prometheus"]-->Grafana["Grafana"]

Docker Services

Production (docker-compose.production.yml)

ServiceContainerPortsDepends OnHealth Check
redismaverick-redis-prod127.0.0.1:6379:6379---Yes
apimaverick-api-prod127.0.0.1:8000:8000redisYes
celery-scrapingmaverick-celery-scraping-prod---redis, apiYes
celery-csvmaverick-celery-csv-prod---redis, apiYes
celery-filteringmaverick-celery-filtering-prod---redis, apiYes
celery-verificationmaverick-celery-verification-prod---redis, apiYes
celery-webhooksmaverick-celery-webhooks-prod---redis, apiYes
celery-batchingmaverick-celery-batching-prod---redis, apiYes
celery-syncmaverick-celery-sync-prod---redis, apiYes
celery-beatmaverick-celery-beat-prod---redis, apiYes
flowermaverick-flower-prod127.0.0.1:5555:5555redis, celery-filtering, celery-verification, celery-batchingYes
pushgatewaymaverick-pushgateway-prod127.0.0.1:9091:9091------
alertmanagermaverick-alertmanager-prod127.0.0.1:9093:9093---Yes
prometheusmaverick-prometheus-prod127.0.0.1:9090:9090api, pushgateway, alertmanagerYes
grafanamaverick-grafana-prod127.0.0.1:4000:3000prometheusYes
node-exportermaverick-node-exporter-prod---------
frontendmaverick-frontend-prod127.0.0.1:3000:3000apiYes
docsmaverick-docs-prod127.0.0.1:3003:3003---Yes
client-portalmaverick-client-portal-prod127.0.0.1:3004:3004---Yes
statusmaverick-status-prod127.0.0.1:3005:3005---Yes
nginxmaverick-nginx-prod80:80, 443:443api, frontend---
certbotmaverick-certbot---------

Worker Configuration (Production):

WorkerQueue(s)ConcurrencyMax Tasks/Child
celery-scrapingscraping225
celery-csvcsv_processing4100
celery-filteringfiltering2100
celery-verificationverification1500
celery-webhookswebhooks,email_bison,email_events4200
celery-batchingbatching,bison_uploads350
celery-syncsync_periodic250
celery-beatdefault1---
flowerdefault1---

Local (docker-compose.local.yml)

ServiceContainerPortsDepends OnHealth Check
redismaverick-redis-local6379:6379---Yes
apimaverick-api-local8000:8000redisYes
celery-scrapingmaverick-celery-scraping-local---redis, api---
celery-csvmaverick-celery-csv-local---redis, api---
celery-filteringmaverick-celery-filtering-local---redis, api---
celery-verificationmaverick-celery-verification-local---redis, api---
celery-batchingmaverick-celery-batching-local---redis, api---
celery-beatmaverick-celery-beat-local---redis, api---
flowermaverick-flower-local5555:5555redis---
pushgatewaymaverick-pushgateway-local9091:9091------
prometheusmaverick-prometheus-local9090:9090api, pushgatewayYes
grafanamaverick-grafana-local4000:3000prometheusYes
landingmaverick-landing-local3000:3000---Yes
dashboardmaverick-dashboard-local3001:3001apiYes
client-portalmaverick-client-portal-local3004:3004apiYes
docsmaverick-docs-local3003:3003---Yes
statusmaverick-status-local3005:3005------
node-exportermaverick-node-exporter-local---------

Worker Configuration (Local):

WorkerQueue(s)ConcurrencyMax Tasks/Child
celery-scrapingscraping110
celery-csvcsv_processing250
celery-filteringfiltering150
celery-verificationverification225
celery-batchingbatching,email_bison150
celery-beatdefault1---
flowerdefault1---

Celery Queue Architecture

Task Routing

Task PatternQueue
app.workers.tasks.scraping.*scraping
app.workers.tasks.processing.*csv_processing
app.workers.tasks.filtering.*filtering
app.workers.tasks.verification.*verification
app.workers.tasks.batching.*batching
app.workers.tasks.webhook_processing.*webhooks
webhook.*webhooks
sentiment.*webhooks
auto_reply.*webhooks
app.workers.tasks.email_bison_integration.*bison_uploads
email_bison.upload_batchbison_uploads
email_bison.generate_and_upload_batchesbison_uploads
email_bison.*sync_periodic
daily_metrics.*sync_periodic
infra_orders.*sync_periodic
daily_infra_reports.*sync_periodic
verification_maintenance.*sync_periodic
optionssync_periodic

Autodiscovered Task Modules

  • app.workers.tasks.scraping
  • app.workers.tasks.processing
  • app.workers.tasks.filtering
  • app.workers.tasks.verification
  • app.workers.tasks.batching
  • app.workers.tasks.email_bison_integration
  • app.workers.tasks.webhook_processing
  • app.workers.tasks.campaign_sync
  • app.workers.tasks.tag_burnt_accounts
  • app.workers.tasks.quarantine_burnt_accounts
  • app.workers.tasks.sentiment
  • app.workers.tasks.auto_reply
  • app.workers.tasks.daily_metrics
  • app.workers.tasks.infrastructure_orders
  • app.workers.tasks.hall_of_fame_backfill
  • app.workers.tasks.master_db_fill
  • app.workers.tasks.daily_infra_reports
  • app.workers.tasks.verification_maintenance
  • app.workers.tasks.task_notifications

Beat Schedule (Periodic Tasks)

NameTaskScheduleQueue
sync-bison-full-every-2hemail_bison.full_synccrontab(minute=0, hour='*/2')sync_periodic
sync-campaigns-hourlyemail_bison.sync_campaigns_allcrontab(minute=15)sync_periodic
classify-sentiment-hourlysentiment.classify_batchcrontab(minute=0)default
daily-client-metricsdaily_metrics.generate_daily_client_metricscrontab(hour=0, minute=5)sync_periodic
reset-api-counters-dailydaily_metrics.reset_daily_api_counterscrontab(hour=0, minute=1)sync_periodic
daily-revenue-snapshotdaily_metrics.generate_daily_revenue_snapshotcrontab(hour=0, minute=15)sync_periodic
reconcile-daily-revenue-snapshots-hourlydaily_metrics.reconcile_daily_revenue_snapshotscrontab(minute=30)default
cleanup-slack-notifications-weeklydaily_metrics.cleanup_old_slack_notificationscrontab(hour=3, minute=0, day_of_week=0)sync_periodic
refresh-pipeline-stats-cachedaily_metrics.refresh_pipeline_stats_cachecrontab(minute='*/5')sync_periodic
sync-daily-stats-every-30memail_bison.sync_daily_statscrontab(minute='*/30')sync_periodic
check-mx-records-dailydaily_metrics.check_mx_records_allcrontab(hour=3, minute=0)sync_periodic
reconcile-interested-leadsemail_bison.reconcile_interested_leadscrontab(minute=45, hour='*/4')sync_periodic
check-order-fulfillment-every-2hinfra_orders.check_fulfillment_allcrontab(minute=45, hour='*/2')sync_periodic
verify-order-warmup-every-4hinfra_orders.verify_warmup_allcrontab(minute=0, hour='*/4')sync_periodic
check-warmup-completion-dailyinfra_orders.check_warmup_completioncrontab(hour=6, minute=0)sync_periodic
track-ramp-progress-dailyinfra_orders.track_ramp_progresscrontab(hour=8, minute=0)sync_periodic
daily-infra-disconnected-reportdaily_infra_reports.send_disconnected_csvscrontab(hour=8, minute=5)sync_periodic
infra-launch-ready-alert-dailydaily_infra_reports.launch_ready_alertcrontab(hour=8, minute=10)sync_periodic
report-queue-depthsdaily_metrics.report_queue_depthscrontab(unknown)sync_periodic

Worker Defaults

SettingValue
task_soft_time_limit21600
task_time_limit28800
worker_prefetch_multiplier1
worker_max_tasks_per_child50

Contact Pipeline

The core business process: acquire contacts, clean them, and upload to campaigns.

graph LR
    XD["Xpressdocs<br/>X-Dates Platform"]-->|"Playwright<br/>scraping queue"|Raw[("raw_contacts")]
    Raw-->|"csv_processing queue"|Parsed["Parsed + Inserted"]
    Parsed-->|"filtering queue"|Filtered[("filtered_contacts")]
    Filtered-->|"verification queue<br/>Debounce API"|Verified[("verified_contacts")]
    Verified-->|"batching queue"|Batches[("contact_batches")]
    Batches-->|"email_bison queue"|Bison["Email Bison<br/>Campaigns"]

Each stage is a separate Celery queue with dedicated workers. Stages communicate via database tables (not direct task chaining), so any stage can be re-run independently.

Port Map

ServiceContainer PortHost PortEnvironment
API8000127.0.0.1:8000production
Dashboard3000127.0.0.1:3000production
Beta API8000127.0.0.1:8001beta
Beta Dashboard3001127.0.0.1:3002beta
Docs Site3003127.0.0.1:3003production
Redis6379127.0.0.1:6379shared
Flower5555127.0.0.1:5555production
Grafana3000127.0.0.1:4000production
Prometheus9090127.0.0.1:9090production
Pushgateway9091127.0.0.1:9091production

On this page