Architecture
Overview of the html.ai platform architecture and services.
System Overview
html.ai is a multi-tenant B2B platform providing AI-powered UI personalization with cross-site identity tracking and data sharing between partner businesses.
Complete data isolation with API key auth
Global UIDs for unified user profiles
AI-powered behavioral identity detection
Privacy-conscious partner data exchange
Services
The platform consists of 7 containerized services:
MongoDB
:27017Primary database with persistent storage
AI Backend
:3000FastAPI app with multi-agent AI system
Tracking Service
:3001Cross-site identity sync domain
SDK Server
:8080Nginx serving JavaScript SDK files
Dashboard
:8081Admin UI for analytics and config
Demo Store
:8082Example e-commerce integration
Marketing
:4000Next.js landing page and docs
Docker Setup
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
# With Gemini API key (for AI features)
GEMINI_API_KEY=your_key docker-compose up -dPort Reference
27017MongoDB3000API3001Tracking8080SDK8081Dashboard8082Demo4000MarketingDatabase
MongoDB collections for multi-tenant data storage:
businessesRegistered accounts with API credentials
eventsBehavioral events from user interactions
usersUser sessions per business
variantsContent variants shown with conversion tracking
global_usersCross-site identity mappings
data_sharing_agreementsPartner sharing configurations
See scripts/mongo-init.js for indexes and demo data setup.