De sueño a grafo: lo que aprendí modelando metas, progreso y colaboración con React Flow y Three.js
Español ↔ English
La interfaz bonita solo funcionaba porque el modelo debajo era aburrido y consistente
Praxis partió de una idea visual: transformar un objetivo grande en un árbol donde las relaciones fueran visibles y no una checklist plana.
El mismo contenido puede verse como lista, mapa 2D y constelación 3D.
La parte difícil no era Three.js. Era garantizar que todas esas interfaces representaran un solo grafo confiable y no tres verdades diferentes.
Una meta no es una pantalla; es un nodo
Modelé el dominio antes que las visualizaciones.
type GoalNode = {
id: string
ownerId: string
parentId: string | null
title: string
status: 'planned' | 'active' | 'done'
weight: number
position2d?: { x: number; y: number }
}
El mismo nodo puede aparecer en tabla, canvas o escena 3D. La UI no se vuelve el modelo de datos.
Progreso es dato derivado, no un campo que todos deberían editar
Si padre e hijos pueden editar progreso manualmente, aparecen contradicciones.
Cuando la relación lo permite, prefiero derivarlo.
const progress = children.reduce(
(sum, child) => sum + child.progress * child.weight,
0
) / children.reduce((sum, child) => sum + child.weight, 0)
La fórmula exacta es una decisión de producto. El principio es evitar dos fuentes de verdad para el mismo hecho.
Mover un nodo puede corromper el árbol
Drag-and-drop parece visual, pero cambiar de padre es una operación de dominio.
Si A se vuelve hijo de uno de sus descendientes, creamos un ciclo.
function canMove(nodeId: string, newParentId: string | null) {
if (!newParentId) return true
if (nodeId === newParentId) return false
return !isDescendant(nodeId, newParentId)
}
React Flow dibuja la conexión. La aplicación decide si es válida.
React Flow resolvió interacción, no regla de negocio
Pan, zoom, nodes y edges encajan muy bien en React Flow.
Pero las invariantes quedaron fuera del componente. La UI propone; la aplicación valida; el grafo persistido es el resultado.
Así las mismas reglas pueden usarse desde API, móvil o importación futura.
Posicionamiento automático y manual pueden coexistir
Un layout automático ayuda a empezar. Pero después de que el usuario organiza su mapa, el sistema no debería pisar ese trabajo.
type PositionMode = 'auto' | 'manual'
Distinguir posición sugerida de posición fijada hace que la herramienta se sienta colaborativa en vez de obstinada.
La constelación 3D no necesitaba convertirse en otro producto
Reutilicé el mismo grafo y lo proyecté en coordenadas 3D. Un layout estilo Fibonacci sphere puede distribuir nodos alrededor de una esfera sin guardar manualmente cada punto.
grafo canónico
├─ proyección lista
├─ proyección 2D
└─ proyección 3D
Las coordenadas 3D son presentación, no una segunda jerarquía.
Cargar Three.js bajo demanda protege la experiencia principal
La visualización 3D pesa más que una lista.
Quien solo entra a revisar tareas de hoy no debería pagar el costo de la constelación en cada ruta.
Trato 3D como una capability cargada cuando se solicita. Una feature llamativa no debería penalizar los flujos cotidianos.
Colaboración realtime es sincronización más autorización
Supabase Realtime puede propagar cambios rápido, pero también necesito saber quién puede ver y modificar cada nodo.
Un evento realtime no puede ser atajo para saltar ownership.
Las mismas reglas de acceso deben proteger consultas, subscriptions y mutations.
Presencia y colaboración no son lo mismo
Mostrar quién está online es presence. Persistir una edición es sincronización. Resolver dos ediciones simultáneas es política de conflicto.
Separar estos conceptos evita construir un editor colaborativo completo cuando el producto solo necesita coordinación ligera.
WOOP y planes "si-entonces" entran como método, no como autoridad de IA
WOOP—Wish, Outcome, Obstacle, Plan—y las implementation intentions ayudan a estructurar reflexión.
La IA puede convertir una idea vaga en alternativas más concretas, pero la persona sigue siendo dueña de su objetivo.
Me gusta usar IA así en productividad: estructurar pensamiento sin apropiarse de la decisión.
IA opcional es una decisión de producto importante
Crear metas, jerarquía, progreso y visualización debe seguir funcionando sin un modelo disponible.
Eso aumenta resiliencia y respeta a quien no quiere IA dentro de su planificación personal.
La IA es enhancement, no dependencia básica del dominio.
La suscripción también es estado de dominio
Un plan pago no debería ser solo un plan === 'pro' repetido en componentes.
Prefiero capabilities explícitas:
type Capability =
| 'advanced_views'
| 'collaboration'
| 'ai_coach'
Así pricing puede cambiar sin reescribir la lógica de todo el producto.
El insight mayor: un buen modelo permite muchas interfaces sin duplicar verdad
Cuando el grafo es confiable:
- lista es una proyección;
- mapa es otra;
- 3D es otra;
- analytics de progreso es otra.
Cuando el modelado está mal, cada pantalla crea un estado nuevo que sincronizar.
La constelación 3D llama la atención en la demo. Lo que hace que el producto siga funcionando después es mucho menos glamuroso: reglas de padre e hijo, ciclos, permisos y progreso derivado.
Ese contraste resume mi forma de ver ingeniería de producto: el visual puede ser ambicioso; la fuente de verdad debe ser tediosamente confiable.
Referencias
The beautiful interface only worked because the model underneath was boring and strict
Praxis started from a visual idea: turn a large personal objective into a tree that makes relationships between goals visible instead of hiding everything in a flat checklist.
The product can show the same structure as a list, an interactive 2D map and a 3D constellation.
The surprising part is that the 3D scene was not the hardest architectural problem.
The hard part was making sure all those views represented one reliable graph instead of three competing versions of reality.
A goal is not a screen; it is a node
I modeled the domain before the visualizations.
A simplified node might contain:
type GoalNode = {
id: string
ownerId: string
parentId: string | null
title: string
status: 'planned' | 'active' | 'done'
weight: number
position2d?: { x: number; y: number }
}
The same node can appear in a table, on a canvas or inside a 3D scene.
That distinction prevents the UI from becoming the data model.
Progress is derived data, not a field everyone should edit
If a parent goal contains five children, letting both parent progress and child progress be manually edited creates contradictions quickly.
I prefer deriving aggregate progress when the relationship allows it.
A simple weighted version might be:
const progress = children.reduce(
(sum, child) => sum + child.progress * child.weight,
0
) / children.reduce((sum, child) => sum + child.weight, 0)
The exact formula is a product decision. The architectural point is that a value derived from other truth should not casually become a second source of truth.
Moving one node can corrupt the tree
Drag-and-drop makes hierarchy feel simple, but moving a node is a domain operation.
If goal A becomes a child of one of its own descendants, the tree becomes cyclic.
Before accepting a new parent, the application needs to verify that the candidate is not the node itself and not part of its descendant set.
Conceptually:
function canMove(nodeId: string, newParentId: string | null) {
if (!newParentId) return true
if (nodeId === newParentId) return false
return !isDescendant(nodeId, newParentId)
}
React Flow can draw the connection. It should not be responsible for deciding whether the relationship is valid.
React Flow solved interaction, not business rules
React Flow was a strong fit for panning, zooming, nodes, handles and edges in the 2D view.
But I deliberately kept graph invariants outside the component layer.
The UI proposes a connection or move. The application validates it. The persisted graph is the result.
That keeps the same rules available to a future mobile view, import process or API without reimplementing them in canvas callbacks.
Automatic and manual positioning can coexist
Graph layout is one of those features where users often want both convenience and control.
A useful model is to distinguish a generated position from a user-pinned position.
type PositionMode = 'auto' | 'manual'
An automatic layout can give a new tree a sensible starting point. Once a user intentionally arranges nodes, the system should not casually overwrite that work.
This is a product detail, but it has a big effect on whether a visual planning tool feels cooperative or frustrating.
The 3D constellation did not need to become a second product
For the 3D view, I reused the same graph and projected it into three-dimensional coordinates.
One option for distributing nodes around a sphere is a Fibonacci-sphere style layout, which spreads points without requiring a manually curated position for every item.
The important rule is that 3D coordinates are a visualization projection. They are not a second hierarchy.
canonical graph
├─ list projection
├─ 2D projection
└─ 3D projection
That single-source model made experimentation much safer.
Loading Three.js on demand protects the main experience
A 3D visualization is heavier than a normal list.
Users who only want to check today's tasks should not pay the full JavaScript and rendering cost of the constellation on every route.
So I treat 3D as a capability loaded when requested rather than a permanent dependency in the critical path.
This is a good example of performance as product architecture: exciting features should not punish the boring workflows people use every day.
Realtime collaboration is synchronization plus authorization
Supabase Realtime can propagate changes quickly, but a collaborative product also has to answer who is allowed to see and mutate each node.
A realtime event should not become a shortcut around the ownership model.
The same tenant/project/user rules that protect normal queries need to protect subscriptions and mutations.
Realtime makes latency smaller. It does not make authorization optional.
Presence and collaboration are different concepts
Showing that another user is online is presence. Persisting a goal edit is state synchronization. Resolving two people editing the same structure is conflict policy.
They are related, but they are not the same feature.
Keeping those concepts separate made it easier to avoid building a full collaborative editor when the product only needed lightweight coordination.
WOOP and implementation intentions belong as methods, not AI authority
Praxis can use goal-setting methods such as WOOP—Wish, Outcome, Obstacle, Plan—and "if-then" implementation intentions as structured prompts for reflection.
I like this because the method provides a framework while the user remains the owner of the goal.
An AI assistant can help turn vague text into concrete alternatives, but it should not pretend to know which life objective is correct for the person.
This is one of my preferred uses of AI in productivity software: help structure thinking without taking ownership of the decision.
Optional AI is an important product decision
Not every useful workflow needs an LLM.
Core goal creation, hierarchy, progress and visualization should continue to work without model availability.
That keeps the product resilient and also respects users who simply do not want AI involved in personal planning.
AI becomes an enhancement layer, not a runtime dependency for the basic domain.
Subscription is domain state too
A paid plan is not just a Stripe boolean used to hide a button.
Capabilities such as collaboration, number of trees or advanced views need a clear entitlement model.
type Capability =
| 'advanced_views'
| 'collaboration'
| 'ai_coach'
Then the product asks whether an account has a capability instead of scattering checks like plan === 'pro' across components.
That becomes easier to evolve when pricing changes.
The larger lesson: a good model allows many interfaces without duplicating truth
Once the goal graph is trustworthy:
- the list becomes one projection;
- the 2D map becomes another;
- 3D becomes another;
- progress analytics becomes another.
When the model is wrong, every new view creates new state to synchronize.
The 3D constellation is the part people notice in a demo. The part that keeps the product working after the demo is much less glamorous: parent-child rules, cycle prevention, permissions and derived progress.
That contrast summarizes a lot of how I think about product engineering: the interface can be ambitious; the source of truth should be boringly reliable.