Skip to content

← When the floor plan becomes the interface: how I built a private architecture portal around context

When the floor plan becomes the interface: how I built a private architecture portal around context

English ↔ Español

The problem was not storing files

An architecture studio can already share PDFs, images and documents through folders. Building another folder with prettier cards would not solve much.

In the Estúdio Dupla Face project, the more interesting question was how clients understand those files in relation to the project itself.

Architects and clients think spatially. A floor plan is already a shared language.

So instead of making the database entity tree the primary navigation model, I treated the floor plan as an interface.

The floor plan became a spatial index

A marker can connect a region of the drawing to photos, notes, decisions or documents.

Conceptually:

ts
type PlanMarker = {
  id: string
  projectId: string
  x: number
  y: number
  kind: 'photo' | 'document' | 'note'
  referenceId: string
}

The useful part is not the marker itself. It is reducing the mental translation required from "document 37" to "this belongs to the kitchen wall".

Context becomes part of navigation.

Pixel coordinates were a bug waiting to happen

Storing x = 842 and y = 391 ties data to a specific rendered image size.

Responsive layouts immediately break that assumption.

I prefer normalized coordinates:

ts
const xRatio = clickX / renderedWidth
const yRatio = clickY / renderedHeight

Persist values between 0 and 1, then reconstruct the screen position from the current dimensions.

ts
const x = marker.x * currentWidth
const y = marker.y * currentHeight

Now the same marker survives desktop, mobile and resized containers.

Zoom should transform presentation, not business data

When a user zooms the plan, I do not want to rewrite every marker coordinate.

The stored point remains relative to the source. Zoom and pan are view transforms.

This is a small distinction between domain state and presentation state, but it prevents a lot of drift and edge-case math.

The product had three surfaces with different risk profiles

The project combined:

  • a public marketing site;
  • a private client portal;
  • an administrative publishing area.

Those surfaces should not fail in the same way.

A public portfolio page can often degrade gracefully if a read dependency is temporarily unavailable. A private document request must fail closed if authorization cannot be verified. An admin write should report failure explicitly instead of pretending the operation succeeded.

Reliability is not simply "catch every exception". It is choosing the right failure behavior for each boundary.

If the database fails, the public site does not need to disappear with it

For public content, a defensive read can return an empty optional section when the database is unavailable, provided the page remains truthful.

For a write, that would be dangerous. A fake success message creates inconsistent state.

This led me to separate failure semantics rather than applying one generic error strategy across the application.

Frontend authorization would be insufficient

Hiding a navigation item from the browser is UX, not security.

Supabase RLS lets ownership rules exist in PostgreSQL as well.

A simplified policy might express that a user can read a project only when membership exists for their authenticated identity.

The exact policy depends on schema, but the goal is consistent: a missing application filter should not expose another client's project.

Pending registration was better than automatic access

For this kind of portal, an email existing in the system does not necessarily mean the person should immediately see a project.

An approval-based access flow makes the state explicit:

txt
registered → pending → approved → project access

That also gives the studio a clear operational queue instead of burying permission changes in ad hoc messages.

A private document should not have a permanent public URL

Files meant for a specific client belong in private storage.

A signed URL can grant short-lived access after ownership is checked.

The sequence I prefer is:

txt
request document
      ↓
authenticate user
      ↓
verify project ownership / membership
      ↓
generate short-lived signed URL
      ↓
return access

A signed URL is not authorization by itself. The important step happens before generating it.

Short expiry limits the value of a copied link.

The storage path can carry useful context too

Paths such as tenant/project/document/version can make operations and debugging easier, although path structure should never replace access policies.

I like storage structures that help a human answer where an artifact belongs while authorization remains enforced independently.

Realtime only makes sense when permission travels with it

Realtime updates improve collaboration, but a live channel is another data boundary.

If a user loses access to a project, the realtime subscription cannot remain a forgotten bypass.

Supabase provides authorization mechanisms around Realtime. The broader lesson is that every transport—HTTP, storage, websocket, background jobs—needs the same ownership model.

The internal publishing experience mattered too

An admin panel is still a product interface.

If staff hate using it, they return to WhatsApp, shared folders and manual workarounds, and the original information problem comes back.

So I treated publishing, approvals and organization as real UX concerns rather than "backoffice that can be ugly".

The lesson that stayed with me: context is worth more than storage

Technically, a bucket and a documents table could store everything.

The useful part came from asking how information exists in the user's world.

For an architect and a client, the project is spatial. The plan is already a common language.

That is an idea I carry into other products: before designing navigation around database entities, identify the mental object users already use to organize the problem.

Sometimes it is an order. Sometimes a timeline. Sometimes a map.

Here, it was literally a floor plan.

References

El problema no era almacenar archivos

Un estudio de arquitectura ya puede compartir PDFs, imágenes y documentos en carpetas. Construir otra carpeta con tarjetas bonitas no cambia demasiado.

En Estúdio Dupla Face, la pregunta más interesante fue cómo el cliente entiende esos archivos dentro del contexto del proyecto.

Arquitectos y clientes piensan de forma espacial. El plano ya es un lenguaje compartido.

Por eso lo convertí en interfaz y no en un simple adjunto.

El plano se volvió un índice espacial

Un marcador puede conectar una zona de la planta con fotos, documentos, notas o decisiones.

ts
type PlanMarker = {
  id: string
  projectId: string
  x: number
  y: number
  kind: 'photo' | 'document' | 'note'
  referenceId: string
}

El valor no está en el punto de color. Está en reducir la traducción mental entre "documento 37" y "esto corresponde a la pared de la cocina".

Coordenadas en píxeles eran un bug esperando aparecer

Guardar x = 842 y y = 391 ata el dato a un tamaño concreto de imagen.

Con layout responsivo, eso rompe inmediatamente.

ts
const xRatio = clickX / renderedWidth
const yRatio = clickY / renderedHeight

Persisto proporciones entre 0 y 1 y reconstruyo la posición con el tamaño actual:

ts
const x = marker.x * currentWidth
const y = marker.y * currentHeight

El marcador sobrevive a desktop, móvil y redimensionamiento.

Zoom debe transformar presentación, no el dato

Al hacer zoom no quiero reescribir cada coordenada persistida.

El punto sigue relativo al plano original; pan y zoom son transformaciones de vista.

Separar estado de dominio de estado de presentación evita deriva y mucha matemática accidental.

Había tres superficies con riesgos distintos

El producto combina:

  • sitio público;
  • portal privado de cliente;
  • área administrativa.

No deberían fallar de la misma manera.

Una página pública puede degradar una sección opcional ante un fallo de lectura. Una descarga privada debe fallar cerrada si no puede verificar autorización. Un write administrativo debe mostrar error y jamás fingir éxito.

Confiabilidad también es elegir la semántica correcta de fallo.

Si falla la base, el sitio público no tiene por qué desaparecer

Para lecturas públicas, un fallback puede mantener la página útil y honesta.

Para escrituras, simular éxito sería peligroso.

Eso me llevó a diseñar estrategias de error según boundary, no una única política genérica para toda la aplicación.

Autorización en frontend sería insuficiente

Ocultar un link en React es UX, no seguridad.

Row Level Security permite expresar ownership también en PostgreSQL.

La meta es sencilla: olvidar un filtro en aplicación no debe exponer el proyecto de otro cliente.

Registro pendiente fue mejor que acceso automático

Que un email exista no significa que la persona deba ver inmediatamente un proyecto.

Un flujo explícito funciona mejor:

txt
registrado → pendiente → aprobado → acceso al proyecto

Además le da al estudio una cola operacional clara para administrar accesos.

Un documento privado no debería tener URL pública permanente

Los archivos privados viven en storage privado y solo generan una URL firmada después de validar ownership.

txt
solicitar documento
      ↓
autenticar
      ↓
verificar proyecto / membresía
      ↓
generar URL firmada de corta duración
      ↓
entregar acceso

La URL firmada no es la autorización. La autorización ocurre antes.

El path de storage también puede cargar contexto

Una estructura como tenant/project/document/version ayuda a operación y debugging, aunque nunca reemplaza una policy de seguridad.

Me gusta que un humano pueda entender dónde pertenece un artefacto sin convertir el nombre de la carpeta en mecanismo de autorización.

Realtime solo tiene sentido si el permiso viaja con él

Un canal live también es un boundary de datos.

Si un usuario pierde acceso al proyecto, una subscription olvidada no puede convertirse en bypass.

El modelo de ownership debe aplicarse a HTTP, storage, websocket y jobs por igual.

La experiencia administrativa también era producto

Si el equipo odia el panel, vuelve a WhatsApp y carpetas compartidas. Entonces reaparece exactamente el problema que el software debía resolver.

Por eso publicar, aprobar y organizar también merecen UX.

El aprendizaje que quedó: contexto vale más que almacenamiento

Un bucket y una tabla podían guardar los documentos.

El diferencial fue preguntar cómo esas informaciones existen en el mundo del usuario.

Para arquitecto y cliente, el proyecto es espacial. El plano ya es lenguaje común.

Antes de diseñar navegación alrededor de entidades de base de datos, intento descubrir el objeto mental que el usuario ya utiliza.

A veces es un pedido. A veces una línea de tiempo. A veces un mapa.

Aquí era literalmente un plano.

Referencias