Case study · Mobile AI
Gloopy AI
Like Instagram, but with playable interactive experiences instead of photos. Type a sentence, get something you can touch, publish it, and share it.
The product
Gloopy is a mobile app for creating and sharing playable interactive experiences.
You type in an idea — a game, a toy, a meme, a simulation — and the platform turns it into something you can interact with on your phone. You can publish it, share it with others, and browse creations from other people in a vertical feed.
The generated experience runs in a constrained WebView rather than inside the native runtime. That boundary is the product: it makes arbitrary generated code safe enough to run and small enough to deliver instantly.
How it works
- Create: enter an idea. Client-side validation checks scope and safety before submission.
- Generate: the request goes to Cloudflare, and you can keep using the app while it processes.
- Preview: a push notification arrives when ready. Tap it to open the experience in a sandboxed WebView.
- Publish: add a title and description, save it, and it appears on the public feed.
- Discover: scroll through other creations, play them, like them, visit profiles, report content, or delete your own.
System design
Responsibilities are split by trust boundary. Supabase handles identity and application data. Cloudflare handles the AI generation workflow. The Expo app manages interaction and presentation. Generated HTML runs in a constrained WebView rather than inside the native runtime.
Secrets and AI work stay at the edge while Supabase remains the source of truth for users and content.
AI engineering
Generation is a two-stage pipeline. The first call converts the idea into a constrained intermediate specification. The second call generates the final artifact from that approved spec.
- Interpret: a dedicated AI call converts a loose idea into a structured mobile-first specification.
- Build: a second AI call uses that specification as the source of truth and returns one self-contained HTML document.
- Validate: the Worker parses the response, repairs malformed output, rejects blocked APIs, and enforces size and input constraints.
- Deliver: the result is stored and the user receives a push notification that opens the finished preview.
The first AI call decides what should be built. The second builds only that approved specification.
Gameplay stability is enforced at the generation level. The prompt requires delta-time normalisation or a fixed timestep for all motion, gravity, spawning and animation, so behaviour stays consistent across devices with different refresh rates.
Security
Generated code is treated as untrusted. Isolation is applied at generation time, server validation, client validation and the runtime container.
- No network access, external scripts, fonts, camera, microphone, geolocation, cookies, eval or keyboard controls.
- Strict Content Security Policy disables all outbound connections and frames.
- Risky browser APIs are removed or replaced before content loads.
- Supabase Row Level Security restricts profiles, creations, likes and reports.
- Prompt and description validation combines local rules with profanity moderation.
Product engineering
The generation pipeline is only part of the product. Gloopy uses a centralised dark visual system, responsive safe-area layouts, Material components, custom press feedback, skeleton loading, keyboard-aware forms, confirmation dialogs and a profile grid that expands creations into playable cards.
The AI pipeline is wrapped in a complete mobile product: identity, creation, publishing, discovery, profiles and moderation.
What I learned
The architecture emerged through testing real failure modes rather than being designed upfront. Early generation ran too close to the client. Moving it to Cloudflare introduced queue permissions, service-role boundaries, deployment configuration and push delivery work, but it also produced a cleaner system.
AI product development is systems engineering. Model quality matters, but the user experience is ultimately determined by contracts, queues, state transitions, validation, recovery, observability and careful mobile interaction design.