Skip to content

Latest commit

 

History

History
29 lines (29 loc) · 6.76 KB

File metadata and controls

29 lines (29 loc) · 6.76 KB
  • html escape event titles
  • cron shouldn't need to hit the API, just call the code directly
  • break the cron script into many files
  • make sure events are always sorted by date. When ingesting events assume they are this year, or next year if the event is listed in a month that has already happened this year and no other year is specified.
  • search for Michelin star releases in San Francisco every 3 days. When this list is introduced add the restaurants to the table, but in the opened column list the count of stars and the date they received them. Use a SVG of the Michelin star.
  • are push notifications actually sent? This should probably be a part of cron or a trigger function in PG?
  • clean up logging to use console.info/warn/error instead of just console.log. Consider console.log for debugging only. Write a logging skill that codifies how we've been logging.
  • write a readme that lets the user know how to configure a dev env
  • convert from express to astro; avoid JS on the client as much as possible.
  • Add personalized alerts instead of one global push stream. The UI already has a single bell control and push setup, but delivery is broadcast to every subscriber with the same message payload. Add preferences for neighborhood, cuisine, dietary flags, and event category, then filter pushes server-side. src/pages/index.astro (line 70) src/scripts/home.ts (line 350) server/refresh.ts (line 25)
  • Add richer filters and shareable URLs. The current product surface is two searchable tables with substring matching only, even though the data model already has structured dates, is_upcoming, and dietary flags. I’d add chips for neighborhood, cuisine, dietary flags, “upcoming only”, and date range, with URL query state for deep links. src/pages/index.astro (line 96) src/pages/index.astro (line 250) src/scripts/home.ts (line 226) migrations/0007_structured_dates_and_event_dedupe.sql (line 1)
  • Add detail pages for restaurants and events. You already store enough metadata for higher-value pages: address, menu URL, source URL, description, structured dates. Individual pages would improve sharing, SEO, and give you space for maps, source history, and related items. src/pages/index.astro (line 137) src/pages/index.astro (line 289)
  • Push visibility and filtering into SQL. Right now the code selects full tables and filters in memory, even though you already added date columns and indexes. That will become the first scaling limit. server/storage.ts (line 211) server/storage.ts (line 225) migrations/0007_structured_dates_and_event_dedupe.sql (line 21)
  • Add a durable restaurant identity and DB-level upsert. Events have a unique dedupe key in the database; restaurants are still deduped by name in application code. That is fragile for race conditions and duplicate names. I’d add a normalized identity key or a stricter unique constraint plus ON CONFLICT. server/refresh.ts (line 65) server/storage.ts (line 290) migrations/0007_structured_dates_and_event_dedupe.sql (line 19)
  • Send delta/version realtime events instead of “refresh everything”. The current SSE path broadcasts generic refresh events, and the client refetches whole lists plus last-updated. That is simple, but it scales poorly and adds UI latency. server/refresh.ts (line 110) src/scripts/home.ts (line 292)
  • Remove duplicated row rendering. Restaurant and event rows are rendered once in Astro and again as HTML strings in the client script. That duplication will drift as features are added. Consolidate rendering behind one component/template path. src/pages/index.astro (line 128) src/pages/index.astro (line 281) src/scripts/home.ts (line 138) src/scripts/home.ts (line 188)
  • Fix docs and deploy/runtime drift. The README still describes Express + React/Vite and dist/index.cjs, package.json says Astro and dist/server/entry.mjs, and render.yaml still starts dist/index.cjs. bin/build.ts does not build dist/index.cjs at all. That mismatch is worth fixing before further deployment work. README.md (line 3) README.md (line 119) package.json (line 7) package.json (line 19) render.yaml (line 18) bin/build.ts (line 16)
  • Add map and “near me” views.
  • Add calendar actions for events. Event detail pages have date/time/location but no “Add to Calendar” affordance in src/pages/events/[id].astro:70. An .ics endpoint or client-generated calendar link would be a clean next feature.
  • Improve alert preferences with cadence and quiet hours. Push preferences exist for content matching, but delivery is immediate and device-scoped. Add cadence: instant, daily digest, weekly digest, plus quiet hours. This fits the existing push_subscriptions.preferences model.
  • The product copy says Mission District events in src/pages/index.astro:255, but the data includes broader SF neighborhoods. Make the product “SF events” with neighborhood filters.
  • Make event inserts conflict-safe. events.dedupe_key is unique, but addEvent() does a plain INSERT in server/storage.ts:429. Restaurants already use ON CONFLICT; events should too, otherwise concurrent refreshes can fail.
  • Keep realtime deltas sorted after updates. updateCollection() preserves map insertion order, then the table is rerendered in src/scripts/home.ts:621. New or updated events can appear out of timeline order until a full refresh. Add shared sort helpers after deltas.
  • Move event visibility/filtering into SQL. Restaurants have SQL visibility filtering, but getVisibleEvents() just returns all events through server/storage.ts:420. Add date-window filtering, ordering, and eventually pagination/query params.
  • Remove duplicated domain types. DietaryFlags, Restaurant, and event-ish types are defined in both shared/types.ts:1 and server/storage.ts:15. Split DB row types from public API types, then map explicitly.
  • Split src/scripts/home.ts. The home script handles SSE, push subscription state, filter URL state, rendering, toasts, and event-description measurement in one ~700-line file. Split into filters, push, realtime, and eventDescriptions, then add focused DOM tests.
  • Add a transaction/outbox boundary around refresh writes. applyDiscoveredItems() writes rows, records updates, broadcasts, and sends push from one orchestration path in server/refresh.ts:472. Use a DB transaction for row/update writes, then broadcast/send push after commit.
  • Reduce manual route duplication. Astro API routes delegate to shared handlers, but server/app.ts:62 manually re-declares the same route table for tests/standalone HTTP. A shared route registry would reduce drift.
  • Replace production placeholder VAPID subject. getVapidConfig() hardcodes mailto:sf-pulse@example.com in server/security.ts:104. It is not a secret, but production config should come from VAPID_SUBJECT and fail clearly if missing in production.