99
1010## 🌟 Features
1111
12+ ### Core Functionality
1213- ** 🗺️ Interactive Map** - Explore fuel stations across the UK with real-time price data
14+ - ** 📍 Geolocation Support** - Automatically centers map on your location with one-tap positioning
15+ - ** 🔗 Shareable Links** - URL state management for bookmarking and sharing specific map positions
1316- ** 💰 Best Price Highlighting** - Automatically identifies and highlights the cheapest fuel stations
14- - ** 📱 Mobile Optimized** - Responsive design with touch-friendly controls and performance optimizations
15- - ** ⚡ Lightning Fast** - Powered by Cloudflare Workers with intelligent caching
1617- ** 🔄 Real-time Updates** - Aggregates data from 15+ major UK fuel retailers every 30 minutes
17- - ** 🎯 Smart Filtering** - Fuel type categorization (Unleaded, Diesel, Premium) with color-coded pricing
18+
19+ ### Smart Pricing & Display
20+ - ** 🎯 Consistent Fuel Ordering** - Standardized display: Unleaded → Diesel → Premium for easy comparison
21+ - ** 🧠 Dynamic Price Analysis** - Market-based thresholds that adapt to current fuel price trends
1822- ** 🏆 Competitive Analysis** - Advanced algorithms for best price detection with tie-breaking logic
19- - ** 📍 Viewport Persistence** - Remembers your last viewed location and returns you there on reload
20- - ** 📱 Offline Support** - Comprehensive offline functionality with cached fuel data and map tiles
23+ - ** 🎨 Smart Filtering** - Fuel type categorization with color-coded pricing (green/amber/red)
24+
25+ ### Performance & Experience
26+ - ** ⚡ Lazy Loading** - Station details load on-demand for faster map performance
27+ - ** 📱 Mobile Optimized** - Device-aware rendering with touch controls and performance limits
28+ - ** 🌐 Offline Support** - Comprehensive offline functionality with cached fuel data and map tiles
29+ - ** 💾 Smart Caching** - Multi-tier caching with popular region pre-warming
30+ - ** 🔧 Viewport Persistence** - Remembers your last viewed location and returns you there on reload
2131
2232## 🚀 Quick Start
2333
@@ -100,22 +110,31 @@ FuelFeed aggregates data from major UK fuel retailers:
100110
101111```
102112fuelfeed/
103- ├── src/ # Backend TypeScript source
104- │ ├── index.ts # Main Worker entry point
105- │ ├── cache-manager.ts # Intelligent caching system
106- │ ├── fuel-categorizer.ts # Fuel type classification
107- │ ├── price-normalizer.ts # Price standardization
108- │ └── fuel.ts # Core fuel data processing
109- ├── public/ # Frontend assets
113+ ├── src/ # Backend TypeScript source
114+ │ ├── index.ts # Main Worker entry point & API routes
115+ │ ├── cache-manager.ts # Multi-tier caching with spatial tiling
116+ │ ├── fuel-categorizer.ts # Fuel type classification & ordering
117+ │ ├── brand-standardizer.ts # Brand name normalization
118+ │ ├── popup-generator.ts # Server-side popup HTML generation
119+ │ ├── geographic-filter.ts # Device-aware geographic optimization
120+ │ ├── dynamic-pricing.ts # Market-based price analysis
121+ │ ├── cache-invalidator.ts # Smart cache management
122+ │ ├── constants.ts # Configuration constants
123+ │ └── fuel.ts # Core fuel data processing
124+ ├── public/ # Frontend assets
110125│ ├── js/
111- │ │ ├── app.js # Main application logic
112- │ │ ├── station-cache.js # Client-side caching
113- │ │ └── worker.js # Service worker
114- │ └── index.html # Main application page
115- ├── test/ # Test suite
116- ├── mirror.mjs # Data mirroring script
117- ├── feeds.json # Data source configuration
118- └── wrangler.toml # Cloudflare Worker configuration
126+ │ │ └── app.js # Complete application with geolocation & lazy loading
127+ │ ├── css/
128+ │ │ └── styles.css # Responsive styling
129+ │ ├── icons/ # App icons for PWA
130+ │ ├── manifest.json # PWA manifest
131+ │ ├── service-worker.js # Offline functionality
132+ │ └── index.html # Main application page
133+ ├── test/ # Test suite
134+ ├── mirror.mjs # Data mirroring script
135+ ├── feeds.json # Data source configuration
136+ ├── wrangler.toml # Cloudflare Worker configuration
137+ └── worker-configuration.d.ts # TypeScript definitions
119138```
120139
121140### Key Components
@@ -155,17 +174,26 @@ Super, V-Power → Premium
155174### API Endpoints
156175
157176``` bash
158- # Get all fuel data
177+ # Get all fuel data (complete dataset)
159178GET /api/data.json
160179
161- # Get map-optimized data
180+ # Get map-optimized GeoJSON data
162181GET /api/data.mapbox
163182
164- # Get data for specific bounding box
183+ # Get data for specific bounding box with geographic filtering
165184GET /api/data.mapbox? bbox=west,south,east,north
166185
167- # Get limited results for mobile
186+ # Get limited results for mobile devices
168187GET /api/data.mapbox? limit=300
188+
189+ # Get data with center point for proximity sorting
190+ GET /api/data.mapbox? center=lng,lat
191+
192+ # Get individual station details (lazy loading)
193+ GET /api/station/:stationId
194+
195+ # Get cache statistics and performance metrics
196+ GET /api/cache/stats
169197```
170198
171199### Testing
@@ -183,14 +211,21 @@ node test/test-mirror.mjs
183211### Debugging
184212
185213``` bash
186- # Browser console commands for viewport management
214+ # Browser console commands for location & viewport management
187215resetViewport () # Clear saved location and reload
188216getViewportInfo () # View stored vs current viewport
217+ getCurrentLocation () # Test geolocation functionality
218+ clearLocationCache () # Clear cached location data
189219
190- # Offline cache management
220+ # Station and cache management
191221getCacheStatus () # View cache statistics and storage usage
222+ clearStationCache () # Clear cached station details
223+ refreshStations () # Refresh station data for current view
192224clearFuelCache () # Clear cached fuel data
193225forceFuelUpdate () # Force background fuel data update
226+
227+ # URL state management
228+ window.location.href = ' ?lat=51.5074&lng=-0.1278&zoom=12' # Test shareable links
194229```
195230
196231### Data Mirroring
0 commit comments