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.

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
- A three-tier grid: 1.0 m for structures, 0.5 m for openings, and 0.25 m for furniture.
- Tools for walls, floors, doors, windows, fences, crops, and furniture.
- Multi-select and grouped furniture movement.
- Authenticated project persistence, autosave, and payload validation.
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.

