Skip to content
← Selected work

Interactive planning · 2026 – Present

Heartopia Draft

Plan Heartopia layouts before building in-game. A browser-based editor with three grid precision levels, furniture placement, and project autosave.

Role
Product Engineer & Full-Stack Developer
Status
In development

Source code is private. This case study presents the editor, its domain rules, and the persistence workflow.

Heartopia editor with a furniture picker, metric grid, and a room layout.
Heartopia editor with a furniture picker, metric grid, and a room layout. Select the image to view it full size.
Next.jsTypeScriptReactMongoDBTailwind CSSJestTesting Library

The problem

Room proportions, openings, and furniture spacing are difficult to judge while building in-game. I wanted a separate workspace where players could explore a layout before committing resources.

The implementation

I built a canvas editor using Next.js and React, separating structural, opening, and furniture placement rules. MongoDB stores signed-in projects, while demo mode lets players explore the editor without saving an account-bound project.

What I built

Why three grids?

A single coarse grid makes furniture placement restrictive; a uniformly fine grid makes structural alignment harder to enforce. Separate precision levels let each tool use the rules appropriate to its objects. The editor combines shared-edge wall logic, opening placement, and safety-margin checks so changes stay consistent across tools.

Persistence and recovery

Autosave needs to distinguish a project that is loading from one the user has changed. The implementation includes hydration-aware saving, centralized project payload validation, protected routes, and rate limiting for sensitive writes. Demo editing stays separate from authenticated persistence.

Checking the editor rules

The project uses Jest and Testing Library for autosave behavior, wall logic, and interaction edge cases. Dependency-cycle checks and database index setup support the application around the editor. The lesson has been to make the domain rules explicit before adding more interaction modes.

Canvas workspace with structural tools and floor settings alongside the planning grid.
Canvas workspace with structural tools and floor settings alongside the planning grid.
Heartopia introduction with entry points for demo editing and account creation.
Heartopia introduction with entry points for demo editing and account creation.
← More selected workTalk about a project →