feat(api): geocode member city/region to lat/long on save
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- typescript
- Bereich
- backend-api-design, databases
Rechercherichtung
Read packages/api/src/routes/me.ts and packages/api/src/routes/admin/users/byId.ts, then inspect packages/api/src/db/schema/users.ts:103-115. Coordinate the Nominatim or Mapbox choice with #1969 before shaping the shared pipeline. Done means address changes and the backfill script populate coordinates, preserve existing values on failure, log failures, and record successful geocoding.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
profiles already has city, region, countryId, latitude, longitude, and showOnMap columns, but latitude/longitude are never populated automatically — they exist only because someone manually wrote to them. A geocoding pipeline should run on profile address changes so map placement just works.
Requirements
- On
PATCH /me/profile(packages/api/src/routes/me.ts): whencity,region, orcountryIdchanges, enqueue or inline-call a geocoder - On
PATCH /admin/users/:id(packages/api/src/routes/admin/users/byId.ts): same trigger when an admin edits the address fields - Geocoded values write to
profiles.latitude/profiles.longitude; if the geocode fails (no result, rate-limited, network error) the existing lat/long stays put and we log the failure - A nullable
profiles.geocoded_attimestamp records the last successful geocode — distinguishes "never tried" from "tried, no result" - Backfill script
packages/api/scripts/geocode-profiles.tsfor the existing roster: iterate over profiles with city + country and no lat/long - Geocoder choice (Nominatim vs Mapbox) decided in coordination with #1969 — orgs and members should use the same one
Context
profiles.{city, region, countryId, latitude, longitude} already exist (packages/api/src/db/schema/users.ts:103-115). The map plumbing on the web app reads these — populating them is the missing link.
Pairs with #1969 (org-side addresses + geocoding) — same pipeline serves both.
Implementation Notes
Nominatim has a 1 req/sec public rate limit + a User-Agent header requirement; that's plenty for an admin PATCH but means the backfill script needs a setTimeout delay between calls. Mapbox is faster but needs an API key + budget. Decide once for both #1969 and this issue and reuse the same lib/geocode.ts.
- Vorherrschende Sprache
- HTML
- Sterne
- 33
- Forks
- 107
- Ø Merge
- 14 Std. 6 Min.
- Gemergte PRs (30 T.)
- 19
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus USRSE/usrse.github.io
-
update community awardsOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
USRSE/usrse.github.io#2117 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 63/100
USRSE/usrse.github.io#2115 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
broken-links
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
USRSE/usrse.github.io#2099 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
USRSE/usrse.github.io#2085 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
USRSE/usrse.github.io#2001 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in USRSE/usrse.github.io
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
genfeedai/genfeed.ai#11828 ·
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement good first issue help wanted
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 83/100
NOAA-OWP/ngen#1110 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
ExpressionEngine/ExpressionEngine#5493 ·
Maintainer antworten meist innerhalb von 5 Tagen
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
-
integration: llama_cpp
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
home-assistant/core#195670 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag