Coding the stars - an interactive constellation with Three.js and React Three Fiber
Supabase built its Launch Week 8 visual as an animated constellation where each user ticket signup becomes a star particle tracing an "8" shape, using Three.js via React Three Fiber in Next.js. Each particle is a low-sided circle geometry with additive blending, positioned every frame in useFrame using sin/cos of elapsed time, with the cosine sign flipped on alternate loops to form the figure eight. Randomized speed, delay offsets and Math.pow-based path offsets concentrate particles toward the shape's core. A dat.gui debug panel, loaded via dynamic import to avoid SSR window errors, was wired to React state so the team could tune parameters and settle on the final design.
Related posts
- Behind the build: 2025's BFCM globe in a pinball machine 🌎🕹️
Shopify Engineering mediumAdeptShopify's 2025 BFCM live globe was embedded in a browser pinball game built with three.js and react-three-fiber, streaming real merchant orders via server-sent events and reacting to sales milestones and first sales. The team switched from Rapier 3D to Rapier 2D physics for mobile performance, faking ramps with sensors that toggle collider sets, and cut the physics step from 2ms to about 0.2ms even with six balls and continuous collision detection. Lighting was baked in Blender with MeshBasicMaterials. The 85 dynamic table lights are rendered via an emissive texture plus a mask texture encoding light IDs in the red channel. A shader plays 128x32 dot-matrix sprite sheets, and AR support took about 100 lines with @react-three/xr.
- How We Built the BFCM 2023 Globe
Shopify Engineering mediumAdeptShopify's BFCM 2023 live-orders globe was built with Three.js and React-three-fiber, and most of its effects are drawn in single instanced draw calls. Order arcs are cubic Bézier curves evaluated in the vertex shader from per-instance attributes stored in an interleaved buffer. They are billboarded using the cross product of the curve tangent and the camera direction, and dissolve via UV-driven noise. Instancing let the team render tens of thousands of arcs, and up to a million on an M1 laptop, where earlier per-mesh arcs struggled past 1000 on mobile. The same approach covers fireworks, city dots and orbiting airplanes, along with fixes for a camera flip caused by the lookAt up vector, Hermite-spline 'loopy arcs', and working around WebGL's 255-byte attribute stride limit.
- Infinite scroll with Next.js, Framer Motion, and Supabase
Supabase mediumAdeptInfinite scroll can be built in Next.js by server-rendering the first 20 rows via getServerSideProps, then loading further pages from Supabase with offset-based .range() queries as the user nears the bottom of the list. A lodash-debounced window scroll listener (200 ms) compares the container's getBoundingClientRect bottom against innerHeight to trigger fetches, and the listener stops once a page returns fewer than PAGE_COUNT rows. Framer Motion wraps each item to fade and slide it in, with a staggered delay recalculated so newly appended batches animate independently of earlier ones.
- The Future of React Native Graphics: WebGPU, Skia, and Beyond
Shopify Engineering easyNoviceReact Native WebGPU, built on Google's Dawn, lets React Native apps run Three.js, React Three Fiber, TSL shaders, ComputeToys compute shaders and TensorFlow.js on Metal (iOS) and Vulkan (Android) with no changes, which collapses the separate OpenGL and Metal backends into one. Lessons from that work fed back into React Native Skia. Moving from a mutable C++ scene graph (SkiaDOM) to an immutable, Fabric-reconciler display list made animation up to 50% faster on iOS and nearly 200% faster on Android, while fixing 98% of reported Android crashes. Skia also gained macOS, tvOS and headless Node.js targets, and the experimental Skia Graphite backend previews automatic threading and two-way 2D/3D texture composition.
- Designing with AI: Generating unique artwork for every user
Supabase mediumAdeptSupabase's Launch Week 7 tickets combine Midjourney-generated artwork with a per-user Open Graph image pipeline built on the Supabase stack. The art direction moved from busy prompts to minimal purple swirls. Gold variants came from blending a gold gradient overlay with `/blend` after prompts like "make it gold" failed. A Supabase Edge Function renders each ticket with Satori and caches the PNG in Supabase Storage behind a CDN, generating it only once. The same function detects Twitter and LinkedIn crawler user agents to record shares. A Postgres view behind RLS exposes public ticket fields, referral counts and a computed `golden` flag, and Supabase Realtime pushes the gold status to the client as users share.