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

31
smart-app-city/frontend/node_modules/fbemitter/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,31 @@
BSD License
For emitter software
Copyright (c) 2013-present, Facebook, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name Facebook nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

33
smart-app-city/frontend/node_modules/fbemitter/PATENTS generated vendored Normal file
View File

@@ -0,0 +1,33 @@
Additional Grant of Patent Rights Version 2
"Software" means the emitter software distributed by Facebook, Inc.
Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software
("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
(subject to the termination provision below) license under any Necessary
Claims, to make, have made, use, sell, offer to sell, import, and otherwise
transfer the Software. For avoidance of doubt, no license is granted under
Facebook's rights in any patent claims that are infringed by (i) modifications
to the Software made by you or any third party or (ii) the Software in
combination with any software or other technology.
The license granted hereunder will terminate, automatically and without notice,
if you (or any of your subsidiaries, corporate affiliates or agents) initiate
directly or indirectly, or take a direct financial interest in, any Patent
Assertion: (i) against Facebook or any of its subsidiaries or corporate
affiliates, (ii) against any party if such Patent Assertion arises in whole or
in part from any software, technology, product or service of Facebook or any of
its subsidiaries or corporate affiliates, or (iii) against any party relating
to the Software. Notwithstanding the foregoing, if Facebook or any of its
subsidiaries or corporate affiliates files a lawsuit alleging patent
infringement against you in the first instance, and you respond by filing a
patent infringement counterclaim in that lawsuit against that party that is
unrelated to the Software, the license granted hereunder will not terminate
under section (i) of this paragraph due to such counterclaim.
A "Necessary Claim" is a claim of a patent owned by Facebook that is
necessarily infringed by the Software standing alone.
A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
or contributory infringement or inducement to infringe any patent, including a
cross-claim or counterclaim.

View File

@@ -0,0 +1,124 @@
# EventEmitter
Facebook's EventEmitter is a simple emitter implementation that prioritizes speed and simplicity. It is conceptually similar to other emitters like Node's EventEmitter, but the precise APIs differ. More complex abstractions like the event systems used on facebook.com and m.facebook.com can be built on top of EventEmitter as well DOM event systems.
## API Concepts
EventEmitter's API shares many concepts with other emitter APIs. When events are emitted through an emitter instance, all listeners for the given event type are invoked.
```js
var emitter = new EventEmitter();
emitter.addListener('event', function(x, y) { console.log(x, y); });
emitter.emit('event', 5, 10); // Listener prints "5 10".
```
EventEmitters return a subscription for each added listener. Subscriptions provide a convenient way to remove listeners that ensures they are removed from the correct emitter instance.
```js
var subscription = emitter.addListener('event', listener);
subscription.remove();
```
## Usage
First install the `fbemitter` package via `npm`, then you can require or import it.
```js
var {EventEmitter} = require('fbemitter');
var emitter = new EventEmitter();
```
## Building from source
Once you have the repository cloned, building a copy of `fbemitter` is easy, just run `gulp build`. This assumes you've installed `gulp` globally with `npm install -g gulp`.
```sh
gulp build
```
## API
### `constructor()`
Create a new emitter using the class' constructor. It accepts no arguments.
```js
var {EventEmitter} = require('fbemitter');
var emitter = new EventEmitter();
```
### `addListener(eventType, callback)`
Register a specific callback to be called on a particular event. A token is returned that can be used to remove the listener.
```js
var token = emitter.addListener('change', (...args) => {
console.log(...args);
});
emitter.emit('change', 10); // 10 is logged
token.remove();
emitter.emit('change', 10); // nothing is logged
```
### `once(eventType, callback)`
Similar to `addListener()` but the callback is removed after it is invoked once. A token is returned that can be used to remove the listener.
```js
var token = emitter.once('change', (...args) => {
console.log(...args);
});
emitter.emit('change', 10); // 10 is logged
emitter.emit('change', 10); // nothing is logged
```
### `removeAllListeners(eventType)`
Removes all of the registered listeners. `eventType` is optional, if provided only listeners for that event type are removed.
```js
var token = emitter.addListener('change', (...args) => {
console.log(...args);
});
emitter.removeAllListeners();
emitter.emit('change', 10); // nothing is logged
```
### `listeners(eventType)`
Return an array of listeners that are currently registered for the given event type.
### `emit(eventType, ...args)`
Emits an event of the given type with the given data. All callbacks that are listening to the particular event type will be notified.
```js
var token = emitter.addListener('change', (...args) => {
console.log(...args);
});
emitter.emit('change', 10); // 10 is logged
```
### `__emitToSubscription(subscription, eventType, ...args)`
It is reasonable to extend `EventEmitter` in order to inject some custom logic that you want to do on every callback that is called during an emit, such as logging, or setting up error boundaries. `__emitToSubscription()` is exposed to make this possible.
```js
class MyEventEmitter extends EventEmitter {
__emitToSubscription(subscription, eventType) {
var args = Array.prototype.slice.call(arguments, 2);
var start = Date.now();
subscription.listener.apply(subscription.context, args);
var time = Date.now() - start;
MyLoggingUtility.log('callback-time', {eventType, time});
}
}
```
And then you can create instances of `MyEventEmitter` and use it like a standard `EventEmitter`. If you just want to log on each emit and not on each callback called during an emit you can override `emit()` instead of this method.

View File

@@ -0,0 +1,15 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
var fbemitter = {
EventEmitter: require('./lib/BaseEventEmitter'),
EmitterSubscription : require('./lib/EmitterSubscription')
};
module.exports = fbemitter;

View File

@@ -0,0 +1,197 @@
"use strict";
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule BaseEventEmitter
* @typechecks
*/
var EmitterSubscription = require("./EmitterSubscription.js");
var EventSubscriptionVendor = require("./EventSubscriptionVendor.js");
var invariant = require("fbjs/lib/invariant");
var emptyFunction = require("fbjs/lib/emptyFunction");
/**
* @class BaseEventEmitter
* @description
* An EventEmitter is responsible for managing a set of listeners and publishing
* events to them when it is told that such events happened. In addition to the
* data for the given event it also sends a event control object which allows
* the listeners/handlers to prevent the default behavior of the given event.
*
* The emitter is designed to be generic enough to support all the different
* contexts in which one might want to emit events. It is a simple multicast
* mechanism on top of which extra functionality can be composed. For example, a
* more advanced emitter may use an EventHolder and EventFactory.
*/
var BaseEventEmitter = /*#__PURE__*/function () {
/**
* @constructor
*/
function BaseEventEmitter() {
this._subscriber = new EventSubscriptionVendor();
this._currentSubscription = null;
}
/**
* Adds a listener to be invoked when events of the specified type are
* emitted. An optional calling context may be provided. The data arguments
* emitted will be passed to the listener function.
*
* TODO: Annotate the listener arg's type. This is tricky because listeners
* can be invoked with varargs.
*
* @param {string} eventType - Name of the event to listen to
* @param {function} listener - Function to invoke when the specified event is
* emitted
* @param {*} context - Optional context object to use when invoking the
* listener
*/
var _proto = BaseEventEmitter.prototype;
_proto.addListener = function addListener(eventType, listener, context) {
return this._subscriber.addSubscription(eventType, new EmitterSubscription(this._subscriber, listener, context));
}
/**
* Similar to addListener, except that the listener is removed after it is
* invoked once.
*
* @param {string} eventType - Name of the event to listen to
* @param {function} listener - Function to invoke only once when the
* specified event is emitted
* @param {*} context - Optional context object to use when invoking the
* listener
*/
;
_proto.once = function once(eventType, listener, context) {
var emitter = this;
return this.addListener(eventType, function () {
emitter.removeCurrentListener();
listener.apply(context, arguments);
});
}
/**
* Removes all of the registered listeners, including those registered as
* listener maps.
*
* @param {?string} eventType - Optional name of the event whose registered
* listeners to remove
*/
;
_proto.removeAllListeners = function removeAllListeners(eventType) {
this._subscriber.removeAllSubscriptions(eventType);
}
/**
* Provides an API that can be called during an eventing cycle to remove the
* last listener that was invoked. This allows a developer to provide an event
* object that can remove the listener (or listener map) during the
* invocation.
*
* If it is called when not inside of an emitting cycle it will throw.
*
* @throws {Error} When called not during an eventing cycle
*
* @example
* var subscription = emitter.addListenerMap({
* someEvent: function(data, event) {
* console.log(data);
* emitter.removeCurrentListener();
* }
* });
*
* emitter.emit('someEvent', 'abc'); // logs 'abc'
* emitter.emit('someEvent', 'def'); // does not log anything
*/
;
_proto.removeCurrentListener = function removeCurrentListener() {
!!!this._currentSubscription ? process.env.NODE_ENV !== "production" ? invariant(false, 'Not in an emitting cycle; there is no current subscription') : invariant(false) : void 0;
this._subscriber.removeSubscription(this._currentSubscription);
}
/**
* Returns an array of listeners that are currently registered for the given
* event.
*
* @param {string} eventType - Name of the event to query
* @return {array}
*/
;
_proto.listeners = function listeners(eventType)
/* TODO: Array<EventSubscription> */
{
var subscriptions = this._subscriber.getSubscriptionsForType(eventType);
return subscriptions ? subscriptions.filter(emptyFunction.thatReturnsTrue).map(function (subscription) {
return subscription.listener;
}) : [];
}
/**
* Emits an event of the given type with the given data. All handlers of that
* particular type will be notified.
*
* @param {string} eventType - Name of the event to emit
* @param {*} Arbitrary arguments to be passed to each registered listener
*
* @example
* emitter.addListener('someEvent', function(message) {
* console.log(message);
* });
*
* emitter.emit('someEvent', 'abc'); // logs 'abc'
*/
;
_proto.emit = function emit(eventType) {
var subscriptions = this._subscriber.getSubscriptionsForType(eventType);
if (subscriptions) {
var keys = Object.keys(subscriptions);
for (var ii = 0; ii < keys.length; ii++) {
var key = keys[ii];
var subscription = subscriptions[key]; // The subscription may have been removed during this event loop.
if (subscription) {
this._currentSubscription = subscription;
this.__emitToSubscription.apply(this, [subscription].concat(Array.prototype.slice.call(arguments)));
}
}
this._currentSubscription = null;
}
}
/**
* Provides a hook to override how the emitter emits an event to a specific
* subscription. This allows you to set up logging and error boundaries
* specific to your environment.
*
* @param {EmitterSubscription} subscription
* @param {string} eventType
* @param {*} Arbitrary arguments to be passed to each registered listener
*/
;
_proto.__emitToSubscription = function __emitToSubscription(subscription, eventType) {
var args = Array.prototype.slice.call(arguments, 2);
subscription.listener.apply(subscription.context, args);
};
return BaseEventEmitter;
}();
module.exports = BaseEventEmitter;

View File

@@ -0,0 +1,45 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule EmitterSubscription
* @typechecks
*/
'use strict';
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
var EventSubscription = require("./EventSubscription.js");
/**
* EmitterSubscription represents a subscription with listener and context data.
*/
var EmitterSubscription = /*#__PURE__*/function (_EventSubscription) {
_inheritsLoose(EmitterSubscription, _EventSubscription);
/**
* @param {EventSubscriptionVendor} subscriber - The subscriber that controls
* this subscription
* @param {function} listener - Function to invoke when the specified event is
* emitted
* @param {*} context - Optional context object to use when invoking the
* listener
*/
function EmitterSubscription(subscriber, listener, context) {
var _this;
_this = _EventSubscription.call(this, subscriber) || this;
_this.listener = listener;
_this.context = context;
return _this;
}
return EmitterSubscription;
}(EventSubscription);
module.exports = EmitterSubscription;

View File

@@ -0,0 +1,43 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule EventSubscription
* @typechecks
*/
'use strict';
/**
* EventSubscription represents a subscription to a particular event. It can
* remove its own subscription.
*/
var EventSubscription = /*#__PURE__*/function () {
/**
* @param {EventSubscriptionVendor} subscriber the subscriber that controls
* this subscription.
*/
function EventSubscription(subscriber) {
this.subscriber = subscriber;
}
/**
* Removes this subscription from the subscriber that controls it.
*/
var _proto = EventSubscription.prototype;
_proto.remove = function remove() {
if (this.subscriber) {
this.subscriber.removeSubscription(this);
this.subscriber = null;
}
};
return EventSubscription;
}();
module.exports = EventSubscription;

View File

@@ -0,0 +1,104 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule EventSubscriptionVendor
* @typechecks
*/
'use strict';
var invariant = require("fbjs/lib/invariant");
/**
* EventSubscriptionVendor stores a set of EventSubscriptions that are
* subscribed to a particular event type.
*/
var EventSubscriptionVendor = /*#__PURE__*/function () {
function EventSubscriptionVendor() {
this._subscriptionsForType = {};
this._currentSubscription = null;
}
/**
* Adds a subscription keyed by an event type.
*
* @param {string} eventType
* @param {EventSubscription} subscription
*/
var _proto = EventSubscriptionVendor.prototype;
_proto.addSubscription = function addSubscription(eventType, subscription) {
!(subscription.subscriber === this) ? process.env.NODE_ENV !== "production" ? invariant(false, 'The subscriber of the subscription is incorrectly set.') : invariant(false) : void 0;
if (!this._subscriptionsForType[eventType]) {
this._subscriptionsForType[eventType] = [];
}
var key = this._subscriptionsForType[eventType].length;
this._subscriptionsForType[eventType].push(subscription);
subscription.eventType = eventType;
subscription.key = key;
return subscription;
}
/**
* Removes a bulk set of the subscriptions.
*
* @param {?string} eventType - Optional name of the event type whose
* registered supscriptions to remove, if null remove all subscriptions.
*/
;
_proto.removeAllSubscriptions = function removeAllSubscriptions(eventType) {
if (eventType === undefined) {
this._subscriptionsForType = {};
} else {
delete this._subscriptionsForType[eventType];
}
}
/**
* Removes a specific subscription. Instead of calling this function, call
* `subscription.remove()` directly.
*
* @param {object} subscription
*/
;
_proto.removeSubscription = function removeSubscription(subscription) {
var eventType = subscription.eventType;
var key = subscription.key;
var subscriptionsForType = this._subscriptionsForType[eventType];
if (subscriptionsForType) {
delete subscriptionsForType[key];
}
}
/**
* Returns the array of subscriptions that are currently registered for the
* given event type.
*
* Note: This array can be potentially sparse as subscriptions are deleted
* from it when they are removed.
*
* TODO: This returns a nullable array. wat?
*
* @param {string} eventType
* @return {?array}
*/
;
_proto.getSubscriptionsForType = function getSubscriptionsForType(eventType) {
return this._subscriptionsForType[eventType];
};
return EventSubscriptionVendor;
}();
module.exports = EventSubscriptionVendor;

View File

@@ -0,0 +1,57 @@
{
"name": "fbemitter",
"version": "3.0.0",
"keywords": [
"clientside"
],
"bugs": "https://github.com/facebook/emitter/issues",
"license": "BSD-3-Clause",
"files": [
"LICENSE",
"PATENTS",
"README.md",
"index.js",
"lib/"
],
"main": "index.js",
"repository": "facebook/emitter",
"scripts": {
"build": "gulp build",
"prepublish": "npm run build",
"test": "NODE_ENV=test jest"
},
"dependencies": {
"fbjs": "^3.0.0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"del": "^2.2.0",
"fbjs-scripts": "^3.0.0",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-flatten": "^0.2.0",
"jest-cli": "^26.6.3",
"object-assign": "^4.0.1",
"run-sequence": "^1.1.5"
},
"jest": {
"modulePathIgnorePatterns": [
"/lib/",
"/node_modules/"
],
"transformIgnorePatterns": [
"/node_modules/"
],
"transform": {
"\\.js$": "<rootDir>/scripts/jest/preprocessor.js"
},
"rootDir": "",
"roots": [
"<rootDir>/src"
],
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/",
"<rootDir>/src/(?!(__forks__/fetch.js$|fetch/))"
]
}
}