Production · Xentraffic · Montreal, Canada · Jan 2026 → Present
AI-Driven ERP
for Affiliate Marketing.
Xentraffic runs a CPA affiliate network out of Montreal. When I joined, 5 platforms were running in parallel with no shared data layer — every weekly report was 8 hours of manual work. I built the system that changed that.
The Problem
Five platforms. Zero shared data. Eight hours lost every week.
Xentraffic was running its affiliate operations across five completely disconnected platforms: Everflow for affiliate tracking, ClickUp for task management, and BuyGoods, Digistore24, and ClickBank for product catalogs and sales data.
Every Monday, someone spent 8 hours manually pulling data from each source, consolidating it in spreadsheets, and building a report that was already out of date by the time it was finished.
Fraud detection was nonexistent. High-risk affiliates were generating fake traffic and fraudulent conversions with no automated signal to catch them. By the time the pattern was visible, commissions had already been paid.
Everflow
Affiliate tracking, clicks, conversions, payouts
ClickUp
Tasks, documents, team operations
BuyGoods
Product catalog + sales (CSV-only API)
Digistore24
European product catalog + analytics
ClickBank
Affiliate marketplace + revenue data
Architecture
AI doesn't work in one layer. It works in three.
Most teams think "adding AI" means adding a chatbot. The real leverage is in stacking all three layers — each one building on the one below it.
Embedded Intelligence
The system calculates, automatically.
Operational Automation
The system acts, without human input.
Conversational AI
The system speaks your business language.
What I Built
Six systems, one unified platform.
Text-to-SQL Query Engine
Layer 3Any team member types a question in plain English — the engine generates safe, read-only SQL, runs it against 51 live tables, and returns a formatted answer. Built a multi-provider LLM gateway (Claude, OpenAI, Gemini, Groq) with semantic caching, rate limiting, and full observability.
Fraud Detection Pipeline
Layer 2 + 3Runs hourly via n8n on live Everflow data. Detects CR spikes, duplicate click floods, dead sub1 sources, and bot traffic patterns. High-risk affiliates are auto-suspended via the Everflow API. Medium-risk → Telegram alert with one-tap approve/suspend. High-risk → auto-action, no human needed.
Affiliate Intelligence
Layer 1Automatic Gold/Silver/Bronze tiering based on lifetime revenue. Reliability score calculated daily from conversion rate, revenue, and issue history (refunds, disputes). Smart Match recommends offers an affiliate isn't promoting yet but that match their top-performing categories.
Multi-Platform CRM
Layer 1Synchronized product catalogs from ClickBank, Digistore24, and BuyGoods (including a custom CSV import pipeline with 7-step codename resolution for BuyGoods, which has no usable public API). Visual Flow Builder for sales funnels with drag-and-drop upsell/downsell design.
Daily AI Report to Slack
Layer 2 + 3Every morning at 9:00 AM, an n8n workflow pulls Everflow stats, affiliate data, and product analytics — sends them to an LLM — and posts a structured business brief to Slack. 365 reports a year, zero human effort.
Observability Stack
InfrastructurePrometheus + Grafana for API and infrastructure metrics. AI-specific observability in MySQL via ObservabilityService — tracks cost per request, latency, cache hit rate, token usage, and error rate for every LLM call. PM2 + Nginx + GitHub Actions CI/CD in production.
Stack
Every choice was deliberate.
Frontend
Backend
AI / LLM
Automation
Integrations
Observability
What Was Actually Hard
The problems nobody talks about.
Problem
BuyGoods has no usable API
How I solved it
Built a 7-step CSV/XLS importer with auto-format detection, column mapping, and a codename catalog to resolve product identifiers that differ between export formats. Handles edge cases where BuyGoods changes their column headers between exports.
Problem
ClickBank API blocks Algerian DNS
How I solved it
Monkey-patched Node.js dns.lookup to fall back to DNS-over-HTTPS via Cloudflare when direct resolution fails for clickbank.com domains. Results are cached to avoid repeated DoH calls. This is the kind of problem that costs 2 days if you don't know what's happening.
Problem
Text-to-SQL safety on a production database
How I solved it
Built SQLValidator that blocks every destructive operation (INSERT, UPDATE, DELETE, DROP, ALTER, TRUNCATE) before execution. The AI agent is strictly read-only. Combined with rate limiting (10 req/min per user) and a complete audit log in ai_query_logs.
Problem
Fraud detection that acts before the commission window closes
How I solved it
Most fraud tools flag after the fact. Built an hourly n8n pipeline that checks live Everflow traffic, runs ML scoring, and auto-suspends high-risk affiliates via the Everflow API — before the daily validation cycle processes payouts.
Results
Numbers that matter.
The ERP went from idea to production in 4 months, running on a DigitalOcean Droplet with PM2 + Nginx + GitHub Actions CI/CD. The team went from spending an entire Monday on reporting to getting an AI-generated brief in Slack every morning at 9 AM.