Architecture Reference · System Diagrams

Glam Color Studio

Complete Architecture Maps, Data Flow Diagrams & Integration Schemas

Diagram 01
Full System Architecture Overview
Diagram 02
WhatsApp Bot Dual-Track Flow
Diagram 03
Litzo → Make → Supabase Pipeline
Diagram 04
Birthday Campaign Engine
Diagram 05
Database Schema (4 Tables)
Diagram 06
Deployment Architecture Map

Full System Architecture Overview

Seven-layer ecosystem connecting client touchpoints through AI intelligence, automated pipelines, and edge-deployed delivery infrastructure. Each layer feeds contextual data downstream, enabling fully automated end-to-end client journeys.

Client Layer
Entry Points
Intelligence Layer
Data Layer
Delivery Layer
CLIENTLAYER ENTRYPOINTS AI /INTELLAYER DATALAYER DELIVERYLAYER New Client First-time visitor Returning Client CRM-recognized Web Visitor Website / chat bot WhatsApp Meta Business API Inbound/Outbound messaging Web Chat Bot 18 services trained Claude Haiku powered Marketing Site Cloudflare Pages Premium brand presence Claude Haiku API Anthropic — AI Engine Conversational intelligence core Make (Integromat) Automation Middleware Pipeline orchestration layer Python Engine Pillow Library Birthday image personalization Supabase PostgreSQL CRM 1,404+ client records Litzo ERP Source of Truth Client module (read-only) Google Drive Pipeline Buffer Excel export staging area WA Business API Outbound messaging Pending Meta approval Cloudflare Pages Website + CRM UI Edge — zero overhead Railway.app Bot Server + Scraper Node.js runtime Make Cloud Automation triggers Event-driven flows GLAM COLOR STUDIO — FULL SYSTEM ARCHITECTURE
7-layer architecture: Client Layer → Entry Points → AI Intelligence → Data Layer → Delivery Infrastructure

WhatsApp Bot — Dual-Track Conversational Flow

The bot branches at the CRM lookup step: unrecognized numbers enter the new client acquisition track, while recognized numbers receive a personalized returning-client experience with visit history surfaced automatically. Both tracks converge at the photo request before escalating to a human stylist.

Incoming WhatsApp Message Client sends first message CRM Lookup — Supabase Phone number match query KNOWN? NO → NEW CLIENT Warm welcome greeting Service Inquiry What brings you today? Chemical History If color service only ← YES RETURNING CLIENT Hi [Name]! Welcome back 🌸 Show Visit History Last service · date · stylist Confirm Intent Same service or something new? Photo Request Back-of-head photo + reference inspiration image → Human Stylist Handoff WHATSAPP BOT — DUAL-TRACK CONVERSATIONAL FLOW
Both tracks (new vs. returning client) converge at the photo request step before escalating to a human stylist advisor

Litzo → Make → Supabase Data Pipeline

Due to Litzo API access restrictions (client module only, no admin panel), two parallel ingestion paths were engineered: a Make-driven Excel pipeline for structured batch sync, and a Puppeteer-based scraper for automated continuous extraction direct to Supabase.

LITZO ERP Client Module Read-Only Access Export Excel File Manual export or cron-triggered Upload Google Drive Auto-watch folder New file trigger Parse Make Row iteration Upsert logic Supabase PostgreSQL CRM 1,404+ records ⚠ ACCESS CONSTRAINT Litzo: Client Module only No Admin · No API · No webhooks ALTERNATIVE: Puppeteer Scraper Node.js headless browser automation Cron: every 6h → writes direct to Supabase Puppeteer Direct Path (fully automated, no manual export) LITZO → MAKE → SUPABASE DATA PIPELINE
Primary path: Litzo → Excel Export → Google Drive → Make → Supabase · Alternative: Puppeteer scraper → direct Supabase upsert

Birthday Campaign Automation Engine

839 clients with confirmed birthdays are targeted daily through an automated pipeline — no manual intervention at any stage. Python Pillow dynamically composites each client's name onto a brand-designed Canva template using the Antonio Bold font, producing individualized high-resolution images at zero marginal cost per unit.

Daily Cron Runs at 8:00 AM Railway scheduler Supabase Query 839 birthday records PostgreSQL lookup Filter: Today's Birthdays birthday_date = TODAY() Dynamic daily filter Python Pillow Canva PNG template Blank — no embedded name Name Injection Antonio Bold font Dynamic coordinates per template layout WA API Send Media 839 personalized images · Zero marginal cost per unit · Fully automated · No manual intervention BIRTHDAY CAMPAIGN AUTOMATION ENGINE
End-to-end automation: daily cron → Supabase query → Python Pillow image composition → WhatsApp API delivery

Supabase Database Schema

Four interconnected tables form the CRM backbone, all linked via UUID foreign keys with full relational integrity enforced at the PostgreSQL layer. The clients table was seeded with 1,404 real records migrated from the Litzo Excel export.

clients 1,404+ records iduuid PK nametext phonetext UNIQUE whatsapptext emailtext birthdaydate statustext visit_countint last_visittimestamptz sourcetext created_attimestamptz updated_attimestamptz appointments iduuid PK client_iduuid FK → clients servicetext date_timetimestamptz stylist_nametext statustext notestext sourcetext created_attimestamptz cancelled_attimestamptz service_history iduuid PK client_iduuid FK → clients servicetext stylisttext amountnumeric notestext service_datedate created_attimestamptz product_linetext (Wella) campaign_log id: uuid PK client_id: uuid FK→clients campaign_type: text sent_at: timestamptz status: text (sent/failed) channel: text (wa/email) 1 : N 1 : N 1 : N SUPABASE POSTGRESQL DATABASE SCHEMA
4 tables · UUID primary keys · Foreign key relationships: clients (1) → appointments, service_history, campaign_log (N)

Deployment Architecture Map

All production assets are deployed across four cloud platforms selected for their optimized operational margins, high-availability SLAs, and zero-infrastructure-overhead cost structures — eliminating traditional server management entirely.

Cloudflare Pages Marketing Website CRM Dashboard Bot Demo HTML Edge delivery worldwide Zero-infrastructure overhead ZIP deploy · index.html at root base64 embedded assets Railway.app WhatsApp Bot Server Node.js + Express Litzo Scraper (cron) Container runtime Cost-efficient serverless Status: Ready — pending Meta API ENV vars configured Supabase Cloud PostgreSQL Database 1,404+ Client Records Real-time REST API Managed PostgreSQL High-throughput serverless Schema deployed + seeded 4 tables · UUID keys Make.com Excel Pipeline Birthday Triggers Follow-up Flows Event-driven cloud Optimized margins Architecture ready Pending activation Meta WhatsApp Business API Inbound + outbound messaging layer · Status: Pending API approval + credentials INFRASTRUCTURE COST MODEL: Zero-overhead edge hosting · Optimized serverless compute · High-throughput managed DB · Event-driven automation
4 cloud platforms · All assets deployed · WhatsApp API pending Meta approval · Zero traditional server infrastructure