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,37 @@
"use strict";
const { add, add0, add1, get0, get1, inc, neg, sub, sub1 } = require("../ob1");
const FORTY_TWO_0 = add0(42);
const FORTY_TWO_1 = add1(42);
module.exports = {
testSafeOps() {
add(FORTY_TWO_0, FORTY_TWO_0);
add(FORTY_TWO_0, FORTY_TWO_1);
add(FORTY_TWO_1, FORTY_TWO_0);
sub(FORTY_TWO_1, FORTY_TWO_1);
add(FORTY_TWO_0, 9000);
add(FORTY_TWO_0, 9000);
add(FORTY_TWO_1, 9000);
sub(FORTY_TWO_1, 9000);
get0(FORTY_TWO_0);
get1(FORTY_TWO_1);
neg(FORTY_TWO_0);
add1(FORTY_TWO_0);
sub1(FORTY_TWO_1);
inc(FORTY_TWO_0);
inc(FORTY_TWO_1);
},
testUnsafeOps() {
add(FORTY_TWO_1, FORTY_TWO_1);
sub(FORTY_TWO_0, FORTY_TWO_1);
FORTY_TWO_0 - 1;
FORTY_TWO_1 - 1;
get0(FORTY_TWO_1);
get1(FORTY_TWO_0);
neg(FORTY_TWO_1);
add1(FORTY_TWO_1);
sub1(FORTY_TWO_0);
get0(42);
get1(42);
},
};

View File

@@ -0,0 +1,72 @@
/**
* 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
*/
'use strict';
import type {Number0, Number1} from '../ob1';
const {add, add0, add1, get0, get1, inc, neg, sub, sub1} = require('../ob1');
const FORTY_TWO_0 = add0(42);
const FORTY_TWO_1 = add1(42);
module.exports = {
testSafeOps() {
(add(FORTY_TWO_0, FORTY_TWO_0): Number0);
(add(FORTY_TWO_0, FORTY_TWO_1): Number1);
(add(FORTY_TWO_1, FORTY_TWO_0): Number1);
(sub(FORTY_TWO_1, FORTY_TWO_1): Number0);
(add(FORTY_TWO_0, 9000): Number0);
(add(FORTY_TWO_0, 9000): Number0);
(add(FORTY_TWO_1, 9000): Number1);
(sub(FORTY_TWO_1, 9000): Number1);
(get0(FORTY_TWO_0): number);
(get1(FORTY_TWO_1): number);
(neg(FORTY_TWO_0): Number0);
(add1(FORTY_TWO_0): Number1);
(sub1(FORTY_TWO_1): Number0);
(inc(FORTY_TWO_0): Number0);
(inc(FORTY_TWO_1): Number1);
},
testUnsafeOps() {
// $FlowExpectedError - adding two 1-based offsets.
add(FORTY_TWO_1, FORTY_TWO_1);
// $FlowExpectedError - subtracting 1-based offset from 0-based offset.
sub(FORTY_TWO_0, FORTY_TWO_1);
// $FlowExpectedError - direct computations with offsets are disallowed.
FORTY_TWO_0 - 1;
// $FlowExpectedError - direct computations with offsets are disallowed.
FORTY_TWO_1 - 1;
// $FlowExpectedError - extracting a 1-based offset as a 0-based number
get0(FORTY_TWO_1);
// $FlowExpectedError - extracting a 0-based offset as a 1-based number
get1(FORTY_TWO_0);
// $FlowExpectedError - negating a 1-based offset
neg(FORTY_TWO_1);
// $FlowExpectedError - adding 1 to an offset that's already 1-based
add1(FORTY_TWO_1);
// $FlowExpectedError - subtracting 1 from an offset that's already 0-based
sub1(FORTY_TWO_0);
// $FlowExpectedError - extracting an arbitrary number as a 0-based number
get0(42);
// $FlowExpectedError - extracting an arbitrary number as a 1-based number
get1(42);
},
};

40
smart-app-city/frontend/node_modules/ob1/src/ob1.js generated vendored Normal file
View File

@@ -0,0 +1,40 @@
"use strict";
function add(a, b) {
return a + b;
}
function sub(a, b) {
return a - b;
}
function get0(x) {
return x;
}
function get1(x) {
return x;
}
function add1(x) {
return x + 1;
}
function sub1(x) {
return x - 1;
}
function neg(x) {
return -x;
}
function add0(x) {
return x;
}
function inc(x) {
return x + 1;
}
module.exports = {
add,
get0,
get1,
add1,
sub1,
sub,
neg,
add0,
inc,
};

View File

@@ -0,0 +1,90 @@
/**
* 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
*/
'use strict';
/* eslint-disable no-redeclare */
// A type representing 0-based offsets.
export opaque type Number0 = number;
// A type representing 1-based offsets.
export opaque type Number1 = number;
// Add two offsets or numbers.
declare function add(a: Number1, b: number): Number1;
declare function add(a: number, b: Number1): Number1;
declare function add(a: Number0, b: number): Number0;
declare function add(a: number, b: Number0): Number0;
declare function add(a: Number1, b: Number0): Number1;
declare function add(a: Number0, b: Number1): Number1;
declare function add(a: Number0, b: Number0): Number0;
function add(a: number, b: number): number {
return a + b;
}
// Subtract a number or 0-based offset from a 1/0-based offset.
declare function sub(a: Number1, b: number): Number1;
declare function sub(a: Number0, b: number): Number0;
declare function sub(a: number, b: Number0): Number0;
declare function sub(a: Number0, b: number): Number0;
declare function sub(a: Number1, b: Number0): Number1;
declare function sub(a: Number0, b: Number0): Number0;
declare function sub(a: Number1, b: Number1): Number0;
function sub(a: number, b: number): number {
return a - b;
}
// Get the underlying number of a 0-based offset, casting away the opaque type.
declare function get0(x: Number0): number;
declare function get0(x: void | null): void | null;
function get0(x: number): number {
return x;
}
// Get the underlying number of a 1-based offset, casting away the opaque type.
declare function get1(x: Number1): number;
declare function get1(x: void | null): void | null;
function get1(x: number): number {
return x;
}
// Add 1 to a 0-based offset, thus converting it to 1-based.
function add1(x: Number0 | number): Number1 {
return x + 1;
}
// Subtract 1 from a 1-based offset, thus converting it to 0-based.
function sub1(x: Number1): Number0 {
return x - 1;
}
// Negate a 0-based offset.
function neg(x: Number0): Number0 {
return -x;
}
// Cast a number to a 0-based offset.
function add0(x: number): Number0 {
return x;
}
// Increment a 0-based offset.
declare function inc(a: Number0): Number0;
// Increment a 1-based offset.
declare function inc(a: Number1): Number1;
function inc(x: number): number {
return x + 1;
}
module.exports = {add, get0, get1, add1, sub1, sub, neg, add0, inc};