How the eldershire system works today, as built. Written 2026-10-31 from the live fleet (code, containers, broker and database inspected directly). Covers eldershire.com, eldershire.ca and eldershire.net.
eldershire is Glen's remote-monitoring platform for a set of households β family and friends' homes where he keeps an eye on things: sensors and home automation state, and people-worn LTE location badges. Each household is a home in the system: atkinson-helen, burton-shawn, bartlett-glen, bartlett-brooklynn, bousquet-tony, molsberry-blair.
One web application serves every home. Access is per home: a login only ever sees the homes it has been granted (see Β§4). The households' own equipment (Home Assistant, Zigbee) lives in the homes; everything central lives on one physical server, led, behind the fleet's NGINX gateway on eye.
| Domain | Role |
|---|---|
| eldershire.com | The application. Apex + app. / auth. subdomains; oauth2-proxy fleet in front. |
| eldershire.ca | Canadian mirror of the app entry points (same backends). |
| eldershire.net | Services side: db.eldershire.net = InfluxDB, dashboards.eldershire.net = Grafana, ingest endpoints. |
All public traffic terminates on eye (host NGINX, ports 80/443). led (10.10.2.15) runs the containers; nothing on led is directly internet-facing.
| Container | What it does |
|---|---|
| com.eldershire-node | The application. A single-file Node.js program (index.js, ~5,600 lines) plus a static single-page UI in PUBLIC/. Serves the REST API under /api/v1/ β homes, residents, entities, queries, tracking β and the web UI (dashboard, homes, messages, stream, tracking). Published as host port 9000 β 80, reached publicly through eye's NGINX and the oauth2-proxies. |
| com.eldershire-postgres | Relational state. PostgreSQL holding the app's own data: homes, users' home access, residents/caregivers, entities and configuration. The app connects via localhost:5432 (published port) as role node_app, database eldershire. |
| net.eldershire.ingest-node | Telemetry ingest. TypeScript service (run under nodemon so Glen can edit code live on the box β see Β§7). Subscribes to # (everything) on the MQTT broker over mutual TLS, decodes reports β including the Nanolink badge data-report payloads β and writes time-series points into InfluxDB. Keeps its own file logs (topics.log, decoded-report.log, influx-points.log, button-events.log). |
| net.eldershire-mqtt | Message broker. Mosquitto. Plain port 1883 on the LAN, and 8883 with mutual TLS (client certificates) for devices and services. The badge connects here over LTE; household stacks bridge or connect here. |
| net.eldershire-influx | Time series. InfluxDB 2. Bucket eldershire.net, org eldershire.net. Holds every measurement the platform records β household telemetry and the gnss badge track. Also reachable by Glen directly at db.eldershire.net. |
| net.eldershire-grafana | Dashboards. Grafana over the same Influx data (dashboards.eldershire.net). |
| oauth2-proxy Γ5 + Redis | Front door. One oauth2-proxy per eldershire service, backed by an external identity provider (Auth0 / Windows Live). Unauthenticated requests never reach the app; the app receives the caller's identity from the proxy and applies its own per-home rules on top. |
| per-home stacks | In each remote household: Home Assistant + its own MQTT + Zigbee2MQTT driving a network Zigbee coordinator on the home's LAN. These run on led as containers but belong logically to the home. |
Adjacent led services the platform draws on but doesn't own: Ollama, Whisper (speech-to-text), ComfyUI, Uptime Kuma, Beszel β shared fleet infrastructure, out of scope for this document.
GET /api/v1/homes/:homeId/tracking sit behind a requireHomeAccess('homeId') middleware: the caller's grants are checked against the specific home in the URL before any data is read. A user with access to one home gets nothing from another by changing the ID β the check runs first, every time.location tag filter β so the relational record and the time-series tags are joined by the home slug (bartlett-glen, β¦)./homes/<home>/<imei>/data-report βββΆ ingest decodes βββΆ Influx measurement gnss βββΆ app /tracking βββΆ Leaflet map
location (home slug), entity_id (IMEI), id (home UUID); fields latitude, longitude, altitude, rsrp_dbm (LTE signal), battery_pct; button presses are stored as a separate button field series.Raw GPS dots can be re-drawn snapped to the path network. Because the badge is worn by a person walking β footpaths and cut-throughs included, not just roads β matching uses the OSRM foot/walking profile. Design (as directed 2026-10-31): the existing tracking route takes an opt-in snap parameter; the server sends the already-authorized points to a private OSRM container on led (BC OpenStreetMap extract) and returns snapped positions + a path-following line in the same response. Nothing leaves the fleet, per-home authorization is untouched, and between sparse fixes the line is honestly labelled in the UI as a plausible walking route, not a recorded trace. (First cut briefly called the public OSRM demo from the browser; replaced the same day for privacy.) A second container, osrm-car (driving profile), covers vehicle trips β the Dots control offers βSnapped to roads (car)β β because the foot profile structurally cannot trace a drive (measured 2026-10-31: a 4.5 km drive fragmented into ~1.6 km of matching on foot; the driving profile matched it as one 7,979 m road-following segment). The path line is drawn as separate segments per matched stretch β a gap means that stretch could not be matched, never a straight bridge. Multiple badges per home are supported end to end: ingest accepts any /homes/<home>/<imei>/data-report topic, the tracking route returns every device for the home unless entity_id is given, snapping runs per device (a separate OSRM trace per badge β tracks are never stitched together), and the Tracking view distinguishes badges by colour and shape (first badge round dots, later badges diamonds) with per-device toggle buttons. The view opens on the car profile with the path line on (Glenβs call: foot matching proved unreliable at badge fix rates). Stay suppression: a badge sitting in the house still reports wandering fixes tens of metres apart, and tracing those made OSRM invent trips along the street β so consecutive fixes that stay within 75 m of their running centroid (β₯ 2 fixes) are treated as a stay: those points keep their raw positions and produce no line; OSRM traces only the movement between stays, anchored on the stay centroids. The snap response also carries per-fix legs (the road geometry from the previous fix to each fix, sliced from the OSRM matching at its tracepoints), and the time-bar playback uses them: press play and the road line draws itself leg by leg as the gold fix marker travels the day, per device in its own colour β the static line hides during playback and returns when it ends. Playback is a position, not a one-shot: the play button pauses and resumes (position and drawn line persist), and the gold playhead sits on the time bar whenever data is loaded β no need to start playback first β and can be dragged to scrub β the line and the gold fix follow the drag in both directions, so you start the replay exactly where you want it. Speeds run β
Γβ4Γ (right-click the play button); a full day at 1Γ takes 30 s. A Trail slider beside the play button (1 min β 1 h of data time, default 10 min, far left = full line) keeps only that much route drawn: the tail is eaten away oldest-first with fading opacity tiers, so the line reads as a comet behind the travelling fix.
unless-stopped. Glen's own services run under nodemon deliberately β he edits code directly on the production box and the watcher picks changes up live. There is no git for the eldershire codebase; the live copies in /docker are the source of truth (known risk, accepted).reconnectPeriod: 0 (auto-reconnect off), so the process simply ran out of work and exited cleanly; nodemon doesn't restart clean exits; Docker saw a live container and did nothing. For four weeks the badge kept reporting to the broker and every report was discarded, while the container showed "Up" and the Tracking map quietly emptied. Diagnosed and fixed 2026-10-31: reconnect every 5 s, a close-event log line, non-zero exit on the auth-failure path, and exitcrash: true in a new nodemon.json β so a crash now exits the container and Docker's restart policy revives it. The stored Influx history was intact throughout; only the live feed had stopped./socket.io/ route on eye points at a port where nothing listens (likely a typo for :9000).| Store | Holds | Notes |
|---|---|---|
| PostgreSQL | Homes, access grants, residents, entities, config | Container com.eldershire-postgres; the app's only relational store. |
| InfluxDB | All time series: gnss tracks + household measurements | Bucket/org eldershire.net. Retention effectively unbounded today β the badge alone has 3,559 points back to May 2026. |
| Files (ingest) | Topic / decode / write logs | /docker/net.eldershire.ingest-node/*.log β the first place to look when data stops; their mtimes are a liveness signal. |
| OSM extract (OSRM) | BC path/road network for snap-to-path | Built from the Geofabrik British Columbia extract; refresh = re-download + rebuild. |
eldershire design Β· as built 2026-10-31 Β· companion to the Servers page inventory. Corrections welcome β this document describes the system as inspected, not as intended.