
TerraForge: Building Planets, Moons, and Shared Star Systems
TerraForge is a browser-based interactive simulation that lets users create custom planets by configuring elemental compositions, orbital parameters, moons, and stellar environments. Users watch their planet form from a primordial gas cloud through a cinematic animation, then receive a detailed scientific analysis including planet classification, atmospheric breakdown, and a multi-factor habitability score. What began as a single-player sandbox has grown into a community platform where worlds are saved, shared, and assembled into star systems.
Mission
My goal was to create an educational tool for people to understand what physical attributes go into the construction of celestial bodies. I wanted people to understand what elements compose a planet like Earth, for it to develop oceans and have an atmosphere. I went so far as to simulate the evolution of a magnetic field, which is crucial for supporting life.
I relied on real-world scientific research to compose the formation of different types of planets in our known solar system, and exo-planets that have been discovered. Allowing the user to change not only the chemical composition of the planet, but its companion star and distance from the star, as well as the mass of the planet -- these are all ingredients to each planet's existence.
The Solution
TerraForge is a browser-based interactive simulation that lets users create custom planets by configuring elemental compositions, orbital parameters, moons, and stellar environments. Users watch their planet form from a primordial gas cloud through a cinematic animation, then receive a detailed scientific analysis including planet classification, atmospheric breakdown, and a multi-factor habitability score. What began as a single-player sandbox has grown into a community platform where worlds are saved, shared, and assembled into star systems.
TerraForge Was Built for the Community
Accounts mean a planet survives the tab being closed, which quietly changes the whole relationship with the tool: it stops being a session and becomes a collection. Sharing turns a private creation into something with an audience. Both are deliberately family-friendly. Profiles are thin by design, and signing in uses a one-time email code rather than a password, so there's no sensitive data sitting in a database waiting to be misused.
As of late July, saved planets can be assembled into full star systems. Each week a Planet of the Week goes out, an AI-curated standout from the community, featured on the site and on X. The next step is the one I'm most excited about: a galaxy of user-generated star systems that anyone can fly through, visit, share, and like. A community sky where the star you pass was built by someone you've never met.
How It Works
The experience flows through three phases. Users start on a landing page that introduces the concept, then move into the builder — a split-screen interface with a real-time 3D scene on the left and a configuration panel on the right.

Start by adding the elements and physical attributes to your planet
In the configuration panel, users adjust 15 cosmic elements (hydrogen, helium, oxygen, carbon, silicon, iron, and others) using a parts-based composition system. They also set environmental parameters: star type (O through M spectral classes), distance from star (0.1-10 AU), initial mass (0.1-100 Earth masses), and rotation speed (1-2,400 hours per day). Moons can be added as well, and they aren't cosmetic: a moon influences the physical properties of the world it orbits. Eleven presets, including Earth, Mars, Venus, Jupiter, and speculative types like Hot Jupiter and Desert World, provide starting points for exploration.
As users adjust parameters, the 3D gas cloud updates in real time. Cloud color shifts based on weighted element colors, particle density scales with mass, and lighting responds to star type and distance using inverse square law calculations. Adding elements triggers comet-like particle effects flying into the cloud; removing them triggers ejection particles. A live classification preview updates as parameters change, giving immediate feedback on what type of planet is forming.

Different planet types emerge based on real physics and biological processes found in planets.
When the user clicks "Build Planet," a six-second formation animation plays. A timeline counts down from 5 billion years ago to present day as the gas cloud swirls, compresses, and brightens. A flash effect fires, and the fully formed planet emerges with procedurally generated surface detail. The planet's appearance is driven by its classification — earth-like worlds get terrain with water, lava worlds get molten surfaces, gas giants get banded atmospheric patterns, and so on.

The result gives you different habitability scores based on your recipe.
The results panel then displays the planet's classification, surface temperature, atmospheric composition, physical properties, and a habitability score from 0 to 100. The score breaks down into seven weighted factors: temperature, atmosphere, water potential, magnetic field strength, geological activity, chemical composition, and rotation speed. Each factor includes a brief explanation of why it scored the way it did, along with a scientific context for the planet type.
Technology
The app is built with Next.js 16 using the App Router and React 19, written entirely in TypeScript. The React Compiler is enabled for automatic rendering optimizations, and state management relies on React hooks — no external state library was needed given the app's scope.
The visualization layer is where things get interesting. Three.js powers the 3D graphics through React Three Fiber, which provides a declarative React renderer for the scene graph, with Drei supplying utilities like OrbitControls. The particle system supports up to 25,000 GPU-accelerated particles that respond to user input in real time. Six custom shader materials handle procedural surface generation across the different planet types — earth-like terrain with water, ocean worlds, ice worlds, lava surfaces, rocky terrain, and gas giant atmospheres. These shaders use fractal Brownian motion and ridged noise functions written in GLSL to produce realistic surface detail without any pre-built textures.
The interface uses Radix UI Themes with a dark theme for accessible, pre-styled components, Tailwind CSS 4 for utility styling, and SCSS modules for component-specific layout. Typography pairs Orbitron for headings — reinforcing the space aesthetic — with Roboto for body text.
Performance was a key consideration throughout. Particle counts were tuned down from early prototypes, sphere geometry was reduced to 64x64 segments, expensive calculations are memoized, and components are split for code splitting. The simulation itself, from element chemistry to habitability analysis, still runs entirely client-side. The backend only enters the picture for the community layer: Supabase handles accounts, saved planets, and sharing, which keeps the physics fast and local while letting worlds persist.
Under the Hood
The planet classification engine accepts element composition, distance, star type, mass, and rotation speed as inputs, then evaluates atmosphere retention, temperature ranges, and geological activity to produce one of eight planet types with full property details. The habitability scoring system runs as a separate pipeline, evaluating each of its seven factors on a 0–100 scale with specific thresholds and penalties tuned to real planetary science. Presets are modeled after real solar system bodies and known exoplanet archetypes, grounding the simulation in actual astrophysical data.
The formation animation orchestrates a tightly sequenced timeline — particle compression, luminosity ramping, a camera flash, and planet materialization — all coordinated through React refs and effect hooks to keep the 3D scene and UI in sync during the transition.
Key Takeaways
This project demonstrates real-time 3D rendering tightly integrated within a React application, custom GLSL shader development for procedural surface generation, scientific simulation logic grounded in planetary science, and responsive design across desktop, tablet, and mobile. The more interesting lesson came later. Watching real interest arrive through search traffic, then rebuilding a solo toy into something people return to and create in together, turned this from a technical exercise into a study in letting an audience shape what a tool becomes.