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,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Pressable = void 0;
var _reactNative = require("react-native");
// This component is added to support type-safe hover and focus states on web
// https://necolas.github.io/react-native-web/docs/pressable/
const Pressable = exports.Pressable = _reactNative.Pressable;
//# sourceMappingURL=Pressable.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_reactNative","require","Pressable","exports","PressableNative"],"sourceRoot":"../../../../src","sources":["components/TouchableRipple/Pressable.tsx"],"mappings":";;;;;;AAQA,IAAAA,YAAA,GAAAC,OAAA;AAEA;AACA;;AA2BO,MAAMC,SAEZ,GAAAC,OAAA,CAAAD,SAAA,GAAGE,sBAAsB","ignoreList":[]}

View File

@@ -0,0 +1,232 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _color = _interopRequireDefault(require("color"));
var _Pressable = require("./Pressable");
var _utils = require("./utils");
var _settings = require("../../core/settings");
var _theming = require("../../core/theming");
var _forwardRef = require("../../utils/forwardRef");
var _hasTouchHandler = _interopRequireDefault(require("../../utils/hasTouchHandler"));
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); }
/**
* A wrapper for views that should respond to touches.
* Provides a material "ink ripple" interaction effect for supported platforms (>= Android Lollipop).
* On unsupported platforms, it falls back to a highlight effect.
*
* ## Usage
* ```js
* import * as React from 'react';
* import { View } from 'react-native';
* import { Text, TouchableRipple } from 'react-native-paper';
*
* const MyComponent = () => (
* <TouchableRipple
* onPress={() => console.log('Pressed')}
* rippleColor="rgba(0, 0, 0, .32)"
* >
* <Text>Press anywhere</Text>
* </TouchableRipple>
* );
*
* export default MyComponent;
* ```
*
* @extends Pressable props https://reactnative.dev/docs/Pressable#props
*/
const TouchableRipple = ({
style,
background: _background,
borderless = false,
disabled: disabledProp,
rippleColor,
underlayColor: _underlayColor,
children,
theme: themeOverrides,
...rest
}, ref) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
calculatedRippleColor
} = (0, _utils.getTouchableRippleColors)({
theme,
rippleColor
});
const hoverColor = (0, _color.default)(calculatedRippleColor).fade(0.5).rgb().string();
const {
rippleEffectEnabled
} = React.useContext(_settings.SettingsContext);
const {
onPress,
onLongPress,
onPressIn,
onPressOut
} = rest;
const handlePressIn = React.useCallback(e => {
onPressIn === null || onPressIn === void 0 || onPressIn(e);
if (rippleEffectEnabled) {
const {
centered
} = rest;
const button = e.currentTarget;
const style = window.getComputedStyle(button);
const dimensions = button.getBoundingClientRect();
let touchX;
let touchY;
const {
changedTouches,
touches
} = e.nativeEvent;
const touch = (touches === null || touches === void 0 ? void 0 : touches[0]) ?? (changedTouches === null || changedTouches === void 0 ? void 0 : changedTouches[0]);
// If centered or it was pressed using keyboard - enter or space
if (centered || !touch) {
touchX = dimensions.width / 2;
touchY = dimensions.height / 2;
} else {
touchX = touch.locationX ?? e.pageX;
touchY = touch.locationY ?? e.pageY;
}
// Get the size of the button to determine how big the ripple should be
const size = centered ?
// If ripple is always centered, we don't need to make it too big
Math.min(dimensions.width, dimensions.height) * 1.5 :
// Otherwise make it twice as big so clicking on one end spreads ripple to other
Math.max(dimensions.width, dimensions.height) * 2;
// Create a container for our ripple effect so we don't need to change the parent's style
const container = document.createElement('span');
container.setAttribute('data-paper-ripple', '');
Object.assign(container.style, {
position: 'absolute',
pointerEvents: 'none',
top: '0',
left: '0',
right: '0',
bottom: '0',
borderTopLeftRadius: style.borderTopLeftRadius,
borderTopRightRadius: style.borderTopRightRadius,
borderBottomRightRadius: style.borderBottomRightRadius,
borderBottomLeftRadius: style.borderBottomLeftRadius,
overflow: centered ? 'visible' : 'hidden'
});
// Create span to show the ripple effect
const ripple = document.createElement('span');
Object.assign(ripple.style, {
position: 'absolute',
pointerEvents: 'none',
backgroundColor: calculatedRippleColor,
borderRadius: '50%',
/* Transition configuration */
transitionProperty: 'transform opacity',
transitionDuration: `${Math.min(size * 1.5, 350)}ms`,
transitionTimingFunction: 'linear',
transformOrigin: 'center',
/* We'll animate these properties */
transform: 'translate3d(-50%, -50%, 0) scale3d(0.1, 0.1, 0.1)',
opacity: '0.5',
// Position the ripple where cursor was
left: `${touchX}px`,
top: `${touchY}px`,
width: `${size}px`,
height: `${size}px`
});
// Finally, append it to DOM
container.appendChild(ripple);
button.appendChild(container);
// rAF runs in the same frame as the event handler
// Use double rAF to ensure the transition class is added in next frame
// This will make sure that the transition animation is triggered
requestAnimationFrame(() => {
requestAnimationFrame(() => {
Object.assign(ripple.style, {
transform: 'translate3d(-50%, -50%, 0) scale3d(1, 1, 1)',
opacity: '1'
});
});
});
}
}, [onPressIn, rest, rippleEffectEnabled, calculatedRippleColor]);
const handlePressOut = React.useCallback(e => {
onPressOut === null || onPressOut === void 0 || onPressOut(e);
if (rippleEffectEnabled) {
const containers = e.currentTarget.querySelectorAll('[data-paper-ripple]');
requestAnimationFrame(() => {
requestAnimationFrame(() => {
containers.forEach(container => {
const ripple = container.firstChild;
Object.assign(ripple.style, {
transitionDuration: '250ms',
opacity: 0
});
// Finally remove the span after the transition
setTimeout(() => {
const {
parentNode
} = container;
if (parentNode) {
parentNode.removeChild(container);
}
}, 500);
});
});
});
}
}, [onPressOut, rippleEffectEnabled]);
const hasPassedTouchHandler = (0, _hasTouchHandler.default)({
onPress,
onLongPress,
onPressIn,
onPressOut
});
const disabled = disabledProp || !hasPassedTouchHandler;
return /*#__PURE__*/React.createElement(_Pressable.Pressable, _extends({}, rest, {
ref: ref,
onPressIn: handlePressIn,
onPressOut: handlePressOut,
disabled: disabled,
style: state => [styles.touchable, borderless && styles.borderless,
// focused state is not ready yet: https://github.com/necolas/react-native-web/issues/1849
// state.focused && { backgroundColor: ___ },
state.hovered && {
backgroundColor: hoverColor
}, disabled && styles.disabled, typeof style === 'function' ? style(state) : style]
}), state => React.Children.only(typeof children === 'function' ? children(state) : children));
};
/**
* Whether ripple effect is supported.
*/
TouchableRipple.supported = true;
const styles = _reactNative.StyleSheet.create({
touchable: {
position: 'relative',
...(_reactNative.Platform.OS === 'web' && {
cursor: 'pointer',
transition: '150ms background-color'
})
},
disabled: {
...(_reactNative.Platform.OS === 'web' && {
cursor: 'auto'
})
},
borderless: {
overflow: 'hidden'
}
});
const Component = (0, _forwardRef.forwardRef)(TouchableRipple);
var _default = exports.default = Component;
//# sourceMappingURL=TouchableRipple.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,98 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = _interopRequireWildcard(require("react"));
var _reactNative = require("react-native");
var _Pressable = require("./Pressable");
var _utils = require("./utils");
var _settings = require("../../core/settings");
var _theming = require("../../core/theming");
var _forwardRef = require("../../utils/forwardRef");
var _hasTouchHandler = _interopRequireDefault(require("../../utils/hasTouchHandler"));
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 ANDROID_VERSION_LOLLIPOP = 21;
const ANDROID_VERSION_PIE = 28;
const TouchableRipple = ({
style,
background,
borderless = false,
disabled: disabledProp,
rippleColor,
underlayColor,
children,
theme: themeOverrides,
...rest
}, ref) => {
const theme = (0, _theming.useInternalTheme)(themeOverrides);
const {
rippleEffectEnabled
} = React.useContext(_settings.SettingsContext);
const {
onPress,
onLongPress,
onPressIn,
onPressOut
} = rest;
const hasPassedTouchHandler = (0, _hasTouchHandler.default)({
onPress,
onLongPress,
onPressIn,
onPressOut
});
const disabled = disabledProp || !hasPassedTouchHandler;
const {
calculatedRippleColor,
calculatedUnderlayColor
} = (0, _utils.getTouchableRippleColors)({
theme,
rippleColor,
underlayColor
});
// A workaround for ripple on Android P is to use useForeground + overflow: 'hidden'
// https://github.com/facebook/react-native/issues/6480
const useForeground = _reactNative.Platform.OS === 'android' && _reactNative.Platform.Version >= ANDROID_VERSION_PIE && borderless;
if (TouchableRipple.supported) {
const androidRipple = rippleEffectEnabled ? background ?? {
color: calculatedRippleColor,
borderless,
foreground: useForeground
} : undefined;
return /*#__PURE__*/React.createElement(_Pressable.Pressable, _extends({}, rest, {
ref: ref,
disabled: disabled,
style: [borderless && styles.overflowHidden, style],
android_ripple: androidRipple
}), React.Children.only(children));
}
return /*#__PURE__*/React.createElement(_Pressable.Pressable, _extends({}, rest, {
ref: ref,
disabled: disabled,
style: [borderless && styles.overflowHidden, style]
}), ({
pressed
}) => /*#__PURE__*/React.createElement(React.Fragment, null, pressed && rippleEffectEnabled && /*#__PURE__*/React.createElement(_reactNative.View, {
testID: "touchable-ripple-underlay",
style: [styles.underlay, {
backgroundColor: calculatedUnderlayColor
}]
}), React.Children.only(children)));
};
TouchableRipple.supported = _reactNative.Platform.OS === 'android' && _reactNative.Platform.Version >= ANDROID_VERSION_LOLLIPOP;
const styles = _reactNative.StyleSheet.create({
overflowHidden: {
overflow: 'hidden'
},
underlay: {
..._reactNative.StyleSheet.absoluteFill,
zIndex: 2
}
});
const Component = (0, _forwardRef.forwardRef)(TouchableRipple);
var _default = exports.default = Component;
//# sourceMappingURL=TouchableRipple.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_Pressable","_utils","_settings","_theming","_forwardRef","_hasTouchHandler","_interopRequireDefault","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","ANDROID_VERSION_LOLLIPOP","ANDROID_VERSION_PIE","TouchableRipple","style","background","borderless","disabled","disabledProp","rippleColor","underlayColor","children","theme","themeOverrides","rest","ref","useInternalTheme","rippleEffectEnabled","useContext","SettingsContext","onPress","onLongPress","onPressIn","onPressOut","hasPassedTouchHandler","hasTouchHandler","calculatedRippleColor","calculatedUnderlayColor","getTouchableRippleColors","useForeground","Platform","OS","Version","supported","androidRipple","color","foreground","undefined","createElement","Pressable","styles","overflowHidden","android_ripple","Children","only","pressed","Fragment","View","testID","underlay","backgroundColor","StyleSheet","create","overflow","absoluteFill","zIndex","Component","forwardRef","_default","exports"],"sourceRoot":"../../../../src","sources":["components/TouchableRipple/TouchableRipple.native.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAYA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAEA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAC,sBAAA,CAAAR,OAAA;AAA0D,SAAAQ,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAd,uBAAA,YAAAA,CAAAU,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA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,QAAQ,CAACC,IAAI,CAACjC,QAAQ,CACpB,CAAC;EAEhB;EAEA,oBACE9C,KAAA,CAAAyE,aAAA,CAACrE,UAAA,CAAAsE,SAAS,EAAA5C,QAAA,KACJmB,IAAI;IACRC,GAAG,EAAEA,GAAI;IACTR,QAAQ,EAAEA,QAAS;IACnBH,KAAK,EAAE,CAACE,UAAU,IAAIkC,MAAM,CAACC,cAAc,EAAErC,KAAK;EAAE,IAEnD,CAAC;IAAEyC;EAAQ,CAAC,kBACXhF,KAAA,CAAAyE,aAAA,CAAAzE,KAAA,CAAAiF,QAAA,QACGD,OAAO,IAAI5B,mBAAmB,iBAC7BpD,KAAA,CAAAyE,aAAA,CAACtE,YAAA,CAAA+E,IAAI;IACHC,MAAM,EAAC,2BAA2B;IAClC5C,KAAK,EAAE,CACLoC,MAAM,CAACS,QAAQ,EACf;MAAEC,eAAe,EAAEvB;IAAwB,CAAC;EAC5C,CACH,CACF,EACA9D,KAAK,CAAC8E,QAAQ,CAACC,IAAI,CAACjC,QAAQ,CAC7B,CAEK,CAAC;AAEhB,CAAC;AAEDR,eAAe,CAAC8B,SAAS,GACvBH,qBAAQ,CAACC,EAAE,KAAK,SAAS,IAAID,qBAAQ,CAACE,OAAO,IAAI/B,wBAAwB;AAE3E,MAAMuC,MAAM,GAAGW,uBAAU,CAACC,MAAM,CAAC;EAC/BX,cAAc,EAAE;IACdY,QAAQ,EAAE;EACZ,CAAC;EACDJ,QAAQ,EAAE;IACR,GAAGE,uBAAU,CAACG,YAAY;IAC1BC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAEF,MAAMC,SAAS,GAAG,IAAAC,sBAAU,EAACtD,eAAe,CAAC;AAAC,IAAAuD,QAAA,GAAAC,OAAA,CAAAjF,OAAA,GAE/B8E,SAAS","ignoreList":[]}

View File

@@ -0,0 +1,56 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getTouchableRippleColors = void 0;
var _color = _interopRequireDefault(require("color"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const getUnderlayColor = ({
theme,
calculatedRippleColor,
underlayColor
}) => {
if (underlayColor != null) {
return underlayColor;
}
if (theme.isV3) {
return (0, _color.default)(calculatedRippleColor).rgb().string();
}
return (0, _color.default)(calculatedRippleColor).fade(0.5).rgb().string();
};
const getRippleColor = ({
theme,
rippleColor
}) => {
if (rippleColor) {
return rippleColor;
}
if (theme.isV3) {
return (0, _color.default)(theme.colors.onSurface).alpha(0.12).rgb().string();
}
if (theme.dark) {
return (0, _color.default)(theme.colors.text).alpha(0.32).rgb().string();
}
return (0, _color.default)(theme.colors.text).alpha(0.2).rgb().string();
};
const getTouchableRippleColors = ({
theme,
rippleColor,
underlayColor
}) => {
const calculatedRippleColor = getRippleColor({
theme,
rippleColor
});
return {
calculatedRippleColor,
calculatedUnderlayColor: getUnderlayColor({
theme,
calculatedRippleColor,
underlayColor
})
};
};
exports.getTouchableRippleColors = getTouchableRippleColors;
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_color","_interopRequireDefault","require","e","__esModule","default","getUnderlayColor","theme","calculatedRippleColor","underlayColor","isV3","color","rgb","string","fade","getRippleColor","rippleColor","colors","onSurface","alpha","dark","text","getTouchableRippleColors","calculatedUnderlayColor","exports"],"sourceRoot":"../../../../src","sources":["components/TouchableRipple/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;AAI1B,MAAMG,gBAAgB,GAAGA,CAAC;EACxBC,KAAK;EACLC,qBAAqB;EACrBC;AAKF,CAAC,KAAK;EACJ,IAAIA,aAAa,IAAI,IAAI,EAAE;IACzB,OAAOA,aAAa;EACtB;EAEA,IAAIF,KAAK,CAACG,IAAI,EAAE;IACd,OAAO,IAAAC,cAAK,EAACH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