Skip to content

86larryli/SafeBite

Repository files navigation

SafeBite icon

SafeBite

See a restaurant's health inspection result — right from its Google Maps listing.

CI License: MIT Manifest V3

County health departments inspect every restaurant and publish the results — the California placard (Pass / Conditional Pass / Closed), a numeric score where the county issues one, and the specific violations — but that information lives on a different site for every county and almost nobody looks it up. SafeBite surfaces it on the map, where you're already deciding where to eat.

How it works

  1. Detect — on a restaurant's Google Maps listing, SafeBite reads the place's name, address, and coordinates from the page.
  2. Route — it maps the restaurant's city/ZIP to the county that inspects it.
  3. Look up — the background service worker queries that county's Source (an open-data API, or the county portal) for the facility's inspections.
  4. Match — it links the Maps place to the right facility strictly (geo-first, with a name/address tiebreak); if it can't be sure, it says so and links out rather than guess.
  5. Show — an inline card with the latest placard (+ score where the county issues one), the inspection date, the latest inspection's violations, and a list of past inspection results, plus a link to the official record.

Everything runs locally in your browser — there's no server. See PRIVACY.md.

Supported counties

County Data source Score? Notes
San Francisco DataSF open data (Socrata) No (SF dropped scores in 2020) Auto-loads
Santa Clara (San Jose) County open data (Socrata) Yes (0–100) Auto-loads
San Mateo County MyEHS portal No Tap-to-load, with a deep-link fallback

New counties are added as Sources — see Contributing.

Install

From the Chrome Web Store: coming soon.

From source (for development):

git clone https://github.com/86larryli/SafeBite.git
cd SafeBite

Then open chrome://extensions, enable Developer mode, click Load unpacked, and select the extension/ folder. Open a restaurant on Google Maps in a supported county to see its inspection card.

Development

npm ci
npx playwright install --with-deps chromium

npm run lint        # ESLint
npm run test:ci     # deterministic test suite (the CI gate)
npm test            # everything, incl. live tests
npm run package     # build dist/safebite.zip for the store
npm run icons       # regenerate icon PNGs from extension/icons/icon.svg

The deterministic tests run each Source's normalization and the matching logic against captured API fixtures with the network blocked. The live: end-to-end tests drive real Google Maps + county data and are excluded from CI (manual smoke tests).

Architecture

SafeBite is plain JavaScript with no build step — a deliberate choice for fast load-unpacked iteration. The design and its rationale are written down:

  • CONTEXT.md — vocabulary (Placard, Score, Source, Match, …)
  • PLAN.md — flow, scope, and phased build
  • docs/adr/ — architecture decision records

Contributing

Contributions — especially new county Sources — are welcome. See CONTRIBUTING.md for the dev setup and a step-by-step Source guide. Releases are documented in docs/RELEASING.md.

Privacy

SafeBite collects nothing and has no backend; it only reads the Maps page you're on and queries public county inspection data to build the card. Full policy: PRIVACY.md.

License

MIT © Larry Li

About

See a restaurant's health inspection result right on its Google Maps listing (Chrome MV3 extension).

Resources

License

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors