feat(api): geocode member city/region to lat/long on save
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- typescript
- Área
- backend-api-design, databases
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- HTML
- Estrellas
- 33
- Forks
- 107
- Merge medio
- 14 h 6 min
- PR fusionados (30 d)
- 19
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de USRSE/usrse.github.io
-
update community awardsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
USRSE/usrse.github.io#2117 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 63/100
USRSE/usrse.github.io#2115 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Broken URLs on the websiteAbiertobroken-links
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
USRSE/usrse.github.io#2099 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
USRSE/usrse.github.io#2085 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
USRSE/usrse.github.io#2001 ·
Los mantenedores suelen responder en 1 día
Todos los issues de USRSE/usrse.github.io
Issues similares
-
Calc 1.1: inconsistent duplicate facts with equal `decimals` don't stop the calculation checkAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
rubenarslan/formr#63 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
StreamPipe input stream: readWithTimeout(n, 0) blocks forever instead of returning immediatelyAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
qoretechnologies/qore#8159 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día