feat(smart-app): implement complete mobile app MVP

- App.tsx: full navigation (Auth stack + Main tabs with 5 screens)
- Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen
- HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors
- MapScreen: interactive map with layer toggles (6 layers)
- MarketplaceScreen: categories (6), products (5), search
- ChatScreen: AI chat with quick prompts (4), bot responses
- ProfileScreen: user info, stats, menu (9 items), logout
- AlertsScreen: alert list with severity, acknowledge
- SensorsScreen: sensor list with type filters (6 types), search
- ZonesScreen: zone cards with stats
- SettingsScreen: language picker (FR/EN/ES/DE), privacy, about
- Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n
- Hooks: useSensors, useAlerts, useNotifications, useLocation
- Components: Card, Button, LoadingSpinner, ErrorBoundary, Header
- Services: iotService, notificationService (with axios API client)
- Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN)
- Theme: colors.ts with full design system (Blue Ocean palette)
- Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
This commit is contained in:
Eric FELIXINE
2026-06-01 18:00:35 -04:00
parent 08ca495bde
commit e30ae8ed09
35578 changed files with 3703534 additions and 43 deletions

View File

@@ -0,0 +1,10 @@
import { ConfigPlugin } from 'expo/config-plugins';
declare const _default: ConfigPlugin<void | {
locationAlwaysAndWhenInUsePermission?: string | false | undefined;
locationAlwaysPermission?: string | false | undefined;
locationWhenInUsePermission?: string | false | undefined;
isIosBackgroundLocationEnabled?: boolean | undefined;
isAndroidBackgroundLocationEnabled?: boolean | undefined;
isAndroidForegroundServiceEnabled?: boolean | undefined;
}>;
export default _default;

View File

@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const config_plugins_1 = require("expo/config-plugins");
const pkg = require('expo-location/package.json');
const LOCATION_USAGE = 'Allow $(PRODUCT_NAME) to access your location';
const withBackgroundLocation = (config) => {
return (0, config_plugins_1.withInfoPlist)(config, (config) => {
if (!Array.isArray(config.modResults.UIBackgroundModes)) {
config.modResults.UIBackgroundModes = [];
}
if (!config.modResults.UIBackgroundModes.includes('location')) {
config.modResults.UIBackgroundModes.push('location');
}
return config;
});
};
const withLocation = (config, { locationAlwaysAndWhenInUsePermission, locationAlwaysPermission, locationWhenInUsePermission, isIosBackgroundLocationEnabled, isAndroidBackgroundLocationEnabled, isAndroidForegroundServiceEnabled, } = {}) => {
if (isIosBackgroundLocationEnabled) {
config = withBackgroundLocation(config);
}
config_plugins_1.IOSConfig.Permissions.createPermissionsPlugin({
NSLocationAlwaysAndWhenInUseUsageDescription: LOCATION_USAGE,
NSLocationAlwaysUsageDescription: LOCATION_USAGE,
NSLocationWhenInUseUsageDescription: LOCATION_USAGE,
})(config, {
NSLocationAlwaysAndWhenInUseUsageDescription: locationAlwaysAndWhenInUsePermission,
NSLocationAlwaysUsageDescription: locationAlwaysPermission,
NSLocationWhenInUseUsageDescription: locationWhenInUsePermission,
});
// If the user has not specified a value for isAndroidForegroundServiceEnabled,
// we default to the value of isAndroidBackgroundLocationEnabled because we want
// to enable foreground by default if background location is enabled.
const enableAndroidForegroundService = typeof isAndroidForegroundServiceEnabled === 'undefined'
? isAndroidBackgroundLocationEnabled
: isAndroidForegroundServiceEnabled;
return config_plugins_1.AndroidConfig.Permissions.withPermissions(config, [
// Note: these are already added in the library AndroidManifest.xml and so
// are not required here, we may want to remove them in the future.
'android.permission.ACCESS_COARSE_LOCATION',
'android.permission.ACCESS_FINE_LOCATION',
// These permissions are optional, and not listed in the library AndroidManifest.xml
isAndroidBackgroundLocationEnabled && 'android.permission.ACCESS_BACKGROUND_LOCATION',
enableAndroidForegroundService && 'android.permission.FOREGROUND_SERVICE',
enableAndroidForegroundService && 'android.permission.FOREGROUND_SERVICE_LOCATION',
].filter(Boolean));
};
exports.default = (0, config_plugins_1.createRunOncePlugin)(withLocation, pkg.name, pkg.version);

View File

@@ -0,0 +1,81 @@
import {
AndroidConfig,
ConfigPlugin,
IOSConfig,
createRunOncePlugin,
withInfoPlist,
} from 'expo/config-plugins';
const pkg = require('expo-location/package.json');
const LOCATION_USAGE = 'Allow $(PRODUCT_NAME) to access your location';
const withBackgroundLocation: ConfigPlugin = (config) => {
return withInfoPlist(config, (config) => {
if (!Array.isArray(config.modResults.UIBackgroundModes)) {
config.modResults.UIBackgroundModes = [];
}
if (!config.modResults.UIBackgroundModes.includes('location')) {
config.modResults.UIBackgroundModes.push('location');
}
return config;
});
};
const withLocation: ConfigPlugin<
{
locationAlwaysAndWhenInUsePermission?: string | false;
locationAlwaysPermission?: string | false;
locationWhenInUsePermission?: string | false;
isIosBackgroundLocationEnabled?: boolean;
isAndroidBackgroundLocationEnabled?: boolean;
isAndroidForegroundServiceEnabled?: boolean;
} | void
> = (
config,
{
locationAlwaysAndWhenInUsePermission,
locationAlwaysPermission,
locationWhenInUsePermission,
isIosBackgroundLocationEnabled,
isAndroidBackgroundLocationEnabled,
isAndroidForegroundServiceEnabled,
} = {}
) => {
if (isIosBackgroundLocationEnabled) {
config = withBackgroundLocation(config);
}
IOSConfig.Permissions.createPermissionsPlugin({
NSLocationAlwaysAndWhenInUseUsageDescription: LOCATION_USAGE,
NSLocationAlwaysUsageDescription: LOCATION_USAGE,
NSLocationWhenInUseUsageDescription: LOCATION_USAGE,
})(config, {
NSLocationAlwaysAndWhenInUseUsageDescription: locationAlwaysAndWhenInUsePermission,
NSLocationAlwaysUsageDescription: locationAlwaysPermission,
NSLocationWhenInUseUsageDescription: locationWhenInUsePermission,
});
// If the user has not specified a value for isAndroidForegroundServiceEnabled,
// we default to the value of isAndroidBackgroundLocationEnabled because we want
// to enable foreground by default if background location is enabled.
const enableAndroidForegroundService =
typeof isAndroidForegroundServiceEnabled === 'undefined'
? isAndroidBackgroundLocationEnabled
: isAndroidForegroundServiceEnabled;
return AndroidConfig.Permissions.withPermissions(
config,
[
// Note: these are already added in the library AndroidManifest.xml and so
// are not required here, we may want to remove them in the future.
'android.permission.ACCESS_COARSE_LOCATION',
'android.permission.ACCESS_FINE_LOCATION',
// These permissions are optional, and not listed in the library AndroidManifest.xml
isAndroidBackgroundLocationEnabled && 'android.permission.ACCESS_BACKGROUND_LOCATION',
enableAndroidForegroundService && 'android.permission.FOREGROUND_SERVICE',
enableAndroidForegroundService && 'android.permission.FOREGROUND_SERVICE_LOCATION',
].filter(Boolean) as string[]
);
};
export default createRunOncePlugin(withLocation, pkg.name, pkg.version);

View File

@@ -0,0 +1,9 @@
{
"extends": "expo-module-scripts/tsconfig.plugin",
"compilerOptions": {
"outDir": "build",
"rootDir": "src"
},
"include": ["./src"],
"exclude": ["**/__mocks__/*", "**/__tests__/*"]
}