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,25 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
import type { Logger } from "../types/Logger";
import type { NextHandleFunction } from "connect";
type Options = Readonly<{ logger?: Logger }>;
/**
* Open the legacy Flipper debugger (Hermes).
*
* @deprecated This replicates the pre-0.73 workflow of opening Flipper via the
* `flipper://` URL scheme, failing if Flipper is not installed locally. This
* flow will be removed in a future version.
*/
declare function deprecated_openFlipperMiddleware(
$$PARAM_0$$: Options
): NextHandleFunction;
export default deprecated_openFlipperMiddleware;

View File

@@ -0,0 +1,60 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = deprecated_openFlipperMiddleware;
var _open = _interopRequireDefault(require("open"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
const FLIPPER_SELF_CONNECT_URL =
"flipper://null/Hermesdebuggerrn?device=React%20Native";
/**
* Open the legacy Flipper debugger (Hermes).
*
* @deprecated This replicates the pre-0.73 workflow of opening Flipper via the
* `flipper://` URL scheme, failing if Flipper is not installed locally. This
* flow will be removed in a future version.
*/
function deprecated_openFlipperMiddleware({ logger }) {
return async (req, res, next) => {
if (req.method === "POST") {
logger?.info("Launching JS debugger...");
try {
logger?.warn(
"Attempting to debug JS in Flipper (deprecated). This requires " +
"Flipper to be installed on your system to handle the " +
"'flipper://' URL scheme."
);
logger?.info(
"In React Native 0.74, Flipper is no longer included for new React " +
"Native projects. The Flipper React Native plugin is also " +
"unsupported. You can continue to use Flipper to debug " +
"your app's JavaScript code, however we recommend switching to " +
"a modern alternative.\nSee " +
"https://reactnative.dev/docs/debugging#opening-the-debugger."
);
await (0, _open.default)(FLIPPER_SELF_CONNECT_URL);
res.end();
} catch (e) {
logger?.error(
"Error launching Flipper: " + e.message ?? "Unknown error"
);
res.writeHead(500);
res.end();
}
}
};
}

View File

@@ -0,0 +1,27 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type { Logger } from "../types/Logger";
import type { NextHandleFunction } from "connect";
type Options = $ReadOnly<{
logger?: Logger,
}>;
/**
* Open the legacy Flipper debugger (Hermes).
*
* @deprecated This replicates the pre-0.73 workflow of opening Flipper via the
* `flipper://` URL scheme, failing if Flipper is not installed locally. This
* flow will be removed in a future version.
*/
declare export default function deprecated_openFlipperMiddleware(
Options
): NextHandleFunction;

View File

@@ -0,0 +1,37 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
import type { InspectorProxyQueries } from "../inspector-proxy/InspectorProxy";
import type { BrowserLauncher } from "../types/BrowserLauncher";
import type { EventReporter } from "../types/EventReporter";
import type { Experiments } from "../types/Experiments";
import type { Logger } from "../types/Logger";
import type { NextHandleFunction } from "connect";
type Options = Readonly<{
serverBaseUrl: string;
logger?: Logger;
browserLauncher: BrowserLauncher;
eventReporter?: EventReporter;
experiments: Experiments;
inspectorProxy: InspectorProxyQueries;
}>;
/**
* Open the JavaScript debugger for a given CDP target (direct Hermes debugging).
*
* Currently supports Hermes targets, opening debugger websocket URL in Chrome
* DevTools.
*
* @see https://chromedevtools.github.io/devtools-protocol/
*/
declare function openDebuggerMiddleware(
$$PARAM_0$$: Options
): NextHandleFunction;
export default openDebuggerMiddleware;

View File

@@ -0,0 +1,149 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true,
});
exports.default = openDebuggerMiddleware;
var _getDevToolsFrontendUrl = _interopRequireDefault(
require("../utils/getDevToolsFrontendUrl")
);
var _url = _interopRequireDefault(require("url"));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
* @format
* @oncall react_native
*/
const debuggerInstances = new Map();
/**
* Open the JavaScript debugger for a given CDP target (direct Hermes debugging).
*
* Currently supports Hermes targets, opening debugger websocket URL in Chrome
* DevTools.
*
* @see https://chromedevtools.github.io/devtools-protocol/
*/
function openDebuggerMiddleware({
serverBaseUrl,
logger,
browserLauncher,
eventReporter,
experiments,
inspectorProxy,
}) {
return async (req, res, next) => {
if (
req.method === "POST" ||
(experiments.enableOpenDebuggerRedirect && req.method === "GET")
) {
const { query } = _url.default.parse(req.url, true);
const { appId, device } = query;
const targets = inspectorProxy.getPageDescriptions().filter(
// Only use targets with better reloading support
(app) =>
app.title === "React Native Experimental (Improved Chrome Reloads)" ||
app.reactNative.capabilities?.nativePageReloads === true
);
let target;
const launchType = req.method === "POST" ? "launch" : "redirect";
if (typeof appId === "string" || typeof device === "string") {
logger?.info(
(launchType === "launch" ? "Launching" : "Redirecting to") +
" JS debugger (experimental)..."
);
if (typeof device === "string") {
target = targets.find(
(_target) => _target.reactNative.logicalDeviceId === device
);
}
if (!target && typeof appId === "string") {
target = targets.find((_target) => _target.description === appId);
}
} else {
logger?.info(
(launchType === "launch" ? "Launching" : "Redirecting to") +
" JS debugger for first available target..."
);
target = targets[0];
}
if (!target) {
res.writeHead(404);
res.end("Unable to find Chrome DevTools inspector target");
logger?.warn(
"No compatible apps connected. JavaScript debugging can only be used with the Hermes engine."
);
eventReporter?.logEvent({
type: "launch_debugger_frontend",
launchType,
status: "coded_error",
errorCode: "NO_APPS_FOUND",
});
return;
}
try {
switch (launchType) {
case "launch":
const frontendInstanceId =
device != null
? "device:" + device
: "app:" + (appId ?? "<null>");
await debuggerInstances.get(frontendInstanceId)?.kill();
debuggerInstances.set(
frontendInstanceId,
await browserLauncher.launchDebuggerAppWindow(
(0, _getDevToolsFrontendUrl.default)(
experiments,
target.webSocketDebuggerUrl,
serverBaseUrl
)
)
);
res.end();
break;
case "redirect":
res.writeHead(302, {
Location: (0, _getDevToolsFrontendUrl.default)(
experiments,
target.webSocketDebuggerUrl,
// Use a relative URL.
""
),
});
res.end();
break;
default:
}
eventReporter?.logEvent({
type: "launch_debugger_frontend",
launchType,
status: "success",
appId: appId ?? null,
deviceId: device ?? null,
});
return;
} catch (e) {
logger?.error(
"Error launching JS debugger: " + e.message ?? "Unknown error"
);
res.writeHead(500);
res.end();
eventReporter?.logEvent({
type: "launch_debugger_frontend",
launchType,
status: "error",
error: e,
});
return;
}
}
next();
};
}

View File

@@ -0,0 +1,37 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict-local
* @format
* @oncall react_native
*/
import type { InspectorProxyQueries } from "../inspector-proxy/InspectorProxy";
import type { BrowserLauncher } from "../types/BrowserLauncher";
import type { EventReporter } from "../types/EventReporter";
import type { Experiments } from "../types/Experiments";
import type { Logger } from "../types/Logger";
import type { NextHandleFunction } from "connect";
type Options = $ReadOnly<{
serverBaseUrl: string,
logger?: Logger,
browserLauncher: BrowserLauncher,
eventReporter?: EventReporter,
experiments: Experiments,
inspectorProxy: InspectorProxyQueries,
}>;
/**
* Open the JavaScript debugger for a given CDP target (direct Hermes debugging).
*
* Currently supports Hermes targets, opening debugger websocket URL in Chrome
* DevTools.
*
* @see https://chromedevtools.github.io/devtools-protocol/
*/
declare export default function openDebuggerMiddleware(
Options
): NextHandleFunction;