feat(api): geocode member city/region to lat/long on save
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- backend-api-design, databases
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- HTML
- Stelle
- 33
- Fork
- 107
- Merge medio
- 14h 6m
- PR unite (30g)
- 19
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di USRSE/usrse.github.io
-
update community awardsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
USRSE/usrse.github.io#2117 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 63/100
USRSE/usrse.github.io#2115 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Broken URLs on the websiteApertabroken-links
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
USRSE/usrse.github.io#2099 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
USRSE/usrse.github.io#2085 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
USRSE/usrse.github.io#2001 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di USRSE/usrse.github.io
Issue simili
-
Calc 1.1: inconsistent duplicate facts with equal `decimals` don't stop the calculation checkAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
rubenarslan/formr#63 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
StreamPipe input stream: readWithTimeout(n, 0) blocks forever instead of returning immediatelyApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
qoretechnologies/qore#8159 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno