Progressive Web App: a read-only Bay Area ethical coffee map built on the Facerix vanilla PWA template. Curated shop data in JSON is plotted on Google Maps; tapping a pin opens a custom panel with your copy plus Google Place Details when a placeId is set.
- No frameworks — ES modules, Web Components for shell UI,
h()fromsrc/domUtils.jsfor map popup DOM - DataStore — Still initialized for future phase (favorites / notes); shop locations are not stored in DataStore (see
data/shops.json) - Service worker — App shell + map modules precached;
/data/shops.jsonis network-first; Google Maps/Places requests bypass SW caching
npm install- Copy
config.example.jsontoconfig.json(gitignored) and setgoogleMapsApiKeyto a browser key with Maps JavaScript API and Places API (New) enabled. Restrict the key by HTTP referrer in Google Cloud Console. Advanced markers require a map ID;shopMap.jsusesDEMO_MAP_IDby default—create your own in Google Cloud Console for production. npm start→ open http://localhost:8080
JSON array of objects. Required for each shop:
| Field | Type | Description |
|---|---|---|
id |
string | Stable id (e.g. for future favorites in DataStore) |
name |
string | Title shown in popup |
lat |
number | Latitude |
lng |
number | Longitude |
Optional:
| Field | Type | Description |
|---|---|---|
placeId |
string | Google Place ID — enables Place Details in the popup |
summary |
string | Your editorial blurb |
values |
string[] | Tags (e.g. fair_trade, b_corp) for future filters |
links |
object[] | { "label": "…", "url": "https://…" } |
Shops missing placeId still appear on the map; the Google block is omitted from the popup.
You can find placeId using Google's PlaceID finder tool. Lat/lng require a little digging around Google Maps and pulling it from the URL.
- Start server:
npm start(live-server at http://localhost:8080) - Lint:
npm run lint - Format:
npm run format
data/shops.json # Curated shops (committed)
config.example.json # Template for config.json
src/maps/
loadMapsScript.js # Google Maps JS + places library
shopMap.js # Map, markers, click → popup
shopPopup.js # Hybrid curated + Google UI
placeDetailsCache.js # In-memory Place Details cache
Based on the Facerix PWA template by Rylee Corradini.