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,155 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _utils = require("./utils");
var _theming = require("../../core/theming");
var _forwardRef = require("../../utils/forwardRef");
var _ActivityIndicator = _interopRequireDefault(require("../ActivityIndicator"));
var _CrossFadeIcon = _interopRequireDefault(require("../CrossFadeIcon"));
var _Icon = _interopRequireDefault(require("../Icon"));
var _Surface = _interopRequireDefault(require("../Surface"));
var _TouchableRipple = _interopRequireDefault(require("../TouchableRipple/TouchableRipple"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
const PADDING = 8;
/**
* An icon button is a button which displays only an icon without a label.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { IconButton, MD3Colors } from 'react-native-paper';
*
* const MyComponent = () => (
* <IconButton
* icon="camera"
* iconColor={MD3Colors.error50}
* size={20}
* onPress={() => console.log('Pressed')}
* />
* );
*
* export default MyComponent;
* ```
*
* @extends TouchableRipple props https://callstack.github.io/react-native-paper/docs/components/TouchableRipple
*/
const IconButton = (0, _forwardRef.forwardRef)(({
icon,
iconColor: customIconColor,
containerColor: customContainerColor,
rippleColor: customRippleColor,
size = 24,
accessibilityLabel,
disabled,
onPress,
selected = false,
animated = false,
mode,
style,
theme: themeOverrides,
testID = 'icon-button',
loading = false,
contentStyle,
...rest
}, ref) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
isV3
} = theme;
const IconComponent = animated ? _CrossFadeIcon.default : _Icon.default;
const {
iconColor,
rippleColor,
backgroundColor,
borderColor
} = (0, _utils.getIconButtonColor)({
theme,
disabled,
selected,
mode,
customIconColor,
customContainerColor,
customRippleColor
});
const buttonSize = isV3 ? size + 2 * PADDING : size * 1.5;
const {
borderWidth = isV3 && mode === 'outlined' && !selected ? 1 : 0,
borderRadius = buttonSize / 2
} = _reactNative.StyleSheet.flatten(style) || {};
const borderStyles = {
borderWidth,
borderRadius,
borderColor
};
return /*#__PURE__*/React.createElement(_Surface.default, _extends({
ref: ref,
testID: `${testID}-container`,
style: [{
backgroundColor,
width: buttonSize,
height: buttonSize
}, styles.container, borderStyles, !isV3 && disabled && styles.disabled, style],
container: true
}, isV3 && {
elevation: 0
}), /*#__PURE__*/React.createElement(_TouchableRipple.default, _extends({
borderless: true,
centered: true,
onPress: onPress,
rippleColor: rippleColor,
accessibilityLabel: accessibilityLabel,
style: [styles.touchable, contentStyle]
// @ts-expect-error We keep old a11y props for backwards compat with old RN versions
,
accessibilityTraits: disabled ? ['button', 'disabled'] : 'button',
accessibilityComponentType: "button",
accessibilityRole: "button",
accessibilityState: {
disabled
},
disabled: disabled,
hitSlop: _TouchableRipple.default.supported ? {
top: 10,
left: 10,
bottom: 10,
right: 10
} : {
top: 6,
left: 6,
bottom: 6,
right: 6
},
testID: testID
}, rest), loading ? /*#__PURE__*/React.createElement(_ActivityIndicator.default, {
size: size,
color: iconColor
}) : /*#__PURE__*/React.createElement(IconComponent, {
color: iconColor,
source: icon,
size: size
})));
});
const styles = _reactNative.StyleSheet.create({
container: {
overflow: 'hidden',
margin: 6,
elevation: 0
},
touchable: {
flexGrow: 1,
justifyContent: 'center',
alignItems: 'center'
},
disabled: {
opacity: 0.32
}
});
var _default = exports.default = IconButton;
//# sourceMappingURL=IconButton.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,155 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getIconButtonColor = void 0;
var _color = _interopRequireDefault(require("color"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const getBorderColor = ({
theme,
disabled
}) => {
if (theme.isV3) {
if (disabled) {
return theme.colors.surfaceDisabled;
}
return theme.colors.outline;
}
return undefined;
};
const getBackgroundColor = ({
theme,
isMode,
disabled,
selected,
customContainerColor
}) => {
if (theme.isV3) {
if (disabled) {
if (isMode('contained') || isMode('contained-tonal')) {
return theme.colors.surfaceDisabled;
}
}
if (typeof customContainerColor !== 'undefined') {
return customContainerColor;
}
if (isMode('contained')) {
if (selected) {
return theme.colors.primary;
}
return theme.colors.surfaceVariant;
}
if (isMode('contained-tonal')) {
if (selected) {
return theme.colors.secondaryContainer;
}
return theme.colors.surfaceVariant;
}
if (isMode('outlined')) {
if (selected) {
return theme.colors.inverseSurface;
}
}
}
if (typeof customContainerColor !== 'undefined') {
return customContainerColor;
}
return undefined;
};
const getIconColor = ({
theme,
isMode,
disabled,
selected,
customIconColor
}) => {
if (theme.isV3) {
if (disabled) {
return theme.colors.onSurfaceDisabled;
}
if (typeof customIconColor !== 'undefined') {
return customIconColor;
}
if (isMode('contained')) {
if (selected) {
return theme.colors.onPrimary;
}
return theme.colors.primary;
}
if (isMode('contained-tonal')) {
if (selected) {
return theme.colors.onSecondaryContainer;
}
return theme.colors.onSurfaceVariant;
}
if (isMode('outlined')) {
if (selected) {
return theme.colors.inverseOnSurface;
}
return theme.colors.onSurfaceVariant;
}
if (selected) {
return theme.colors.primary;
}
return theme.colors.onSurfaceVariant;
}
if (typeof customIconColor !== 'undefined') {
return customIconColor;
}
return theme.colors.text;
};
const getRippleColor = ({
theme,
iconColor,
customRippleColor
}) => {
if (customRippleColor) {
return customRippleColor;
}
if (theme.isV3) {
return (0, _color.default)(iconColor).alpha(0.12).rgb().string();
}
return (0, _color.default)(iconColor).alpha(0.32).rgb().string();
};
const getIconButtonColor = ({
theme,
disabled,
mode,
selected,
customIconColor,
customContainerColor,
customRippleColor
}) => {
const isMode = modeToCompare => {
return mode === modeToCompare;
};
const baseIconColorProps = {
theme,
isMode,
disabled,
selected
};
const iconColor = getIconColor({
...baseIconColorProps,
customIconColor
});
return {
iconColor,
backgroundColor: getBackgroundColor({
...baseIconColorProps,
customContainerColor
}),
rippleColor: getRippleColor({
theme,
iconColor,
customRippleColor
}),
borderColor: getBorderColor({
theme,
disabled
})
};
};
exports.getIconButtonColor = getIconButtonColor;
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_color","_interopRequireDefault","require","e","__esModule","default","getBorderColor","theme","disabled","isV3","colors","surfaceDisabled","outline","undefined","getBackgroundColor","isMode","selected","customContainerColor","primary","surfaceVariant","secondaryContainer","inverseSurface","getIconColor","customIconColor","onSurfaceDisabled","onPrimary","onSecondaryContainer","onSurfaceVariant","inverseOnSurface","text","getRippleColor","iconColor","customRippleColor","color","alpha","rgb","string","getIconButtonColor","mode","modeToCompare","baseIconColorProps","backgroundColor","rippleColor","borderColor","exports"],"sourceRoot":"../../../../src","sources":["components/IconButton/utils.ts"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAa1B,MAAMG,cAAc,GAAGA,CAAC;EACtBC,KAAK;EACLC;AAIF,CAAC,KAAK;EACJ,IAAID,KAAK,CAACE,IAAI,EAAE;IACd,IAAID,QAAQ,EAAE;MACZ,OAAOD,KAAK,CAACG,MAAM,CAACC,eAAe;IACrC;IAEA,OAAOJ,KAAK,CAACG,MAAM,CAACE,OAAO;EAC7B;EAEA,OAAOC,SAAS;AAClB,CAAC;AAED,MAAMC,kBAAkB,GAAGA,CAAC;EAC1BP,KAAK;EACLQ,MAAM;EACNP,QAAQ;EACRQ,QAAQ;EACRC;AAC6C,CAAC,KAAK;EACnD,IAAIV,KAAK,CAACE,IAAI,EAAE;IACd,IAAID,QAAQ,EAAE;MACZ,IAAIO,MAAM,CAAC,WAAW,CAAC,IAAIA,MAAM,CAAC,iBAAiB,CAAC,EAAE;QACpD,OAAOR,KAAK,CAACG,MAAM,CAACC,eAAe;MACrC;IACF;IAEA,IAAI,OAAOM,oBAAoB,KAAK,WAAW,EAAE;MAC/C,OAAOA,oBAAoB;IAC7B;IAEA,IAAIF,MAAM,CAAC,WAAW,CAAC,EAAE;MACvB,IAAIC,QAAQ,EAAE;QACZ,OAAOT,KAAK,CAAC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