NEWROOM (2025–2026)

(room redesign from a photograph)
Doc. ref: HK-NEWROOM-2025
Category
Applied Products
Medium
React, Netlify Functions, Gemini image models, Supabase, Stripe
Venue
newroom.app
State
live
Tags
image-generation, product, payments

Among the projects in this index, newroom.app is the most straightforwardly commercial web application: a user uploads a photograph of a room, selects a room type and a design aesthetic, and gets back a structurally faithful redesign. I built it both as an exercise in shipping a self-contained, paid generative product — with real credit accounting, payment webhooks, and spend circuit breakers — and out of a sideways curiosity about what multimodal image models implicitly assume about domestic space, taste, and how a person ought to live.

The photo round-trips through a Netlify function, which holds the Gemini key.
The photo round-trips through a Netlify function, which holds the Gemini key.

When a photo is uploaded, it is encoded client-side and sent to a serverless function that calls a Gemini image model under a tightly constrained structural prompt: preserve the camera angle, room footprint, wall, window, and door positions, and the real exterior view through the windows, while replacing every finish, fixture, appliance, and piece of furniture to inhabit the chosen aesthetic.

Shipping a paid image-generation app on serverless infrastructure mostly comes down to defensive latency and cost engineering. Because Netlify terminates synchronous functions at 26 seconds, each generation runs against a strict internal time budget: spending most of its window on gemini-2.5-flash-image and falling back to gemini-3-pro-image-preview with whatever time remains, while always reserving headroom for the credit-refund path. Credits are deducted upfront via an optimistic-locking update guarded on the user’s current balance in Supabase (Postgres with magic-link auth and row-level security), and automatically refunded from a finally block if the upstream model times out or fails.

Anonymous visitors receive three free generations, and creating an account adds ten credits, with paid tiers fulfilled through Stripe Checkout webhooks. The free tier is gated by two daily limits: one per identity, and a global site-wide circuit breaker on zero-credit generations that bounds total daily model spend.

Last updated: 2026.10.25 08:37:57 UTChunter@hnsk.site