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,147 @@
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 { StyleSheet } from 'react-native';
import { getIconButtonColor } from './utils';
import { useInternalTheme } from '../../core/theming';
import { forwardRef } from '../../utils/forwardRef';
import ActivityIndicator from '../ActivityIndicator';
import CrossFadeIcon from '../CrossFadeIcon';
import Icon from '../Icon';
import Surface from '../Surface';
import TouchableRipple from '../TouchableRipple/TouchableRipple';
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 = 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 = useInternalTheme(themeOverrides);
const {
isV3
} = theme;
const IconComponent = animated ? CrossFadeIcon : Icon;
const {
iconColor,
rippleColor,
backgroundColor,
borderColor
} = 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
} = StyleSheet.flatten(style) || {};
const borderStyles = {
borderWidth,
borderRadius,
borderColor
};
return /*#__PURE__*/React.createElement(Surface, _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, _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.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, {
size: size,
color: iconColor
}) : /*#__PURE__*/React.createElement(IconComponent, {
color: iconColor,
source: icon,
size: size
})));
});
const styles = StyleSheet.create({
container: {
overflow: 'hidden',
margin: 6,
elevation: 0
},
touchable: {
flexGrow: 1,
justifyContent: 'center',
alignItems: 'center'
},
disabled: {
opacity: 0.32
}
});
export default IconButton;
//# sourceMappingURL=IconButton.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["React","StyleSheet","getIconButtonColor","useInternalTheme","forwardRef","ActivityIndicator","CrossFadeIcon","Icon","Surface","TouchableRipple","PADDING","IconButton","icon","iconColor","customIconColor","containerColor","customContainerColor","rippleColor","customRippleColor","size","accessibilityLabel","disabled","onPress","selected","animated","mode","style","theme","themeOverrides","testID","loading","contentStyle","rest","ref","isV3","IconComponent","backgroundColor","borderColor","buttonSize","borderWidth","borderRadius","flatten","borderStyles","createElement","_extends","width","height","styles","container","elevation","borderless","centered","touchable","accessibilityTraits","accessibilityComponentType","accessibilityRole","accessibilityState","hitSlop","supported","top","left","bottom","right","color","source","create","overflow","margin","flexGrow","justifyContent","alignItems","opacity"],"sourceRoot":"../../../../src","sources":["components/IconButton/IconButton.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAGEC,UAAU,QAKL,cAAc;AAErB,SAASC,kBAAkB,QAAQ,SAAS;AAC5C,SAASC,gBAAgB,QAAQ,oBAAoB;AAErD,SAASC,UAAU,QAAQ,wBAAwB;AACnD,OAAOC,iBAAiB,MAAM,sBAAsB;AACpD,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,IAAI,MAAsB,SAAS;AAC1C,OAAOC,OAAO,MAAM,YAAY;AAChC,OAAOC,eAAe,MAAM,oCAAoC;AAEhE,MAAMC,OAAO,GAAG,CAAC;AAyEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAGP,UAAU,CAC3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KAAK,EAAElD,SAAU;IAACmD,MAAM,EAAEpD,IAAK;IAACO,IAAI,EAAEA;EAAK,CAAE,CAE/C,CACV,CAAC;AAEd,CACF,CAAC;AAED,MAAM4B,MAAM,GAAG9C,UAAU,CAACgE,MAAM,CAAC;EAC/BjB,SAAS,EAAE;IACTkB,QAAQ,EAAE,QAAQ;IAClBC,MAAM,EAAE,CAAC;IACTlB,SAAS,EAAE;EACb,CAAC;EACDG,SAAS,EAAE;IACTgB,QAAQ,EAAE,CAAC;IACXC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACDjD,QAAQ,EAAE;IACRkD,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEF,eAAe5D,UAAU","ignoreList":[]}

View File

@@ -0,0 +1,147 @@
import color from 'color';
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 color(iconColor).alpha(0.12).rgb().string();
}
return color(iconColor).alpha(0.32).rgb().string();
};
export 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
})
};
};
//# sourceMappingURL=utils.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["color","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","alpha","rgb","string","getIconButtonColor","mode","modeToCompare","baseIconColorProps","backgroundColor","rippleColor","borderColor"],"sourceRoot":"../../../../src","sources":["components/IconButton/utils.ts"],"mappings":"AAEA,OAAOA,KAAK,MAAM,OAAO;AAazB,MAAMC,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,O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