Architecture
One Render web service holds one deep module, the Community Radio API, and everything else is a client of it. The numbers are the pitch map's twelve components. Orange is built or in the first build; grey dashed is later; blue is Chuck's public site.
Drawn 2026-10-14 PT with the spec (#49); refreshed 2026-10-22 PT against what is on main: sign-in released from its hold (#59), mail live through Resend, the program directory built, one Person per email address (ADR 0007), and the compartments as the import check enforces them. On 2026-10-23 PT the public website was drawn as its own Render service, tbr-www (#228). Refreshed 2026-11-05 PT: sign-in built (#59), the check-in page moved onto tbr (#330), the licence ruled (#105), the daily job on Render, the layers as the import check holds them now, install by photo and Import photos (#485), and two changes to come, a typed position (#591) and a sign of the wrong colour (#601). Back to the map.
The twelve components and three seams
The services on Render
The public website is not part of the Django service. It is a Render service of its own, tbr-www, with its own deploy, serving the files in site/public at tahoebackcountryradio.org. Like a map app, it is a client of the Community Radio API (ADR 0003).
| Service | On Render | What it serves |
|---|---|---|
tbrtbradio.org | web service, Django | The Community Radio API and every page of the application, the check-in page included (#330). |
tbr-event-remindersno address | cron job, daily at 00:00 UTC (4 PM PST, 5 PM PDT) | The daily job, tbr's code: event reminders, the next batch of mailings, event banners, spare sign reminders. |
tbr-dbno public address | Postgres 18 | Every program's data. Personal data is kept here and nowhere else. |
tbr-wwwtahoebackcountryradio.org | static site | The public website, Chuck's site in site/, a client of the API. Its old check-in address sends people on to tbradio.org/checkin/. |
tbr-journeyjourney.tbradio.org | static site | This journey site, from journey/. |
Inside the module: the feature areas
The twelve components are plumbing. The things the program does live as feature areas inside the one module, each with its rules there and its screens above seam 1. No feature is a service of its own.
Seam 4 · between the compartments
Inside the module the compartments are kept apart the way the module is kept apart from its callers: each has one interface, its tables are private, and dependencies run one way down a fixed order. The import check in every test run fails the build when a compartment reaches across or upward (ADR 0005). The layers below are the ones that check enforces on main today.
One interface each
A compartment exposes one service module of plain functions. Models and tables stay inside; another compartment refers to a row by id.
Downward calls, no events
Every cross-compartment effect we know of runs downward, so direct calls suffice. Domain events are the named fallback in ADR 0005.
Tests follow the interfaces
A compartment is tested through its own interface with the compartments below it real and the adapters faked.
The three seams
Seam 1 · the API's interface
The questions the module answers and the commands it accepts, each scoped to a program. Import, the read API, the feeds, the public pages and the admin pages cross it; tests cross it where callers do.
Change behind it: a table, a rule, the matching distance. Nothing above notices.
Seam 2 · the web
Public reads with no key and no personal data, from any origin, so Chuck's site and a map app can read them. Public writes are narrow (a check-in, an email sign-up); everything else needs a signed-in person.
Change behind it: move the API to its own service, add tiles. Addresses stay.
Seam 3 · the adapters
Each outside source sits behind one small interface: avalanche forecast, station readings, email. Tests replace each with a recorded fake, including an expired forecast and a silent station.
Change behind it: swap a weather source, with no change to a page.
The public read API
Every address names the program (ADR 0002). The live explorer at tbradio.org/api/ documents each one; this is the map of them.
| Address | Returns | Who uses it | State |
|---|---|---|---|
| GET /api/v1/programs.json | The directory of programs (component 10): tbr, front-range and red-mountain today. | Map apps, other programs | built |
| GET …/programs/tbr/zones.geojson | The 23 zone outlines with name, colour, channel and privacy code. | Chuck's site, the planning page, map apps | built |
| GET …/programs/tbr/sign-locations.geojson | The 55 trailheads and huts with zone and sign counts by sign state, and each sign with its type, state and sign position. | Chuck's site, the check-in page, the planning page | built |
| GET …/programs/tbr/channels.json | Each colour's channel and privacy code, and the out-of-zone channel. | Chuck's legend, the planning page | built |
| GET …/programs/tbr/events.json | The events list, typed in the admin. | Chuck's events page | built |
| GET …/programs/tbr/conditions.json | Each trailhead's weather stations and avalanche forecast zone, with what each shows now. | The planning page, the check-in page | built |
| GET …/programs/tbr/banner.json | The banner the website shows under its top bar now, if one is on. | Chuck's site | built |
| GET …/programs/tbr/sources/<file> | The committed files the program was stood up from. | A program bringing its own data | built |
| …?changed_since=<time> | Only what changed after that time. | Map apps keeping a copy fresh | built |
| GET /feeds/tbr/zones.geojson · zones.gpx · sign-locations.geojson | The publishing feeds, files anyone can download. | GPS units, map apps, old WordPress links | built |
| POST …/programs/tbr/check-ins | A check-in from the check-in page, anonymous or by email. | The check-in page | built |
| POST …/programs/tbr/subscribe | An email sign-up, confirmed by email. | Chuck's site | built |
| POST …/programs/tbr/installs | An install record, signed in only. | The install page (#65), install by photo (#485) | built |
| POST …/programs/tbr/take-downs | A sign taken down for the summer, signed in only. | The install page (#432) | built |
| POST …/programs/tbr/steward-reports | A Trail Steward Report, signed in only. | The Trail Steward Report page (#428) | built |
| POST …/usage · …/page-views | Counts with no personal data: what a phone did on a screen; page opens. | The pages themselves | built |
| POST, PUT … with a program key | The management API (component 3). | A peer program's tool | later |
| GET /tiles/… and TileJSON | Zone tiles for Gaia's catalogue layer. | Gaia | later |
Never on this API: AHJ contacts, people, check-ins as a list, Trail Steward Reports, depot addresses. Those stay behind the admin pages.
The twelve components, and where each stands
| # | Component | What it is | State |
|---|---|---|---|
| 1 | Data store | One Postgres on Render; every row carries its program; personal data here and nowhere else. An encrypted copy is taken daily off Render. | built |
| 2 | Public read API | GeoJSON and JSON by program, changed-since, no key, no personal data. | built |
| 3 | Management API | The same objects, writable, one key per program. | later |
| 4 | Program admin pages | Today (#465), layouts A and B, a sign location's record, tickets and depots, people and roles, the install page with install by photo, and Import photos (#485). Django's admin stays for raw fixes. To come: typing a sign's position when a photo has none (#591), and a sign of the wrong colour recorded, warned of and replaced (#601). | built 2 to come |
| 5 | Import | One command with a dry run; a stand-up never undoes field work (ADR 0006). | built |
| 6 | Publishing feeds | GeoJSON and GPX per program; KML and tiles later. | built |
| 7 | Identity and keys | The email link and six-digit code, signed in until September 1 (ADR 0004, #59); program keys later. | built |
| 8 | Public website | Chuck's static site, in this repo, published by its own Render service, tbr-www, at tahoebackcountryradio.org. A client of the read API, with the feeds and its own events list to fall back on; its old check-in address sends people on to tbradio.org (#330). | live |
| 9 | Public pages | The check-in page (#54) and the planning page (#55, #56), with live conditions, both served by tbr since #330. To come: both warn skiers when a trailhead's sign is the wrong colour (#601). | built 1 to come |
| 10 | Directory of programs | How a map app finds every program the API holds. | built |
| 11 | Licence and terms | The API's data under CC BY 4.0, ruled 2026-10-16 PT (#105): credit the program named in the directory. | ruled |
| 12 | Outside sources | Avalanche forecast (avalanche.org), SNOTEL readings, the stations on SAC's map and the NWS forecast, each trailhead's named in the station table (ADR 0008), and email through Resend, each behind an adapter. | built |
Where this is written down
- ADR 0002, every row belongs to a program; ADR 0003, one server and the website is a client; ADR 0004, email-link sign-in for the season; ADR 0005, compartments with one-way dependencies; ADR 0006, a stand-up never undoes field work; ADR 0007, the email address is the Person (superseding ADR 0001); ADR 0008, outside data comes from a station table.
- The spec, #49, on the map, #37. The glossary,
GLOSSARY.md, for every word used here.