Real business data via Google Places + Grow with BA rebrand#3
Open
growwithba wants to merge 2 commits into
Open
Real business data via Google Places + Grow with BA rebrand#3growwithba wants to merge 2 commits into
growwithba wants to merge 2 commits into
Conversation
Add a swappable data layer so listing pages can use real Google Places listings instead of the synthetic seeded-PRNG generator: - lib/places.ts: Google Places API (New) Text Search client + mapping to the Business shape (cost-scoped field mask). - scripts/fetch-places.ts: incremental, resumable cache builder (npm run fetch:places) writing data/listings.generated.json. - data/businesses.ts: getBusinesses() returns cached real data when present, else falls back to the synthetic generator so builds never break. Places-absent fields (tagline, yearsInBusiness, website, phone, hours) are now optional. - BusinessCard + LocalBusiness JSON-LD: guard optional fields; add a Google Maps link; only emit aggregateRating when real reviews exist. - Docs, .env.example, tsx devDep + fetch:places script.
Update the site identity in lib/site.ts (name, url, email, twitter, description) and replace hardcoded 'PrimeDirectory' copy in the about, contact, privacy, terms, and home pages. Header, Footer, and layout metadata already derive from SITE so they update automatically. Also rename the npm package to grow-with-ba.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related pieces of work to move the directory from demo toward production:
1. Real business data via Google Places API (
97c17c8)lib/places.ts— Google Places API (New) Text Search client + mapping to theBusinessshape, with a cost-scoped field mask.scripts/fetch-places.ts— incremental, resumable cache builder (npm run fetch:places) that writesdata/listings.generated.json. Supports--categories,--cities,--limit,--delay,--fresh.data/businesses.ts— newgetBusinesses(category, city)returns real cached data when present, otherwise falls back to the existing synthetic seeded-PRNG generator so the build never breaks. Places-absent fields (tagline,yearsInBusiness,website,phone,hours) are now optional.BusinessCard+LocalBusinessJSON-LD — guard optional fields, add a Google Maps link, and only emitaggregateRatingwhen real reviews exist..env.example(GOOGLE_PLACES_API_KEY),tsxdev dependency.2. Rebrand: PrimeDirectory → Grow with BA (
be37608)lib/site.ts(name, urlhttps://growwithba.com, email, twitter, description). Header, Footer, and layout metadata derive fromSITE, so they update automatically.grow-with-ba.Verification
tsc --noEmitcleannext buildgenerates all ~1,116 static pagesfetch:placeserrors cleanly without an API key; no remaining "PrimeDirectory" referencesNotes / follow-ups
data/listings.generated.jsonis empty{}— the site renders synthetic data untilnpm run fetch:placesis run with a real key. Fetching requires outbound access togoogleapis.comand a Places API (New) key with billing enabled.hello@growwithba.comand the phone is still the placeholder(800) 555-0142— worth confirming.https://claude.ai/code/session_01MYQxSyKx1CB5MuEd7UiE2P
Generated by Claude Code