You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A zero-cost community resource directory built on HSDS 3.0, powered by Cloudflare Workers and Vercel. Features natural-language search via LLM chatbot, an MCP server for AI agent access, and Google Geocoding for accurate map pins.
Token-based search with stemming replaces raw LIKE queries:
Stemming: "food pantries" matches "food pantry" (37 results vs 1)
Relevance ranking: Name (3x) > Description (2x) > Org name (1x)
Indexed: Prefix matching on the search_tokens table
Fallback: Degrades to LIKE when token index is empty
Sync
Incremental sync compares Airtable's modifiedTime against D1's updated_at:
Steady-state: 0-10 writes/cycle (down from ~2,134)
Token index + icon cache rebuilt after each sync
Category icons cached as base64 in D1 (avoids expiring Airtable signed URLs)
Quick Start
Prerequisites
Node.js 18+
Wrangler CLI: npm install -g wrangler
Airtable Personal Access Token (read-only scope)
1. Clone and setup
git clone https://github.com/sarapis/hsd.git
cd hsd
2. Worker (API backend)
cd worker
npm install
# Authenticate with Cloudflare
wrangler login
# Create D1 database
wrangler d1 create hsds-directory
# Update wrangler.toml with your database_id, then execute local schema:
wrangler d1 execute hsds-directory --local --file=src/db/schema.sql
# Set secrets
wrangler secret put AIRTABLE_API_KEY
wrangler secret put SYNC_SECRET
wrangler secret put GOOGLE_GEOCODING_API_KEY # optional, for geocoding# Local dev
npm run dev
# Deploy
wrangler deploy
3. Frontend
cd hsdirectory-v2
npm install
# Configure API URL for local developmentecho"NEXT_PUBLIC_API_URL=http://localhost:8787"> .env.local
# Local dev
npm run dev
# Deploy to Vercel (Production)# 1. Pull settings and variables
npx vercel pull --yes --environment production --scope YOUR_SCOPE
# 2. Build Next.js locally with target env
NEXT_PUBLIC_API_URL=https://services-api.wegov.nyc npx vercel build --prod --yes --scope YOUR_SCOPE
# 3. Deploy prebuilt bundle
npx vercel deploy --prebuilt --prod --scope YOUR_SCOPE
4. Initial data seed
# Trigger Airtable → D1 sync
curl -X POST https://services-api.wegov.nyc/sync/trigger \
-H "Authorization: Bearer YOUR_SYNC_SECRET"# Cache category icons (run until remaining=0)
curl -X POST https://services-api.wegov.nyc/sync/icons \
-H "Authorization: Bearer YOUR_SYNC_SECRET"# Geocode addresses (batches of 10, run until remaining=0)
curl -X POST https://services-api.wegov.nyc/sync/geocode \
-H "Authorization: Bearer YOUR_SYNC_SECRET"
API Endpoints
Public
Method
Endpoint
Description
GET
/
API metadata (HSDS 3.0)
GET
/health
Health check with service count
GET
/services
Paginated services (?search=, ?page=, ?per_page=)
GET
/services/:id
Full service detail with nested relations (UUID format support)
A free-to-host (Cloudflare/Vercel) app that takes an HSDS3.0 Airtable Template and generates a front end resource directory and ORUK compliant API feed.