feat(smart-app): complete all remaining components, screens, hooks, services, stores, i18n

- i18n/index.ts: i18next setup with FR/EN/ES/DE translations
- constants.ts: app config, sensor types, alert severity, storage keys, refresh intervals
- store/index.ts: barrel export for all stores
- iotStore.ts: full IoT store (6 sensors, 3 zones, 2 alerts) with actions
- notificationStore.ts: notification store (5 mock notifications) with actions
- uiStore.ts: theme/language store + translation maps for 4 languages
- useSensors.ts: sensor filtering by type/zone, alert sensors selector
- useAlerts.ts: active alerts, critical alerts, acknowledge
- useNotifications.ts: notification CRUD operations
- useLocation.ts: GPS location with expo-location, default Fort-de-France
- SensorCard.tsx: full sensor card with status dot, compact mode
- StatsCard.tsx: stats card with icon, value, trend
- AlertCard.tsx: alert card with severity bar, acknowledge button
- ZoneCard.tsx: zone card with color bar, sensor/alert counts
- LineChart.tsx: bar-based line chart with Y-axis labels
- BarChart.tsx: bar chart with value labels
- GaugeChart.tsx: semi-circular gauge with color thresholds
- MapView.tsx: map placeholder with overlay markers
- MarkerPopup.tsx: popup with title, value, status, detail button
- DashboardScreen.tsx: analytics dashboard with gauges + charts
- SensorDetailScreen.tsx: sensor detail with gauge + history chart
- NotificationPrefsScreen.tsx: notification preference toggles (4)
- LayerDetailScreen.tsx: layer detail placeholder
- iot.service.ts: CRUD operations for sensors, zones, alerts
- gis.service.ts: geocoding, POI search, routing
This commit is contained in:
Eric FELIXINE
2026-06-01 22:31:36 -04:00
parent a5124b0f0d
commit 43ae2ebcac
17 changed files with 853 additions and 89 deletions

View File

@@ -1 +1,48 @@
// TODO: Implement
// Smart App City — GIS Service (maps, geocoding, routing)
import { get, post } from './api';
export interface GeoPoint {
latitude: number;
longitude: number;
}
export interface GeoFeature {
id: string;
type: 'sensor' | 'zone' | 'poi' | 'event';
name: string;
description?: string;
location: GeoPoint;
properties?: Record<string, any>;
}
export interface MapLayer {
id: string;
name: string;
visible: boolean;
opacity: number;
type: 'markers' | 'heatmap' | 'polygon' | 'heatmap';
}
export const gisService = {
async geocode(address: string): Promise<GeoPoint[]> {
return get<GeoPoint[]>('/gis/geocode', { address });
},
async reverseGeocode(lat: number, lng: number): Promise<string> {
return get<string>(`/gis/reverse/${lat}/${lng}`);
},
async getFeatures(bounds: {
north: number; south: number; east: number; west: number;
}): Promise<GeoFeature[]> {
return get<GeoFeature[]>('/gis/features', bounds);
},
async searchPOI(query: string, location: GeoPoint, radius: number = 5000): Promise<GeoFeature[]> {
return get<GeoFeature[]>('/gis/poi', { query, ...location, radius });
},
async getRoute(from: GeoPoint, to: GeoPoint): Promise<{ distance: number; duration: number; points: GeoPoint[] }> {
return post('/gis/route', { from, to });
},
};