Technical Case Study

Inside the Pixy Digital architecture.

Pixy Digital is an AI image generation platform with a critical distinction: before it creates any visual, it scrapes the client's website and social profiles to extract brand DNA, including colors, typography, logos, and visual style. Generation uses that context, not just a prompt. SYZO owned design, development, worker architecture, and deployment end-to-end.

This page is based on the Pixy application repository and the two connected Cloudflare worker repositories: one for brand scraping, one for starter-image generation.

Pixy Digital hero screen for AI on-brand image generation

Who created it

SYZO's founding team owned product design, full-stack development, Cloudflare worker architecture, generation infrastructure, and deployment for Pixy Digital from start to production.

How this case study was prepared

Written directly from the Pixy application repository and the two connected Cloudflare worker repositories, covering brand scraping, starter-image generation, storage, and publishing.

Last reviewed

May 18, 2026, during the E-E-A-T content review for the SYZO website.

Architecture

Brand context first, generation second.

Pixy dashboard

Onboarding, generation, campaigns, edits, history, publishing

Next.js / tRPC

Auth, validation, brand DNA, prompts, campaign APIs

Turso + Drizzle

Brands, assets, styles, generated images, campaigns

Cloudflare R2

Mirrored brand media, generated images, edits, publish exports

Brand scraper worker

Website and social scraping, font previews, R2 asset proxy

Style analysis

Dominant colors, background groups, platform visual signals

Starter queue worker

Durable jobs, grouped prompt plans, slot-by-slot progress

Gemini image models

Planning, reference-aware generation, configured fallback model

Instagram Graph API

JPEG preparation, media containers, publish status records

1. The app stores brand DNA and user workflow state.

2. Workers handle long-running scraping and starter generation jobs.

3. R2 and Turso make generated assets durable and reusable.

Stack

The moving parts behind the product.

Frontend

Next.js App Router, React 19, tRPC, TanStack Query, Tailwind, shadcn-style UI

Auth

Better Auth with email and social login support

Data

Turso/libSQL with Drizzle schema and normalized brand tables

Media

Cloudflare R2 for scraped assets, generated images, edits, and Instagram-ready exports

Brand scraper

Cloudflare Worker, Durable Objects, Browser Rendering, Apify actors, and R2-backed font or asset previews

Starter generation

Cloudflare Worker, Durable Objects, Gemini planning, Gemini image generation, R2 writes, and Turso updates

Publishing

Meta Instagram Graph API integration with ownership checks and JPEG preparation

Brand Scraper

The scraper builds the raw material for on-brand generation.

The brand scraper is a separate Cloudflare Worker. It creates a Durable Object job, renders or parses the target website, detects metadata, colors, logos, fonts, and social links, then uses social scraping paths for Instagram, Facebook, LinkedIn, and X/Twitter when those sources are available.

It also proxies fragile assets through worker-owned R2 preview endpoints. That matters for trust in the product: the app does not ask the user to manually rebuild their brand kit before they can test generation.

Website pass

Metadata, visible text, logos, stylesheets, font families, screenshots, and social links.

Social pass

Profile media and captions are collected from supported public social sources.

Preview assets

Fonts and images can be proxied through R2 so previews survive expired source URLs.

Implementation

Decisions that make generated assets reusable and auditable.

01

Brand onboarding is treated as a data pipeline, not a form

Pixy starts by collecting brand context from a website or social profiles. The app validates the input, rejects unsafe private URLs, resets the current onboarding state, then calls a dedicated Cloudflare scraping worker instead of doing long scraping work inside a Next.js request.

  • The worker accepts website URLs or social URLs for Instagram, Facebook, LinkedIn, and X/Twitter.
  • Progress is tracked through a Durable Object job so the app can poll without holding a server request open.
  • The final draft includes brand copy, colors, fonts, logos, images, social links, and platform style notes.

02

Scraped media is normalized before it becomes brand DNA

The scraper can return external images, proxied social assets, font previews, and logo candidates. The Next.js app mirrors the useful media into its own R2 bucket before saving the draft, which makes later generation independent from expiring social CDN URLs.

  • Logos can be resized or converted, including SVG-to-PNG handling for reliable downstream use.
  • Social images are enriched with platform-level visual analysis after they are mirrored.
  • Reusable background and typeface assets can be extracted from repeated design groups.

03

Brand DNA is persisted in queryable tables

Completing onboarding turns the draft into structured records instead of leaving everything in one JSON blob. The app stores brand overview fields, logos, colors, fonts, raw assets, and per-platform style profiles with background groups and content signals.

  • Platform styles track dominant visual style, background groups, recurring elements, color palettes, writing tone, and vocabulary.
  • Generated assets keep prompt, model, provider, reference selection, used colors, used fonts, and style-guide metadata.
  • This structure lets generation, campaigns, history, and publishing reuse the same source of truth.

04

Starter images are generated through a queueable worker path

After onboarding, Pixy plans a set of starter images across selected platforms. The app builds tasks from the saved brand draft and selected style groups, sends them to the starter-image worker, and lets the worker plan prompts, generate images, upload to R2, and write generated-image rows back to Turso.

  • The worker groups tasks by extracted style group so multiple images can share the same visual planning context.
  • Gemini planning is used to turn real style references into specific post concepts before image generation.
  • The onboarding row stores generated image IDs by slot, allowing the UI to reveal images as each slot completes.

05

Prompt generation uses brand context and references carefully

Pixy does not only pass a raw user prompt to an image model. It builds a brand-aware prompt, optionally optimizes it with a text model, attaches selected logos or assets as image references, and keeps reference instructions explicit so logos, layouts, and brand assets are used for the right purpose.

  • The generation service supports Gemini and OpenAI providers, with Gemini as the default app provider.
  • Reference images are capped and labeled before they are sent to the image provider.
  • Aspect ratio is controlled through API-level image configuration instead of hidden prompt wording.

06

Campaigns and publishing sit on top of the same generation layer

Campaign generation expands a creative direction into multiple image concepts, saves pending campaign image rows, generates images in parallel, uploads outputs to R2, and updates each row with completion or error state. Publishing then checks that the image belongs to the user before preparing it for Instagram.

  • Campaign image generation records per-image state, prompt, caption, aspect ratio, format, provider, model, and storage key.
  • Instagram publishing converts the selected image to a public JPEG under the platform size limit before using the Graph API.
  • Image edits are stored as a chain so users can continue from an original generated image or a selected edit.

Maintenance

How the AI workflow stays inspectable.

Boundaries

The Next.js app owns UI, auth, tRPC, persistence, and user workflows; the scraper and starter-image workers own long-running edge jobs.

Validation

Inputs are parsed with Zod, private URLs are rejected, brand ownership is checked, and user-owned images are verified before publishing.

Storage

External media is mirrored into R2 and generated outputs are saved with durable keys before the database treats them as reusable assets.

Recovery

Onboarding and starter generation keep status, progress, job IDs, generated slots, and error messages in durable rows.

Operations

Worker projects have separate typecheck and deploy commands, while app-to-worker calls are protected by bearer-token environment variables.

Result

A full-stack AI product with a real brand pipeline behind it.

Pixy Digital scrapes brand context from websites and five social platforms, normalizes that media into R2, persists brand DNA as structured records, plans starter images using Gemini, generates them with reference-aware prompts, and handles campaign generation, edit chains, and Instagram publishing through a single product flow.

Because each layer (scraping, storage, generation, publishing) has explicit boundaries and durable state, SYZO can add new generation features without rebuilding the core workflow.