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.
Docker Services
Production (docker-compose.production.yml)
| Service | Container | Ports | Depends On | Health Check |
|---|---|---|---|---|
| redis | maverick-redis-prod | 127.0.0.1:6379:6379 | --- | Yes |
| api | maverick-api-prod | 127.0.0.1:8000:8000 | redis | Yes |
| celery-scraping | maverick-celery-scraping-prod | --- | redis, api | Yes |
| celery-csv | maverick-celery-csv-prod | --- | redis, api | Yes |
| celery-filtering | maverick-celery-filtering-prod | --- | redis, api | Yes |
| celery-verification | maverick-celery-verification-prod | --- | redis, api | Yes |
| celery-webhooks | maverick-celery-webhooks-prod | --- | redis, api | Yes |
| celery-notifications | maverick-celery-notifications-prod | --- | redis, api | Yes |
| celery-batching | maverick-celery-batching-prod | --- | redis, api | Yes |
| celery-sync | maverick-celery-sync-prod | --- | redis, api | Yes |
| celery-sync-heavy | maverick-celery-sync-heavy-prod | --- | redis, api | Yes |
| celery-beat | maverick-celery-beat-prod | --- | redis, api | Yes |
| flower | maverick-flower-prod | 127.0.0.1:5555:5555 | redis, celery-filtering, celery-verification, celery-batching | Yes |
| pushgateway | maverick-pushgateway-prod | 127.0.0.1:9091:9091 | --- | --- |
| alertmanager | maverick-alertmanager-prod | 127.0.0.1:9093:9093 | --- | Yes |
| prometheus | maverick-prometheus-prod | 127.0.0.1:9090:9090 | api, pushgateway, alertmanager | Yes |
| grafana | maverick-grafana-prod | 127.0.0.1:4000:3000 | prometheus | Yes |
| node-exporter | maverick-node-exporter-prod | --- | --- | --- |
| frontend | maverick-frontend-prod | 127.0.0.1:3000:3000 | api | Yes |
| docs | maverick-docs-prod | 127.0.0.1:3003:3003 | --- | Yes |
| client-portal | maverick-client-portal-prod | 127.0.0.1:3004:3004 | --- | Yes |
| status | maverick-status-prod | 127.0.0.1:3005:3005 | --- | Yes |
| nginx | maverick-nginx-prod | 80:80, 443:443 | api, frontend | --- |
| certbot | maverick-certbot | --- | --- | --- |
Worker Configuration (Production):
| Worker | Queue(s) | Concurrency | Max Tasks/Child |
|---|---|---|---|
| celery-scraping | scraping | 3 | 25 |
| celery-csv | csv_processing | 4 | 100 |
| celery-filtering | filtering | 2 | 100 |
| celery-verification | verification | 1 | 500 |
| celery-webhooks | webhooks,email_bison | 4 | 200 |
| celery-notifications | notifications,email_events | 4 | 200 |
| celery-batching | batching,bison_uploads | 3 | 50 |
| celery-sync | sync_periodic | 3 | 50 |
| celery-sync-heavy | sync_heavy | 1 | 20 |
| celery-beat | default | 1 | --- |
| flower | default | 1 | --- |
Local (docker-compose.local.yml)
| Service | Container | Ports | Depends On | Health Check |
|---|---|---|---|---|
| redis | maverick-redis-local | 6379:6379 | --- | Yes |
| api | maverick-api-local | 8000:8000 | redis | Yes |
| celery-scraping | maverick-celery-scraping-local | --- | redis, api | --- |
| celery-csv | maverick-celery-csv-local | --- | redis, api | --- |
| celery-filtering | maverick-celery-filtering-local | --- | redis, api | --- |
| celery-verification | maverick-celery-verification-local | --- | redis, api | --- |
| celery-batching | maverick-celery-batching-local | --- | redis, api | --- |
| celery-beat | maverick-celery-beat-local | --- | redis, api | --- |
| flower | maverick-flower-local | 5555:5555 | redis | --- |
| pushgateway | maverick-pushgateway-local | 9091:9091 | --- | --- |
| prometheus | maverick-prometheus-local | 9090:9090 | api, pushgateway | Yes |
| grafana | maverick-grafana-local | 4000:3000 | prometheus | Yes |
| landing | maverick-landing-local | 3000:3000 | --- | Yes |
| dashboard | maverick-dashboard-local | 3001:3001 | api | Yes |
| client-portal | maverick-client-portal-local | 3004:3004 | api | Yes |
| docs | maverick-docs-local | 3003:3003 | --- | Yes |
| status | maverick-status-local | 3005:3005 | --- | --- |
| node-exporter | maverick-node-exporter-local | --- | --- | --- |
Worker Configuration (Local):
| Worker | Queue(s) | Concurrency | Max Tasks/Child |
|---|---|---|---|
| celery-scraping | scraping | 1 | 10 |
| celery-csv | csv_processing | 2 | 50 |
| celery-filtering | filtering | 1 | 50 |
| celery-verification | verification | 2 | 25 |
| celery-batching | batching,email_bison | 1 | 50 |
| celery-beat | default | 1 | --- |
| flower | default | 1 | --- |
Celery Queue Architecture
Task Routing
| Task Pattern | Queue |
|---|---|
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 |
webhook.process_lead_interested | notifications |
webhook.process_lead_replied | notifications |
webhook.process_email_bounced | notifications |
webhook.recover_interest_for_reply | notifications |
sentiment.* | notifications |
auto_reply.* | notifications |
app.workers.tasks.webhook_processing.* | webhooks |
webhook.* | webhooks |
app.workers.tasks.email_bison_integration.* | bison_uploads |
email_bison.upload_batch | bison_uploads |
email_bison.generate_and_upload_batches | bison_uploads |
audit.* | sync_heavy |
billing.* | sync_heavy |
email_bison.sync_now | email_bison |
email_bison.* | sync_periodic |
daily_metrics.* | sync_periodic |
infra_orders.* | sync_periodic |
daily_infra_reports.* | sync_periodic |
verification_maintenance.* | sync_periodic |
volume_tracking.* | sync_periodic |
reconcile_interested.* | sync_periodic |
options | sync_periodic |
Autodiscovered Task Modules
app.workers.tasks.scrapingapp.workers.tasks.processingapp.workers.tasks.filteringapp.workers.tasks.verificationapp.workers.tasks.batchingapp.workers.tasks.email_bison_integrationapp.workers.tasks.webhook_processingapp.workers.tasks.campaign_syncapp.workers.tasks.tag_burnt_accountsapp.workers.tasks.quarantine_burnt_accountsapp.workers.tasks.sentimentapp.workers.tasks.auto_replyapp.workers.tasks.daily_metricsapp.workers.tasks.infrastructure_ordersapp.workers.tasks.hall_of_fame_backfillapp.workers.tasks.master_db_fillapp.workers.tasks.daily_infra_reportsapp.workers.tasks.verification_maintenanceapp.workers.tasks.task_notificationsapp.workers.tasks.task_comment_notificationsapp.workers.tasks.task_slack_cleanupapp.workers.tasks.slack_inboundapp.workers.tasks.slack_event_dedupapp.workers.tasks.audit_discoverapp.workers.tasks.audit_ingest_repliesapp.workers.tasks.audit_ingest_sequence_stepsapp.workers.tasks.audit_ingest_sendersapp.workers.tasks.audit_attributeapp.workers.tasks.audit_aggregate_rankingsapp.workers.tasks.audit_generate_recommendationsapp.workers.tasks.audit_expire_recommendationsapp.workers.tasks.audit_render_briefingsapp.workers.tasks.audit_refreshapp.workers.tasks.volume_trackingapp.workers.tasks.account_stats_snapshotapp.workers.tasks.reconcile_interested_leadsapp.workers.tasks.billing_auditapp.workers.tasks.interested_signal_learner
Beat Schedule (Periodic Tasks)
| Name | Task | Schedule | Queue |
|---|---|---|---|
| interested-signal-learner-daily | interested.signal_learner | crontab(hour=4, minute=45) | sync_periodic |
| sync-campaigns-hourly | email_bison.sync_campaigns_all | crontab(minute=15) | sync_periodic |
| sync-accounts-every-4h | email_bison.sync_accounts_all | crontab(minute=25, hour='3,7,11,15,19,23') | sync_periodic |
| classify-sentiment-hourly | sentiment.classify_batch | crontab(minute=0) | default |
| audit-discover-campaigns-nightly | audit.discover_campaigns | crontab(hour=0, minute=0) | sync_heavy |
| audit-ingest-replies-nightly | audit.ingest_replies | crontab(hour=0, minute=15) | sync_heavy |
| audit-ingest-sequence-steps-nightly | audit.ingest_sequence_steps | crontab(hour=0, minute=30) | sync_heavy |
| audit-ingest-senders-nightly | audit.ingest_senders | crontab(hour=0, minute=45) | sync_heavy |
| audit-attribute-nightly | audit.attribute | crontab(hour=1, minute=0) | sync_heavy |
| audit-aggregate-rankings-nightly | audit.aggregate_rankings | crontab(hour=1, minute=30) | sync_heavy |
| audit-generate-recommendations-nightly | audit.generate_recommendations | crontab(hour=2, minute=0) | sync_heavy |
| audit-expire-recommendations-nightly | audit.expire_recommendations | crontab(hour=2, minute=15) | sync_heavy |
| audit-render-briefings-nightly | audit.render_briefings | crontab(hour=2, minute=30) | sync_heavy |
| billing-audit-daily | billing.audit_daily | crontab(hour=6, minute=0) | sync_heavy |
| billing-monthly-summary | billing.monthly_summary | crontab(hour=6, minute=30, day_of_month=1) | sync_heavy |
| daily-client-metrics | daily_metrics.generate_daily_client_metrics | crontab(hour=19, minute=5) | sync_periodic |
| reset-api-counters-daily | daily_metrics.reset_daily_api_counters | crontab(hour=0, minute=1) | sync_periodic |
| daily-revenue-snapshot | daily_metrics.generate_daily_revenue_snapshot | crontab(hour=0, minute=15) | sync_periodic |
| reconcile-daily-revenue-snapshots-hourly | daily_metrics.reconcile_daily_revenue_snapshots | crontab(minute=30) | default |
| cleanup-slack-notifications-weekly | daily_metrics.cleanup_old_slack_notifications | crontab(hour=3, minute=0, day_of_week=0) | sync_periodic |
| refresh-pipeline-stats-cache | daily_metrics.refresh_pipeline_stats_cache | crontab(minute=0) | sync_periodic |
| sync-daily-stats-hourly | email_bison.sync_daily_stats | crontab(minute=25) | sync_periodic |
| snapshot-account-daily-stats | email_bison.snapshot_account_daily_stats | crontab(hour=0, minute=10) | sync_periodic |
| check-order-fulfillment-every-2h | infra_orders.check_fulfillment_all | crontab(minute=45, hour='*/2') | sync_periodic |
| verify-order-warmup-every-4h | infra_orders.verify_warmup_all | crontab(minute=0, hour='*/4') | sync_periodic |
| check-warmup-completion-daily | infra_orders.check_warmup_completion | crontab(hour=6, minute=0) | sync_periodic |
| track-ramp-progress-daily | infra_orders.track_ramp_progress | crontab(hour=8, minute=0) | sync_periodic |
| daily-infra-disconnected-report | daily_infra_reports.send_disconnected_csvs | crontab(hour=8, minute=5) | sync_periodic |
| infra-launch-ready-alert-daily | daily_infra_reports.launch_ready_alert | crontab(hour=8, minute=10) | sync_periodic |
| poll-scheduled-volume-hourly | volume_tracking.poll_scheduled | crontab(minute=0) | sync_periodic |
| finalize-daily-volume | volume_tracking.finalize_daily | crontab(hour=0, minute=20) | sync_periodic |
| reconcile-finalize-volume-hourly | volume_tracking.reconcile_finalize | crontab(minute=50) | default |
| reconcile-interested-leads-hourly | reconcile_interested.from_bison | crontab(minute=35) | default |
| report-queue-depths | daily_metrics.report_queue_depths | crontab(unknown) | notifications |
| alert-failing-sync-tasks-every-30m | daily_metrics.alert_failing_sync_tasks | crontab(minute='*/30') | notifications |
| beat-heartbeat-every-minute | monitoring.beat_heartbeat | crontab(unknown) | notifications |
| purge-slack-event-dedup | slack_event_dedup.purge | crontab(unknown) | email_bison |
Worker Defaults
| Setting | Value |
|---|---|
task_soft_time_limit | 21600 |
task_time_limit | 28800 |
worker_prefetch_multiplier | 1 |
worker_max_tasks_per_child | 50 |
Contact Pipeline
The core business process: acquire contacts, clean them, and upload to 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
| Service | Container Port | Host Port | Environment |
|---|---|---|---|
| API | 8000 | 127.0.0.1:8000 | production |
| Dashboard | 3000 | 127.0.0.1:3000 | production |
| Beta API | 8000 | 127.0.0.1:8001 | beta |
| Beta Dashboard | 3001 | 127.0.0.1:3002 | beta |
| Docs Site | 3003 | 127.0.0.1:3003 | production |
| Redis | 6379 | 127.0.0.1:6379 | shared |
| Flower | 5555 | 127.0.0.1:5555 | production |
| Grafana | 3000 | 127.0.0.1:4000 | production |
| Prometheus | 9090 | 127.0.0.1:9090 | production |
| Pushgateway | 9091 | 127.0.0.1:9091 | production |