01 / Data Pipeline
Full CRM sync with incremental updates
Clients, visits, services, and staff synchronized from the booking platform API. Incremental sync runs every minute (only changed records); full nightly rebuild. Shared rate limiter respects the API's 200 req/min cap. Pagination loop handles datasets beyond 200 records per page.
Incremental sync
Rate limiting
Pagination
Nightly rebuild
02 / Metrics Engine
15+ business metrics, refreshed on schedule
New clients (7d / 30d)
Trial conversion
Weekly / monthly active
Core clients 3+/mo
Early churn cohort
Inactive 60 / 180 days
PT first / repeat / churn
High LTV segmentation
Milestones: 10 / 25 / 50 / 100 / 200 / 500 visits
03 / Behavioral Segmentation
8 named segments, priority-deduplicated
A client appears in exactly one segment at a time — priority-based deduplication prevents double-targeting.
Regular Members 3+ visits per month
At Risk first signs of churn
Going Silent 2 months without visit
Nearly Lost 6 months without visit
Lost Clients no longer active
Trial Drop-offs visited once, never subscribed
PT Cancellations stopped personal training
VIP Members high lifetime value
04 / Campaign Engine
5 automated scenarios, per-segment cooldowns
Birthday
Fires on client's birthday. 29 Feb handled gracefully.
Milestone
Congratulates on 10 / 25 / 50 / 100 / 200 / 500th visit.
Reactivation
Mild nudge for early-churn and 60-day inactive clients.
Last Chance
Urgent tone for 120–180-day inactive clients.
PT Dropout
Personal tone for clients who stopped personal training.
05 / Two-Mode Delivery
Moderation or fully automated — switchable at runtime
Moderation mode
AI generates draft → Telegram preview card → operator approves or rejects per message before it reaches the client.
Notification mode
Fully automated. Drafts generated and sent without human review. Switchable from admin panel, no deploy needed.
06 / WhatsApp via Meta Cloud API
Full WABA integration, 5 languages
Complete WhatsApp Business API integration. Multi-language template support: cs · uk · ru · en · bg. Template variable substitution (name, days, visit count). Language-to-template validation at campaign creation time.
Meta WABA
5 languages
Template variables
Signature validation
07 / Message Queue
Persistent outbox with retry
Every outbound message goes through a persistent outbox table.
→ queued
→ sending
→ sent / failed / dead
Exponential backoff retry. Dead-letter after N failures — no silent drops.
08 / Telegram Moderation Bot
Per-message approval cards
Sends formatted approval cards: name, segment, message preview. Inline keyboard: Approve / Reject. Whitelist-based access control — fail-closed (unknown user = access denied). Separate Docker container.
Whitelist
Fail-closed
09 / Admin Dashboard
Multi-tab analytics panel
Summary metrics with tooltips · First Visits cohorts · Trial conversion funnel · Activity tabs with date range · Churned/inactive with visit history · Personal training metrics · Promo codes with status legend · Copy phone with toast.
10 / BI Platform
Metabase at dedicated subdomain
SQL-queryable access to all production data for non-technical stakeholders. No code required to build custom reports.
Production PostgreSQL
direct connection
Custom dashboards
no-code reports
Dedicated subdomain
traefik ssl
Separate Docker container
isolated service