Wire location discovery on home page (GET /locations/nearby) #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lineage
plan-mcd-tracker→ Phase 7a (Location Discovery + Navigation)Repo
forgejo_admin/mcd-tracker-appUser Story
As a new user with zero saved locations
I want to see nearby McDonald's when I open the home page
So that I can browse, navigate to one, and start using the app immediately
Context
The home page currently shows only saved locations from GET /dashboard (empty for new users). The API already has GET /locations/nearby?lat=X&lng=Y which returns McDonald's from OpenStreetMap. The playground home.html design already has the layout. Wire the data: GPS on mount → fetch nearby → render location cards.
File Targets
Files to modify:
src/routes/home/+page.svelte— add onMount GPS → GET /locations/nearby, render results in a "Nearby" section above saved locationssrc/lib/api.js— may need an unauthenticated fetch variant if /nearby should work pre-login (check if it does)Files NOT to touch:
src/lib/keycloak.js— auth is finesrc/routes/+page.svelte— landing page, unrelatedAcceptance Criteria
Test Expectations
npm run dev -- --host(test via dev overlay)Constraints
Checklist
Related
mcd-tracker— projectplan-mcd-tracker— Phase 7aphase-mcd-tracker-7a-location-discovery