Production deploy and fixes for a 3D sticker editor
I audited and fixed a client's large browser 3D sticker editor (about 92,000 lines of TypeScript), made its export work on phones, and set up its hosted deployment.
The problem
The client had a large browser editor that worked on his own PC and fell over in front of real users: export failed on phones, layer selection misbehaved, logos with gradients or holes rendered wrongly in 3D, and it had never been hosted anywhere users could reach.
How I built it
I started with a source audit and traced each reported bug to its cause before changing anything, then wrote the fixes as small changes he could merge. For hosting I built a thin deployment layer on Railway around his code and kept it on separate branches, so his repository stayed his. I also wrote Playwright scripts to check the fixes on the live site.
What got hard
- Export worked on his PC and failed on every phone and on the live site. The 'Smart' export sent frames to a render server at 127.0.0.1, which only exists on a developer machine, and the quick-export buttons defaulted to it.
I changed the failure path so the app falls back to the in-browser export, which needs no server and gives the same output. It is a five-line change and it fixed live-site export as well as mobile.
- Three.js's SVG loader ignores gradient fills, so a gradient logo came out black and white, and it mishandles compound paths, so a ring-shaped logo with a hole rendered as broken wedges.
For gradients I let the browser rasterize the SVG and projected that texture onto the extruded shape. For holes I designed a contour tracer that reads the alpha mask and builds shapes by nesting depth, and proved it on a test ring first (outer area 31,416, hole area 7,843, opposite winding).
- ffmpeg.wasm needs a cross-origin isolated page, a plain static host does not send those headers, and 'vite preview' blocks unknown hosts. The Railway build also rejected two files with non-UTF-8 bytes, and a rewrite of the client's git history dropped preview videos and template data, which left the templates unclickable.
I wrote a minimal Express static server that sets the isolation headers and binds to Railway's port, cleaned the file encodings, restored the dropped assets, and fixed the gitignore rules that were hiding them.
- The editor read its messaging-bot credentials from build-time variables and literal fallbacks, which Vite compiles into the public JavaScript bundle where any visitor can read them.
I removed them from the front end and set empty defaults, and recorded that the tokens have to be held server-side.
The result
A private hosted build of the editor on Railway with the export fix in place, and a written audit with exact line references and two fix options for the selection bugs. Later builds of that panel use the shared selection rule from the audit.
The ← and → keys turn the page too.