biz/spatial-gallery

SPATIAL GALLERY

Build spatial gallery solutions for shared-space operators — visual directories

production Cloudflare Workers, Node.js, any runtime with HTTPS
improves: biz

Spatial Gallery

A generic gallery and spatial index solution for shared-space operators. Represents physical spaces as addressable, verifiable, browsable entities — inspired by FOAM.org's proof-of-location protocol, adapted for commercial shared-space operations.

Every shared-space operator needs to answer: what spaces exist, where are they, are they available, and can I prove someone was there? This skill provides the architecture patterns, data models, and integration approach to build that.

Authentication

Gallery APIs use the same 2nth.ai platform authentication:

GALLERY_API_KEY=your_api_key       # 2nth.ai platform key
OPERATOR_ID=workshop17             # operator identifier in the spatial index

For IoT/access hardware integrations, store vendor credentials separately:

SALTO_CLIENT_ID=...
SALTO_CLIENT_SECRET=...
KISI_API_KEY=...

Core concepts — FOAM to shared spaces

The FOAM protocol introduced a decentralised proof-of-location system using radio beacons, token-curated registries, and crypto-spatial coordinates. We adapt each concept for commercial space operations:

Points of Interest → Spaces

In FOAM, POIs are locations on a map verified by token stakers. In a spatial gallery, spaces are the atomic unit — a desk, a meeting room, a floor, a building.

{
  "uri": "pg://workshop17/cape-town/silo/floor-2/room-204",
  "type": "meeting_room",
  "name": "Room 204 — The Hyrax",
  "capacity": 8,
  "amenities": ["display", "whiteboard", "video_conf"],
  "coordinates": { "lat": -33.9078, "lng": 18.4178 },
  "floor": 2,
  "zone": "workshop17/cape-town/silo",
  "status": "available",
  "images": ["https://cdn.operator.com/rooms/204-hero.jpg"],
  "rates": {
    "hourly": { "amount": 350, "currency": "ZAR" },
    "daily": { "amount": 1800, "currency": "ZAR" }
  }
}

Crypto-Spatial Coordinates → Space URIs

FOAM uses geohash-based coordinates tied to Ethereum addresses. We use a hierarchical URI scheme that uniquely addresses any space in the network:

pg://{operator}/{city}/{site}/{floor}/{space}

Examples:

pg://workshop17/cape-town/silo                    → site
pg://workshop17/cape-town/silo/floor-2            → floor
pg://workshop17/cape-town/silo/floor-2/room-204   → space
pg://workshop17/cape-town/silo/floor-2/desk-47    → desk
pg://kofisi/kigali/kn-1/ground/hot-desk-area      → zone within floor

Resolution rules:

Zones → Operator portfolios

In FOAM, zones are clusters of anchors that maintain consensus on time and space. In a spatial gallery, zones are governance boundaries — a cluster of spaces under one commercial policy.

{
  "zone": "workshop17/cape-town",
  "governance": {
    "billing_rules": "standard-coworking-v2",
    "access_policy": "business-hours-plus-members",
    "currency": "ZAR",
    "tax_jurisdiction": "ZA-WC",
    "dispute_sla_hours": 48
  },
  "sites": [
    "workshop17/cape-town/silo",
    "workshop17/cape-town/kloof",
    "workshop17/cape-town/waterfront"
  ],
  "stats": {
    "total_spaces": 342,
    "occupancy_rate": 0.73,
    "available_now": 92
  }
}

Zone Anchors → IoT sensors and access hardware

FOAM uses radio beacons with Byzantine fault-tolerant clock sync. We use real-world signals from access hardware and sensors:

Signal sourceWhat it provesHardware
Access event (badge tap)Person entered/exited a spaceSalto, Kisi, Openpath, HID
Occupancy sensorSpace is currently occupiedIR sensors, desk sensors
Booking confirmationSpace is reserved for a time slotBooking system API
Wi-Fi probeDevice is in proximityWi-Fi AP logs
Camera countHead count in a zonePrivacy-preserving people counters

Proof of Location → Proof of Presence

FOAM issues "Presence Claims" — cryptographic certificates proving an entity was at a location at a time. We issue Presence Records:

{
  "id": "pres-a1b2c3d4",
  "space_uri": "pg://workshop17/cape-town/silo/floor-2/room-204",
  "participant_id": "tenant-9f8e7d",
  "entered_at": "2026-04-04T09:15:00+02:00",
  "exited_at": "2026-04-04T11:32:00+02:00",
  "duration_minutes": 137,
  "signals": [
    { "source": "salto", "event": "access_granted", "at": "2026-04-04T09:15:00+02:00" },
    { "source": "occupancy_sensor", "event": "occupied", "at": "2026-04-04T09:15:12+02:00" },
    { "source": "occupancy_sensor", "event": "vacant", "at": "2026-04-04T11:31:48+02:00" },
    { "source": "salto", "event": "access_granted", "at": "2026-04-04T11:32:00+02:00" }
  ],
  "confidence": 0.98,
  "hash": "sha256:e3b0c44298fc..."
}

Presence records are written to the Event Ledger (Proximity Green's immutable audit trail) and used for:

Token Curated Registry → Verified Gallery

FOAM uses token staking to curate POI quality. We use operator verification and data quality scoring:

Gallery tierRequirements
ListedOperator submits space data. Basic gallery card with photos and rates.
VerifiedAccess hardware connected. Live availability feed active. Presence records flowing.
Certified90-day track record. Occupancy data audited. Dispute rate below threshold.

Gallery API

The gallery exposes a read API for partners, aggregators, and listing sites:

GET /api/gallery/spaces?zone=workshop17/cape-town&type=meeting_room&available=now
GET /api/gallery/spaces/{uri}
GET /api/gallery/zones/{zone}
GET /api/gallery/availability?uri=pg://workshop17/cape-town/silo/floor-2&date=2026-04-05

Response follows the space schema above. Availability is real-time when hardware is connected, or booking-system-based when not.

Gallery UI patterns

Card grid (default view)

Each space renders as a card: hero image, name, type badge, capacity, rate, and a live availability indicator (green/amber/red dot).

Map view

Spaces plotted on a map using coordinates from the space record. Cluster at zoom-out, individual pins at zoom-in. Filter by type, availability, amenities.

Floor plan view

For operators with floor plan data, render spaces on a 2D plan with colour-coded occupancy status. Requires floor plan SVG with space IDs matching URIs.

Common Gotchas

See Also