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

A user uploads a photograph of a room, picks a design style and a room type, and gets back a redesigned photograph. The image is encoded client-side and posted to a serverless function that calls a Gemini image model with a long, specific prompt: preserve camera angle, room footprint, wall, window and door positions, and the real exterior view through the windows, while replacing every finish, fixture, appliance and furnishing to match the chosen aesthetic.

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.

Netlify ends synchronous functions at 26 seconds, so generation runs against a fixed internal budget: most of it on gemini-2.5-flash-image, falling back to gemini-3-pro-image-preview with what remains, with headroom left for the credit-refund path. Credits are deducted with an optimistic-locking update guarded on the user’s current balance, and refunded from a finally block if generation fails.

Anonymous users get three free generations; creating an account adds ten credits. Paid tiers run through Stripe Checkout with a webhook granting credits on completion. The free path has two daily caps: one per identity, and a site-wide circuit breaker on zero-credit generations that bounds total daily model spend.

Supabase provides Postgres, magic-link auth, and row-level security.

Last updated: 2026.09.26 10:11:38 UTChnshokrian@gmail.com