mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-23 16:26:42 +02:00
feat(places): add self-hosted geocoding with Pelias (DACH)
New mana-geocoding service (port 3018) wraps a self-hosted Pelias instance with LRU caching and OSM→PlaceCategory auto-mapping. All geocoding queries stay within our infrastructure — no user location data leaves the network. Places module integration: - Address autocomplete search in ListView (creates place with name, coords, address, category in one step) - Address search + reverse geocoding button in DetailView - Auto-fill address via reverse geocoding during tracking - OSM category mapping (amenity:restaurant→food, shop:*→shopping, etc.) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f5ad492371
commit
a47a7bfdba
21 changed files with 1519 additions and 34 deletions
32
services/mana-geocoding/src/app.ts
Normal file
32
services/mana-geocoding/src/app.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/**
|
||||
* App factory — separated from index.ts so tests can import without
|
||||
* triggering the production bootstrap.
|
||||
*/
|
||||
|
||||
import { Hono } from 'hono';
|
||||
import { cors } from 'hono/cors';
|
||||
import type { Config } from './config';
|
||||
import { healthRoutes } from './routes/health';
|
||||
import { createGeocodeRoutes } from './routes/geocode';
|
||||
|
||||
export function createApp(config: Config): Hono {
|
||||
const app = new Hono();
|
||||
|
||||
app.onError((err, c) => {
|
||||
console.error('Unhandled error:', err);
|
||||
return c.json({ error: 'internal_error' }, 500);
|
||||
});
|
||||
|
||||
app.use(
|
||||
'*',
|
||||
cors({
|
||||
origin: config.cors.origins,
|
||||
credentials: true,
|
||||
})
|
||||
);
|
||||
|
||||
app.route('/health', healthRoutes);
|
||||
app.route('/api/v1/geocode', createGeocodeRoutes(config));
|
||||
|
||||
return app;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue