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,145 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.errorMap = exports.isValidationErrorLike = exports.isValidationError = exports.toValidationError = exports.fromZodError = exports.fromZodIssue = exports.ValidationError = void 0;
const zod = __importStar(require("zod"));
const joinPath_1 = require("./utils/joinPath");
const NonEmptyArray_1 = require("./utils/NonEmptyArray");
const MAX_ISSUES_IN_MESSAGE = 99;
const ISSUE_SEPARATOR = '; ';
const UNION_SEPARATOR = ', or ';
const PREFIX = 'Validation error';
const PREFIX_SEPARATOR = ': ';
class ValidationError extends Error {
details;
name;
constructor(message, details = []) {
super(message);
this.details = details;
this.name = 'ZodValidationError';
}
toString() {
return this.message;
}
}
exports.ValidationError = ValidationError;
function getMessageFromZodIssue(props) {
const { issue, issueSeparator, unionSeparator, includePath } = props;
if (issue.code === 'invalid_union') {
return issue.unionErrors
.reduce((acc, zodError) => {
const newIssues = zodError.issues
.map((issue) => getMessageFromZodIssue({
issue,
issueSeparator,
unionSeparator,
includePath,
}))
.join(issueSeparator);
if (!acc.includes(newIssues)) {
acc.push(newIssues);
}
return acc;
}, [])
.join(unionSeparator);
}
if (includePath && (0, NonEmptyArray_1.isNonEmptyArray)(issue.path)) {
if (issue.path.length === 1) {
const identifier = issue.path[0];
if (typeof identifier === 'number') {
return `${issue.message} at index ${identifier}`;
}
}
return `${issue.message} at "${(0, joinPath_1.joinPath)(issue.path)}"`;
}
return issue.message;
}
function conditionallyPrefixMessage(reason, prefix, prefixSeparator) {
if (prefix !== null) {
if (reason.length > 0) {
return [prefix, reason].join(prefixSeparator);
}
return prefix;
}
if (reason.length > 0) {
return reason;
}
return PREFIX;
}
function fromZodIssue(issue, options = {}) {
const { issueSeparator = ISSUE_SEPARATOR, unionSeparator = UNION_SEPARATOR, prefixSeparator = PREFIX_SEPARATOR, prefix = PREFIX, includePath = true, } = options;
const reason = getMessageFromZodIssue({
issue,
issueSeparator,
unionSeparator,
includePath,
});
const message = conditionallyPrefixMessage(reason, prefix, prefixSeparator);
return new ValidationError(message, [issue]);
}
exports.fromZodIssue = fromZodIssue;
function fromZodError(zodError, options = {}) {
const { maxIssuesInMessage = MAX_ISSUES_IN_MESSAGE, issueSeparator = ISSUE_SEPARATOR, unionSeparator = UNION_SEPARATOR, prefixSeparator = PREFIX_SEPARATOR, prefix = PREFIX, includePath = true, } = options;
const reason = zodError.errors
.slice(0, maxIssuesInMessage)
.map((issue) => getMessageFromZodIssue({
issue,
issueSeparator,
unionSeparator,
includePath,
}))
.join(issueSeparator);
const message = conditionallyPrefixMessage(reason, prefix, prefixSeparator);
return new ValidationError(message, zodError.errors);
}
exports.fromZodError = fromZodError;
const toValidationError = (options = {}) => (err) => {
if (err instanceof zod.ZodError) {
return fromZodError(err, options);
}
if (err instanceof Error) {
return new ValidationError(err.message);
}
return new ValidationError('Unknown error');
};
exports.toValidationError = toValidationError;
function isValidationError(err) {
return err instanceof ValidationError;
}
exports.isValidationError = isValidationError;
function isValidationErrorLike(err) {
return err instanceof Error && err.name === 'ZodValidationError';
}
exports.isValidationErrorLike = isValidationErrorLike;
const errorMap = (issue, ctx) => {
const error = fromZodIssue({
...issue,
message: issue.message ?? ctx.defaultError,
});
return {
message: error.message,
};
};
exports.errorMap = errorMap;

View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.errorMap = exports.fromZodIssue = exports.fromZodError = exports.isValidationErrorLike = exports.isValidationError = exports.toValidationError = exports.ValidationError = void 0;
var ValidationError_1 = require("./ValidationError");
Object.defineProperty(exports, "ValidationError", { enumerable: true, get: function () { return ValidationError_1.ValidationError; } });
Object.defineProperty(exports, "toValidationError", { enumerable: true, get: function () { return ValidationError_1.toValidationError; } });
Object.defineProperty(exports, "isValidationError", { enumerable: true, get: function () { return ValidationError_1.isValidationError; } });
Object.defineProperty(exports, "isValidationErrorLike", { enumerable: true, get: function () { return ValidationError_1.isValidationErrorLike; } });
Object.defineProperty(exports, "fromZodError", { enumerable: true, get: function () { return ValidationError_1.fromZodError; } });
Object.defineProperty(exports, "fromZodIssue", { enumerable: true, get: function () { return ValidationError_1.fromZodIssue; } });
Object.defineProperty(exports, "errorMap", { enumerable: true, get: function () { return ValidationError_1.errorMap; } });

View File

@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isNonEmptyArray = void 0;
function isNonEmptyArray(value) {
return value.length !== 0;
}
exports.isNonEmptyArray = isNonEmptyArray;

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.joinPath = void 0;
const identifierRegex = /[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;
function joinPath(path) {
if (path.length === 1) {
return path[0].toString();
}
return path.reduce((acc, item) => {
if (typeof item === 'number') {
return acc + '[' + item.toString() + ']';
}
if (item.includes('"')) {
return acc + '["' + escapeQuotes(item) + '"]';
}
if (!identifierRegex.test(item)) {
return acc + '["' + item + '"]';
}
const separator = acc.length === 0 ? '' : '.';
return acc + separator + item;
}, '');
}
exports.joinPath = joinPath;
function escapeQuotes(str) {
return str.replace(/"/g, '\\"');
}