Commit Graph
3 Commits
Author SHA1 Message Date
robbertjanssen85andClaude f61990332f Add REST API and address search features with Dutch municipality name handling
This commit adds two major features to the pakketpunten webapp:

1. REST API (OpenAPI 3.0.3 compatible):
   - Endpoint: GET /api/v1/municipality/{identifier}
   - Supports 3 identifier types: municipality name, slug, CBS code
   - Rate limiting: 100 requests per 15 minutes
   - CORS enabled for public access
   - Interactive Redocly documentation at /api/v1/docs
   - CBS codes merged into municipalities.json (342 municipalities)

2. Address Search with Autocomplete:
   - Real-time address search using PDOK Locatieserver API
   - Autocomplete suggestions with 300ms debounce
   - Keyboard navigation support (arrows, Enter, Escape)
   - Automatic municipality switching and map zoom to address
   - Comprehensive Dutch municipality name mapping for edge cases

Dutch Municipality Name Handling:
   - Apostrophe cases: 's-Gravenhage → Den Haag, 's-Hertogenbosch → s-Hertogenbosch
   - Bergen disambiguation: Bergen (NH) → Bergen (NH.), Bergen (L) → Bergen (L.)
   - Regional identifiers: Hengelo (O), Beek (L), Laren (NH), Middelburg (Z), Rijswijk (ZH), Stein (L) mapped to simplified names
   - Handles all 13 known Dutch places starting with 's-

Bug Fixes:
   - Fixed font size inconsistency between municipality selector and address search
   - Fixed map zoom behavior - now stays at searched address instead of zooming back out
   - Fixed TypeScript build error with Redoc custom element

Files Added:
   - webapp/app/api/v1/municipality/[identifier]/route.ts - REST API endpoint
   - webapp/app/api/v1/docs/page.tsx - Redocly documentation page
   - webapp/app/api/geocode/route.ts - PDOK proxy API for address search
   - webapp/components/AddressSearchInput.tsx - Address search component
   - webapp/public/openapi.yaml - OpenAPI 3.0.3 specification
   - webapp/types/redoc.d.ts - TypeScript declarations for Redoc
   - scripts/merge_cbs_codes.py - Script to merge CBS codes
   - data/cbs_municipality_areas.json - CBS municipality data
   - docs/NEW_FEATURES.md - Comprehensive documentation

Files Modified:
   - webapp/app/page.tsx - Integrated address search with coordinate handling
   - webapp/components/Map.tsx - Enhanced zoom behavior for address search
   - webapp/next.config.ts - Added CSP rules for Redocly CDN
   - webapp/public/municipalities.json - Added CBS codes to all 342 municipalities
   - webapp/components/AboutModal.tsx - Minor updates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-06 14:12:36 +01:00
robbertjanssen85andClaude 2d31e75bcd Restore improved "Over" section with enhanced AboutModal
This commit restores previously stashed improvements to the About modal
and related documentation that were accidentally lost.

Major improvements:
- Real-time update status API integration showing carrier statistics
- Simplified tab structure (removed "Rapport" and "ACM Monitor", added "Externe Links")
- Enhanced "Over" section with acknowledgment to Gemeente Zwolle
- Better positioning for municipality/researcher support use cases
- Removed redundant technical stack details
- Cleaner data source listings (removed FedEx)
- Dynamic color-coded success/failure indicators per carrier
- Updated buffer distances from 300m/500m to 300m/400m throughout codebase

The restored changes improve user experience by providing:
- Live visibility into data freshness and quality
- More focused content for the target audience
- Better attribution and purpose statement
- Streamlined information architecture

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 20:12:36 +01:00
robbertjanssen85andClaude 25b49dc566 Add Amazon Hub integration and reorganize project structure
Major changes:

1. Project Reorganization
   - Move documentation to docs/ directory
   - Move data files to data/ directory
   - Move scripts to scripts/ directory
   - Improve project structure and maintainability

2. Amazon Hub Integration (OpenStreetMap)
   - Implement complete Amazon Hub data pipeline
   - Add amazon_fetch_all.py for OSM Overpass API fetching
   - Add integrate_amazon_data.py for municipality integration
   - Add get_data_amazon() function to api_client.py
   - Integrate into weekly_update.py workflow
   - Add comprehensive documentation in DATA_SOURCES.md

   Note: Amazon is currently DISABLED in pipeline
   - No Amazon location data in OpenStreetMap for NL
   - Infrastructure ready for future when OSM data available
   - Can be enabled by uncommenting code in api_client.py and weekly_update.py

3. Additional Provider Updates
   - Add DPD complete fetch and integration scripts
   - Add FedEx integration support (cache-based)
   - Update provider handling in api_client.py

4. Documentation Updates
   - Add Amazon Hub section with OSM attribution
   - Document alternative data sources explored
   - Update CLAUDE.md with current architecture
   - Reorganize all docs in docs/ directory

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-25 15:55:53 +02:00