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,21 @@
MIT License
Copyright (c) 2019 James Ide
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,2 @@
# backoff
Computes truncated exponential backoff intervals with jitter

View File

@@ -0,0 +1,6 @@
export declare function computeNextBackoffInterval(initialBackoff: number, previousRetryCount: number, { multiplier, randomizationFactor, minBackoff, maxBackoff, }?: {
multiplier?: number | undefined;
randomizationFactor?: number | undefined;
minBackoff?: number | undefined;
maxBackoff?: number | undefined;
}): number;

View File

@@ -0,0 +1,19 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const assert_1 = __importDefault(require("assert"));
function computeNextBackoffInterval(initialBackoff, previousRetryCount, { multiplier = 1.5, randomizationFactor = 0.25, minBackoff = initialBackoff, maxBackoff = Infinity, } = {}) {
assert_1.default(initialBackoff > 0, `The initial backoff interval must be positive`);
assert_1.default(previousRetryCount >= 0, `The previous retry count must not be negative`);
assert_1.default(multiplier >= 1, `The backoff multiplier must be greater than or equal to 1`);
assert_1.default(0 <= randomizationFactor && randomizationFactor <= 1, `The randomization factor must be between 0 and 1, inclusive`);
assert_1.default(minBackoff >= 0, `The minimum backoff interval must be positive`);
let nextBackoff = initialBackoff * multiplier ** previousRetryCount;
// Apply jitter within the negative to positive range of the randomization factor
let jitterFactor = 1 - randomizationFactor + 2 * randomizationFactor * Math.random();
return Math.min(Math.max(nextBackoff * jitterFactor, minBackoff), maxBackoff);
}
exports.computeNextBackoffInterval = computeNextBackoffInterval;
//# sourceMappingURL=backoff.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"backoff.js","sourceRoot":"","sources":["../src/backoff.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B;AAE5B,SAAgB,0BAA0B,CACxC,cAAsB,EACtB,kBAA0B,EAC1B,EACE,UAAU,GAAG,GAAG,EAChB,mBAAmB,GAAG,IAAI,EAC1B,UAAU,GAAG,cAAc,EAC3B,UAAU,GAAG,QAAQ,GACtB,GAAG,EAAE;IAEN,gBAAM,CAAC,cAAc,GAAG,CAAC,EAAE,+CAA+C,CAAC,CAAC;IAC5E,gBAAM,CAAC,kBAAkB,IAAI,CAAC,EAAE,+CAA+C,CAAC,CAAC;IACjF,gBAAM,CAAC,UAAU,IAAI,CAAC,EAAE,2DAA2D,CAAC,CAAC;IACrF,gBAAM,CACJ,CAAC,IAAI,mBAAmB,IAAI,mBAAmB,IAAI,CAAC,EACpD,6DAA6D,CAC9D,CAAC;IACF,gBAAM,CAAC,UAAU,IAAI,CAAC,EAAE,+CAA+C,CAAC,CAAC;IAEzE,IAAI,WAAW,GAAG,cAAc,GAAG,UAAU,IAAI,kBAAkB,CAAC;IACpE,iFAAiF;IACjF,IAAI,YAAY,GAAG,CAAC,GAAG,mBAAmB,GAAG,CAAC,GAAG,mBAAmB,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IACrF,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,GAAG,YAAY,EAAE,UAAU,CAAC,EAAE,UAAU,CAAC,CAAC;AAChF,CAAC;AAvBD,gEAuBC","sourcesContent":["import assert from 'assert';\n\nexport function computeNextBackoffInterval(\n initialBackoff: number,\n previousRetryCount: number,\n {\n multiplier = 1.5,\n randomizationFactor = 0.25,\n minBackoff = initialBackoff,\n maxBackoff = Infinity,\n } = {},\n): number {\n assert(initialBackoff > 0, `The initial backoff interval must be positive`);\n assert(previousRetryCount >= 0, `The previous retry count must not be negative`);\n assert(multiplier >= 1, `The backoff multiplier must be greater than or equal to 1`);\n assert(\n 0 <= randomizationFactor && randomizationFactor <= 1,\n `The randomization factor must be between 0 and 1, inclusive`,\n );\n assert(minBackoff >= 0, `The minimum backoff interval must be positive`);\n\n let nextBackoff = initialBackoff * multiplier ** previousRetryCount;\n // Apply jitter within the negative to positive range of the randomization factor\n let jitterFactor = 1 - randomizationFactor + 2 * randomizationFactor * Math.random();\n return Math.min(Math.max(nextBackoff * jitterFactor, minBackoff), maxBackoff);\n}\n"]}

View File

@@ -0,0 +1,41 @@
{
"name": "@ide/backoff",
"version": "1.0.0",
"description": "Computes truncated exponential backoff intervals with jitter",
"main": "build/backoff.js",
"files": [
"build"
],
"scripts": {
"clean": "rm -fr build tsconfig.tsbuildinfo",
"build": "tsc",
"test": "jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ide/backoff.git"
},
"keywords": [
"backoff"
],
"author": "James Ide",
"license": "MIT",
"bugs": {
"url": "https://github.com/ide/backoff/issues"
},
"homepage": "https://github.com/ide/backoff#readme",
"jest": {
"roots": [
"<rootDir>/src/"
],
"testEnvironment": "node"
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.5.0",
"@babel/preset-typescript": "^7.3.3",
"@types/jest": "^24.0.18",
"@types/node": "^12.7.2",
"jest": "^24.9.0",
"typescript": "^3.5.3"
}
}