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,7 @@
import { Pressable as PressableNative } from '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/
export const Pressable = PressableNative;
//# sourceMappingURL=Pressable.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["Pressable","PressableNative"],"sourceRoot":"../../../../src","sources":["components/TouchableRipple/Pressable.tsx"],"mappings":"AAQA,SAASA,SAAS,IAAIC,eAAe,QAAQ,cAAc;;AAE3D;AACA;;AA2BA,OAAO,MAAMD,SAEZ,GAAGC,eAAsB","ignoreList":[]}

View File

@@ -0,0 +1,224 @@
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); }
import * as React from 'react';
import { Platform, StyleSheet } from 'react-native';
import color from 'color';
import { Pressable } from './Pressable';
import { getTouchableRippleColors } from './utils';
import { SettingsContext } from '../../core/settings';
import { useInternalTheme } from '../../core/theming';
import { forwardRef } from '../../utils/forwardRef';
import hasTouchHandler from '../../utils/hasTouchHandler';
/**
* 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 = useInternalTheme(themeOverrides);
const {
calculatedRippleColor
} = getTouchableRippleColors({
theme,
rippleColor
});
const hoverColor = color(calculatedRippleColor).fade(0.5).rgb().string();
const {
rippleEffectEnabled
} = React.useContext(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 = hasTouchHandler({
onPress,
onLongPress,
onPressIn,
onPressOut
});
const disabled = disabledProp || !hasPassedTouchHandler;
return /*#__PURE__*/React.createElement(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 = StyleSheet.create({
touchable: {
position: 'relative',
...(Platform.OS === 'web' && {
cursor: 'pointer',
transition: '150ms background-color'
})
},
disabled: {
...(Platform.OS === 'web' && {
cursor: 'auto'
})
},
borderless: {
overflow: 'hidden'
}
});
const Component = forwardRef(TouchableRipple);
export default Component;
//# sourceMappingURL=TouchableRipple.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,90 @@
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); }
import * as React from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import { Pressable } from './Pressable';
import { getTouchableRippleColors } from './utils';
import { SettingsContext } from '../../core/settings';
import { useInternalTheme } from '../../core/theming';
import { forwardRef } from '../../utils/forwardRef';
import hasTouchHandler from '../../utils/hasTouchHandler';
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 = useInternalTheme(themeOverrides);
const {
rippleEffectEnabled
} = React.useContext(SettingsContext);
const {
onPress,
onLongPress,
onPressIn,
onPressOut
} = rest;
const hasPassedTouchHandler = hasTouchHandler({
onPress,
onLongPress,
onPressIn,
onPressOut
});
const disabled = disabledProp || !hasPassedTouchHandler;
const {
calculatedRippleColor,
calculatedUnderlayColor
} = 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 = Platform.OS === 'android' && Platform.Version >= ANDROID_VERSION_PIE && borderless;
if (TouchableRipple.supported) {
const androidRipple = rippleEffectEnabled ? background ?? {
color: calculatedRippleColor,
borderless,
foreground: useForeground
} : undefined;
return /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
ref: ref,
disabled: disabled,
style: [borderless && styles.overflowHidden, style],
android_ripple: androidRipple
}), React.Children.only(children));
}
return /*#__PURE__*/React.createElement(Pressable, _extends({}, rest, {
ref: ref,
disabled: disabled,
style: [borderless && styles.overflowHidden, style]
}), ({
pressed
}) => /*#__PURE__*/React.createElement(React.Fragment, null, pressed && rippleEffectEnabled && /*#__PURE__*/React.createElement(View, {
testID: "touchable-ripple-underlay",
style: [styles.underlay, {
backgroundColor: calculatedUnderlayColor
}]
}), React.Children.only(children)));
};
TouchableRipple.supported = Platform.OS === 'android' && Platform.Version >= ANDROID_VERSION_LOLLIPOP;
const styles = StyleSheet.create({
overflowHidden: {
overflow: 'hidden'
},
underlay: {
...StyleSheet.absoluteFill,
zIndex: 2
}
});
const Component = forwardRef(TouchableRipple);
export default Component;
//# sourceMappingURL=TouchableRipple.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","Platform","StyleSheet","View","Pressable","getTouchableRippleColors","SettingsContext","useInternalTheme","forwardRef","hasTouchHandler","ANDROID_VERSION_LOLLIPOP","ANDROID_VERSION_PIE","TouchableRipple","style","background","borderless","disabled","disabledProp","rippleColor","underlayColor","children","theme","themeOverrides","rest","ref","rippleEffectEnabled","useContext","onPress","onLongPress","onPressIn","onPressOut","hasPassedTouchHandler","calculatedRippleColor","calculatedUnderlayColor","useForeground","OS","Version","supported","androidRipple","color","foreground","undefined","createElement","_extends","styles","overflowHidden","android_ripple","Children","only","pressed","Fragment","testID","underlay","backgroundColor","create","overflow","absoluteFill","zIndex","Component"],"sourceRoot":"../../../../src","sources":["components/TouchableRipple/TouchableRipple.native.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAGEC,QAAQ,EAERC,UAAU,EAEVC,IAAI,QAEC,cAAc;AAGrB,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,wBAAwB,QAAQ,SAAS;AAClD,SAAmBC,eAAe,QAAQ,qBAAqB;AAC/D,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,eAAe,MAAM,6BAA6B;AAEzD,MAAMC,wBAAwB,GAAG,EAAE;AACnC,MAAMC,mBAAmB,GAAG,EAAE;AAkB9B,MAAMC,eAAe,GAAGA,CACtB;EACEC,KAAK;EACLC,UAAU;EACVC,UAAU,GAAG,KAAK;EAClBC,QAAQ,EAAEC,YAAY;EACtBC,WAAW;EACXC,aAAa;EACbC,QAAQ;EACRC,KAAK,EAAEC,cAAc;EACrB,GAAGC;AACE,CAAC,EACRC,GAA6B,KAC1B;EACH,MAAMH,KAAK,GAAGd,gBAAgB,CAACe,cAAc,CAAC;EAC9C,MAAM;IAAEG;EAAoB,CAAC,GAAGzB,KAAK,CAAC0B,UAAU,CAAWpB,eAAe,CAAC;EAE3E,MAAM;IAAEqB,OAAO;IAAEC,WAAW;IAAEC,SAAS;IAAEC;EAAW,CAAC,GAAGP,IAAI;EAE5D,MAAMQ,qBAAqB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A0C,aAAA,CAACvC,IAAI;IACHgD,MAAM,EAAC,2BAA2B;IAClCtC,KAAK,EAAE,CACL+B,MAAM,CAACQ,QAAQ,EACf;MAAEC,eAAe,EAAEpB;IAAwB,CAAC;EAC5C,CACH,CACF,EACAjC,KAAK,CAAC+C,QAAQ,CAACC,IAAI,CAAC5B,QAAQ,CAC7B,CAEK,CAAC;AAEhB,CAAC;AAEDR,eAAe,CAACyB,SAAS,GACvBpC,QAAQ,CAACkC,EAAE,KAAK,SAAS,IAAIlC,QAAQ,CAACmC,OAAO,IAAI1B,wBAAwB;AAE3E,MAAMkC,MAAM,GAAG1C,UAAU,CAACoD,MAAM,CAAC;EAC/BT,cAAc,EAAE;IACdU,QAAQ,EAAE;EACZ,CAAC;EACDH,QAAQ,EAAE;IACR,GAAGlD,UAAU,CAACsD,YAAY;IAC1BC,MAAM,EAAE;EACV;AACF,CAAC,CAAC;AAEF,MAAMC,SAAS,GAAGlD,UAAU,CAACI,eAAe,CAAC;AAE7C,eAAe8C,SAAS","ignoreList":[]}

View File

@@ -0,0 +1,48 @@
import color from 'color';
const getUnderlayColor = ({
theme,
calculatedRippleColor,
underlayColor
}) => {
if (underlayColor != null) {
return underlayColor;
}
if (theme.isV3) {
return color(calculatedRippleColor).rgb().string();
}
return color(calculatedRippleColor).fade(0.5).rgb().string();
};
const getRippleColor = ({
theme,
rippleColor
}) => {
if (rippleColor) {
return rippleColor;
}
if (theme.isV3) {
return color(theme.colors.onSurface).alpha(0.12).rgb().string();
}
if (theme.dark) {
return color(theme.colors.text).alpha(0.32).rgb().string();
}
return color(theme.colors.text).alpha(0.2).rgb().string();
};
export const getTouchableRippleColors = ({
theme,
rippleColor,
underlayColor
}) => {
const calculatedRippleColor = getRippleColor({
theme,
rippleColor
});
return {
calculatedRippleColor,
calculatedUnderlayColor: getUnderlayColor({
theme,
calculatedRippleColor,
underlayColor
})
};
};
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["color","getUnderlayColor","theme","calculatedRippleColor","underlayColor","isV3","rgb","string","fade","getRippleColor","rippleColor","colors","onSurface","alpha","dark","text","getTouchableRippleColors","calculatedUnderlayColor"],"sourceRoot":"../../../../src","sources":["components/TouchableRipple/utils.ts"],"mappings":"AAEA,OAAOA,KAAK,MAAM,OAAO;AAIzB,MAAMC,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,OAAOL,KAAK,CAACG,qBAAqB,CAAC,CAACG,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;EACpD;EAEA,OAAOP,KAAK,CAACG,qBAAqB,CAAC,CAACK,IAAI,CAAC,GAAG,CAAC,CAACF,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;AAC9D,CAAC;AAED,MAAME,cAAc,GAAGA,CAAC;EACtBP,KAAK;EACLQ;AAIF,CAAC,KAAK;EACJ,IAAIA,WAAW,EAAE;IACf,OAAOA,WAAW;EACpB;EAEA,IAAIR,KAAK,CAACG,IAAI,EAAE;IACd,OAAOL,KAAK,CAACE,KAAK,CAACS,MAAM,CAACC,SAAS,CAAC,CAACC,KAAK,CAAC,IAAI,CAAC,CAACP,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;EACjE;EAEA,IAAIL,KAAK,CAACY,IAAI,EAAE;IACd,OAAOd,KAAK,CAACE,KAAK,CAACS,MAAM,CAACI,IAAI,CAAC,CAACF,KAAK,CAAC,IAAI,CAAC,CAACP,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;EAC5D;EACA,OAAOP,KAAK,CAACE,KAAK,CAACS,MAAM,CAACI,IAAI,CAAC,CAACF,KAAK,CAAC,GAAG,CAAC,CAACP,GAAG,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;AAC3D,C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