Skip to content

Bulma Endpoints

  type: reference
  owner: trunks + jimmy-neutron
  first_touched: 2026-05-26
  last_touched: 2026-06-11

Events Endpoint Shipped — Studio Activity Log End-to-End

source: documentation/activities/events-endpoint-shipped.md

/website-audit 840055 flagged R1 as "events endpoint deployment unblocked surface-side". Full chain executed 2026-05-26 evening.

Server (jimmy-vps)

  • public.events table on hinata Postgres database (NOT hinata_collector)

  • FastAPI router at /opt/hinata-collector/app/routers/events.py (POST + GET + GET /meta)

  • Authentication via x-hinata-key header

  • Synchronous psycopg via from db import get_conn

  • Install script: ~/Sandpit/hinata/scripts/jimmy-vps-add-events-tenant.sh — idempotent

Public transport

  • Cloudflare Tunnel hinata-collector-api (UUID 67a84c34-3ba0-43d6-ae39-03025a5b1c97)

  • Publishes https://api.michael-engineer.dev to localhost:8080 on jimmy-vps

  • cloudflared installed as systemd service

Why one subdomain covers everything

FastAPI multiplexes by path (/events, /football, /musicmastery, etc.). Single DNS record, single tunnel ingress rule, all current + future tenants reachable.

Studio Worker proxy

* Added /api/events route to hinata-studio-api Worker

* Holds HINATA_COLLECTOR_KEY as wrangler secret — never ships in browser bundle

* ActivityLog.tsx flipped from raw /events to ${VITE_API_URL}/api/events

Producer ecosystem

  * emit-event.sh fixed: x-hinata-key header; reads JSON token .value field

  * 3 real producers instrumented: poll-monzo.py on CT109 (monzo.written), parse-apple-health.py (health.normalised), calendar-nudge.py (nudge.{pre|start|mid})

5 reality corrections vs original spec

    1. db hinata not hinata_collector

    2. x-hinata-key not Bearer

    3. psycopg sync not asyncpg

    4. token file .json w/ value field not .md w/ **Key:** line

    5. bare APIRouter() with prefix at include time

Verification

POST/GET/meta all return 200 with valid auth, 401 without. 5 events in table by session end. Full chain proven: Worker to CF Tunnel to FastAPI to Postgres.

◆ hinata · bulma-endpoints · folded from documentation/activities/ phase-19