A public directory where the API key never reaches the browser
A church search over live Airtable data. Staff edit a row and the site updates; the API key stays in a serverless function.
Problem
Someone looking for a church needs one near them that meets when they can attend. The old directory was a page someone updated by hand, so it was accurate the day it was published and drifted from there. Service times change often, and they matter most.
The people who know the right information are regional and church staff, not developers. Any design where changing a service time needs a developer guarantees the data will be wrong.
Constraints
- Non-technical editors. The source of truth has to be a tool staff already use comfortably.
- The API key cannot reach the browser. If a public page talks to the database directly, the key is in the page, and anyone can copy it from view-source.
- Addresses are text; maps need coordinates. Nobody is typing in latitude and longitude.
- Public and open, so it will be crawled, linked and hit by bots.
Options considered
Build the site from Salesforce at deploy time. The tidy answer on paper, but it puts a deploy between a corrected service time and the public seeing it, which is the exact problem this project set out to remove.
Query Airtable straight from the browser. The simplest build, and it hands the API key to every visitor. A read-only key is still a key.
Airtable as the source of truth, read through a serverless function. Chosen. Editors get a tool they already know, the public gets live data, and the key stays on the server.
Decision
Airtable holds the data; one serverless function is the only thing that holds the key.
The browser never talks to Airtable. It calls a small Netlify Function that holds the key, queries Airtable and returns only the fields the page needs. The page cannot leak a secret it was never given.
Two setup choices back that up, so it does not rely on being careful:
- Only one folder is published. The deploy settings publish the public folder and nothing else, so internal notes and tooling cannot end up on the live site by accident. The protection comes from the configuration, not from remembering what not to upload.
- The map library is self-hosted rather than loaded from a third-party CDN. A public directory should not hand every visitor's IP address to another company just to draw a map, and a pinned local copy cannot change underneath the site.
Geocoding runs on a schedule, not on page load
A second function runs daily, finds churches without coordinates, looks up their addresses and writes the coordinates back to Airtable. By the time a visitor arrives, the coordinates are just data. Geocoding on page load would have meant a paid third-party call for every map view, and a half-drawn map whenever that call was slow.
Build
Three Airtable tables (churches, services and pastors) linked by a shared organization ID that already existed as a real key. A church can have several services and several pastors, so those are rows rather than columns, which is what makes filtering by service day and time possible.
The front end offers card, list and map views over the same filtered results, with search across church and pastor names. Each church also gets its own static page, so an individual listing is a real, crawlable link rather than a pop-up that only exists after JavaScript runs.
The styling follows the organization's existing brand, because a directory that looks like a different organization reads as unofficial.
Evidence
Open the demo with the Try the demo button at the top of this page, or from Selected work on the home page. It rebuilds the directory pattern with made-up churches, not the live site.
The two claims that matter are easy to check in a setup like this. Change a service time in Airtable and the site shows it on the next page load, with no build, deploy or developer. View the page source and there is no key, because the only code that holds one runs on the server.
Outcome
Staff keep the directory current in a tool they already know, and the public sees live data. Changing a field is an edit, not a release.