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,53 @@
// TODO: Implement
// Smart App City — App Constants
export const APP_NAME = 'Smart App City';
export const APP_VERSION = '0.1.0';
// API
export const API_BASE_URL = process.env.EXPO_PUBLIC_API_URL ?? 'https://api-smartapp.digitribe.fr/api/v1';
export const API_TIMEOUT = 15000;
// Map
export const DEFAULT_MAP_CENTER = { latitude: 14.6161, longitude: -61.0588 }; // Fort-de-France
export const DEFAULT_MAP_ZOOM = 12;
export const MARTINIQUE_BOUNDS = {
north: 14.88,
south: 14.45,
east: -60.82,
west: -61.23,
};
// Sensor types
export const SENSOR_TYPES = [
{ key: 'temperature', label: 'Température', unit: '°C', icon: '🌡️', color: '#00ACC1' },
{ key: 'humidity', label: 'Humidité', unit: '%', icon: '💧', color: '#1565C0' },
{ key: 'air_quality', label: 'Qualité Air', unit: 'AQI', icon: '🌬️', color: '#2E7D32' },
{ key: 'noise', label: 'Bruit', unit: 'dB', icon: '🔊', color: '#3949AB' },
{ key: 'traffic', label: 'Trafic', unit: 'veh/h', icon: '🚗', color: '#F57C00' },
{ key: 'energy', label: 'Énergie', unit: 'kWh', icon: '⚡', color: '#D32F2F' },
];
// Alert severity
export const ALERT_SEVERITY = {
critical: { label: 'Critique', color: '#D32F2F', icon: '🔴' },
high: { label: 'Haute', color: '#F57C00', icon: '🟠' },
medium: { label: 'Moyenne', color: '#FF9800', icon: '🟡' },
low: { label: 'Basse', color: '#0288D1', icon: '🔵' },
};
// Storage keys
export const STORAGE_KEYS = {
ACCESS_TOKEN: 'access_token',
REFRESH_TOKEN: 'refresh_token',
AUTH_STORAGE: 'auth-storage',
THEME: 'theme',
LANGUAGE: 'language',
};
// Refresh intervals (ms)
export const REFRESH_INTERVALS = {
SENSORS: 30000, // 30s
ALERTS: 60000, // 1min
WEATHER: 300000, // 5min
NOTIFICATIONS: 30000, // 30s
};