Ads, orders, CRM and ERP in one warehouse,
and an analyst you can message
For two sports nutrition brands (Thailand and Ukraine) we built a warehouse joining Meta, TikTok Shop, Shopify, LINE, GA4, CRM and a factory ERP for real cost of goods, with dashboards, competitor and distributor monitoring, and an AI analyst in Telegram that answers with SQL. 1,025 tests. 184 of 218 price-undercut events caught with zero false alarms.
The task
Two brands, two countries, data in a dozen places: ad platforms, a Shopify store, TikTok Shop, LINE, a CRM, GA4, a Telegram order channel and a factory ERP. The owner wanted one picture and the ability to ask a question and get a number.
What we built
Connectors with backfill. Meta Ads, TikTok Shop (3,638 orders from a 30-day backfill), Shopify, LINE OA, GA4, KeyCRM, PostHog, a Telegram order channel parsed by a user-bot (571 of 571 orders recovered), and the factory ERP as a read-only source of real cost of goods through recipes and raw-material prices. Catalogue reconciled across three sources: it showed 13 products being manufactured but missing from the storefront.
Marts and dashboards. Orders, spend, cohorts, products, bundles, margins with real COGS (raw-material margin by line, used to design sets). Market-basket analysis of 568 orders changed the bundle strategy.
Modules. Competitor intelligence with ten collectors (ads libraries, social, marketplaces, websites, traffic, search, trends, reviews) and a distributor monitor that caught 184 of 218 price-undercut events with zero false alarms. Customer segmentation into ten personas with SKU affinity, computed deterministically in SQL. An offer constructor with a financial gate on margin and a claims guard. A funnel architect with four deterministic gates and Mermaid export.
The AI analyst. A read-only database role, a guarded SQL layer (one SELECT, mart schema only, forced limits, timeouts), and a Telegram bot that answers “top three cities by revenue” with the query it ran. We audited our own guard and found eight bypasses, from quote tricks to system catalogue access, and closed them all before trusting it with live data.
Deployment. Separate services per brand on a VPS, systemd, Caddy for TLS, daily backups, 1,025 automated tests in the full run.
The result
The owner gets numbers in Telegram in seconds, the team gets alerts when a distributor undercuts, and the two brands finally share one definition of an order.