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

21
smart-app-city/frontend/node_modules/@expo/env/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2023-present 650 Industries, Inc. (aka Expo)
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,3 @@
# @expo/env
Load environment variables from `.env` files. Supports the [standard .env formats](https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use).

View File

@@ -0,0 +1,19 @@
/// <reference types="node" />
type LoadOptions = {
silent?: boolean;
force?: boolean;
};
export declare function isEnabled(): boolean;
export declare function createControlledEnvironment(): {
load: (projectRoot: string, options?: LoadOptions) => NodeJS.ProcessEnv;
get: (projectRoot: string, options?: LoadOptions) => {
env: Record<string, string | undefined>;
files: string[];
};
_getForce: (projectRoot: string, options?: LoadOptions) => {
env: Record<string, string | undefined>;
files: string[];
};
};
export declare function getFiles(mode: string | undefined, { silent }?: Pick<LoadOptions, 'silent'>): string[];
export {};

View File

@@ -0,0 +1,238 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createControlledEnvironment = createControlledEnvironment;
exports.getFiles = getFiles;
exports.isEnabled = isEnabled;
function _chalk() {
const data = _interopRequireDefault(require("chalk"));
_chalk = function () {
return data;
};
return data;
}
function dotenv() {
const data = _interopRequireWildcard(require("dotenv"));
dotenv = function () {
return data;
};
return data;
}
function _dotenvExpand() {
const data = require("dotenv-expand");
_dotenvExpand = function () {
return data;
};
return data;
}
function fs() {
const data = _interopRequireWildcard(require("fs"));
fs = function () {
return data;
};
return data;
}
function _getenv() {
const data = require("getenv");
_getenv = function () {
return data;
};
return data;
}
function path() {
const data = _interopRequireWildcard(require("path"));
path = function () {
return data;
};
return data;
}
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* Copyright © 2023 650 Industries.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const debug = require('debug')('expo:env');
function isEnabled() {
return !(0, _getenv().boolish)('EXPO_NO_DOTENV', false);
}
function createControlledEnvironment() {
let userDefinedEnvironment = undefined;
let memo = undefined;
function _getForce(projectRoot, options = {}) {
if (!isEnabled()) {
debug(`Skipping .env files because EXPO_NO_DOTENV is defined`);
return {
env: {},
files: []
};
}
if (!userDefinedEnvironment) {
userDefinedEnvironment = {
...process.env
};
}
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
const dotenvFiles = getFiles(process.env.NODE_ENV, options);
// Load environment variables from .env* files. Suppress warnings using silent
// if this file is missing. Dotenv will only parse the environment variables,
// `@expo/env` will set the resulting variables to the current process.
// Variable expansion is supported in .env files, and executed as final step.
// https://github.com/motdotla/dotenv
// https://github.com/motdotla/dotenv-expand
const parsedEnv = {};
const loadedEnvFiles = [];
// Iterate over each dotenv file in lowest prio to highest prio order.
// This step won't write to the process.env, but will overwrite the parsed envs.
dotenvFiles.reverse().forEach(dotenvFile => {
const absoluteDotenvFile = path().resolve(projectRoot, dotenvFile);
if (!fs().existsSync(absoluteDotenvFile)) {
return;
}
try {
const result = dotenv().parse(fs().readFileSync(absoluteDotenvFile, 'utf-8'));
if (!result) {
debug(`Failed to load environment variables from: ${absoluteDotenvFile}%s`);
} else {
loadedEnvFiles.push(absoluteDotenvFile);
debug(`Loaded environment variables from: ${absoluteDotenvFile}`);
for (const key of Object.keys(result)) {
if (typeof userDefinedEnvironment?.[key] !== 'undefined') {
debug(`"${key}" is already defined and IS NOT overwritten by: ${absoluteDotenvFile}`);
} else {
if (typeof parsedEnv[key] !== 'undefined') {
debug(`"${key}" is already defined and overwritten by: ${absoluteDotenvFile}`);
}
parsedEnv[key] = result[key];
}
}
}
} catch (error) {
if (error instanceof Error) {
console.error(`Failed to load environment variables from ${absoluteDotenvFile}: ${error.message}`);
} else {
throw error;
}
}
});
if (!loadedEnvFiles.length) {
debug(`No environment variables loaded from .env files.`);
}
return {
env: _expandEnv(parsedEnv),
files: loadedEnvFiles.reverse()
};
}
/** Expand environment variables based on the current and parsed envs */
function _expandEnv(parsedEnv) {
const expandedEnv = {};
// Pass a clone of `process.env` to avoid mutating the original environment.
// When the expansion is done, we only store the environment variables that were initially parsed from `parsedEnv`.
const allExpandedEnv = (0, _dotenvExpand().expand)({
parsed: parsedEnv,
processEnv: {
...process.env
}
});
if (allExpandedEnv.error) {
console.error(`Failed to expand environment variables, using non-expanded environment variables: ${allExpandedEnv.error}`);
return parsedEnv;
}
// Only store the values that were initially parsed, from `parsedEnv`.
for (const key of Object.keys(parsedEnv)) {
if (allExpandedEnv.parsed?.[key]) {
expandedEnv[key] = allExpandedEnv.parsed[key];
}
}
return expandedEnv;
}
/** Get the environment variables without mutating the environment. This returns memoized values unless the `force` property is provided. */
function get(projectRoot, options = {}) {
if (!isEnabled()) {
debug(`Skipping .env files because EXPO_NO_DOTENV is defined`);
return {
env: {},
files: []
};
}
if (!options.force && memo) {
return memo;
}
memo = _getForce(projectRoot, options);
return memo;
}
/** Load environment variables from .env files and mutate the current `process.env` with the results. */
function load(projectRoot, options = {}) {
if (!isEnabled()) {
debug(`Skipping .env files because EXPO_NO_DOTENV is defined`);
return process.env;
}
const envInfo = get(projectRoot, options);
if (!options.force) {
const keys = Object.keys(envInfo.env);
if (keys.length) {
console.log(_chalk().default.gray('env: load', envInfo.files.map(file => path().basename(file)).join(' ')));
console.log(_chalk().default.gray('env: export', keys.join(' ')));
}
}
for (const key of Object.keys(envInfo.env)) {
// Avoid creating a new object, mutate it instead as this causes problems in Bun
process.env[key] = envInfo.env[key];
}
return process.env;
}
return {
load,
get,
_getForce
};
}
function getFiles(mode, {
silent = false
} = {}) {
if (!isEnabled()) {
debug(`Skipping .env files because EXPO_NO_DOTENV is defined`);
return [];
}
if (!mode) {
if (silent) {
debug('NODE_ENV is not defined, proceeding without mode-specific .env');
} else {
console.error(_chalk().default.red('The NODE_ENV environment variable is required but was not specified. Ensure the project is bundled with Expo CLI or NODE_ENV is set.'));
console.error(_chalk().default.red('Proceeding without mode-specific .env'));
}
}
if (mode && !['development', 'test', 'production'].includes(mode)) {
if (silent) {
debug(`NODE_ENV="${mode}" is non-conventional and might cause development code to run in production. Use "development", "test", or "production" instead.`);
} else {
console.warn(_chalk().default.yellow(`"NODE_ENV=${mode}" is non-conventional and might cause development code to run in production. Use "development", "test", or "production" instead`));
}
}
if (!mode) {
// Support environments that don't respect NODE_ENV
return [`.env.local`, '.env'];
}
// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
const dotenvFiles = [`.env.${mode}.local`,
// Don't include `.env.local` for `test` environment
// since normally you expect tests to produce the same
// results for everyone
mode !== 'test' && `.env.local`, `.env.${mode}`, '.env'].filter(Boolean);
return dotenvFiles;
}
//# sourceMappingURL=env.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,19 @@
/// <reference types="node" />
/**
* Copyright © 2023 650 Industries.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { getFiles, isEnabled } from './env';
declare const get: (projectRoot: string, options?: {
silent?: boolean | undefined;
force?: boolean | undefined;
}) => {
env: Record<string, string | undefined>;
files: string[];
}, load: (projectRoot: string, options?: {
silent?: boolean | undefined;
force?: boolean | undefined;
}) => NodeJS.ProcessEnv;
export { getFiles, get, load, isEnabled };

View File

@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.get = void 0;
Object.defineProperty(exports, "getFiles", {
enumerable: true,
get: function () {
return _env().getFiles;
}
});
Object.defineProperty(exports, "isEnabled", {
enumerable: true,
get: function () {
return _env().isEnabled;
}
});
exports.load = void 0;
function _env() {
const data = require("./env");
_env = function () {
return data;
};
return data;
}
/**
* Copyright © 2023 650 Industries.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const {
get,
load
} = (0, _env().createControlledEnvironment)();
exports.load = load;
exports.get = get;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["_env","data","require","get","load","createControlledEnvironment","exports"],"sources":["../src/index.ts"],"sourcesContent":["/**\n * Copyright © 2023 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { createControlledEnvironment, getFiles, isEnabled } from './env';\n\nconst { get, load } = createControlledEnvironment();\n\nexport { getFiles, get, load, isEnabled };\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,SAAAA,KAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,IAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AANA;AACA;AACA;AACA;AACA;AACA;;AAGA,MAAM;EAAEE,GAAG;EAAEC;AAAK,CAAC,GAAG,IAAAC,kCAA2B,EAAC,CAAC;AAACC,OAAA,CAAAF,IAAA,GAAAA,IAAA;AAAAE,OAAA,CAAAH,GAAA,GAAAA,GAAA"}

View File

@@ -0,0 +1,45 @@
{
"name": "@expo/env",
"version": "0.3.0",
"description": "hydrate environment variables from .env files into process.env",
"main": "build/index.js",
"scripts": {
"build": "tsc --emitDeclarationOnly && babel src --out-dir build --extensions \".ts\" --source-maps --ignore \"src/**/__mocks__/*\",\"src/**/__tests__/*\"",
"clean": "expo-module clean",
"lint": "expo-module lint",
"prepare": "expo-module clean && yarn run build",
"prepublishOnly": "expo-module prepublishOnly",
"test": "expo-module test",
"typecheck": "expo-module typecheck"
},
"repository": {
"type": "git",
"url": "https://github.com/expo/expo.git",
"directory": "packages/@expo/env"
},
"keywords": [],
"license": "MIT",
"bugs": {
"url": "https://github.com/expo/expo/issues"
},
"homepage": "https://github.com/expo/expo/tree/main/packages/@expo/env#readme",
"files": [
"build"
],
"dependencies": {
"chalk": "^4.0.0",
"debug": "^4.3.4",
"dotenv": "~16.4.5",
"dotenv-expand": "~11.0.6",
"getenv": "^1.0.0"
},
"devDependencies": {
"@babel/core": "^7.15.5",
"@types/getenv": "^1.0.0",
"expo-module-scripts": "^3.3.0"
},
"publishConfig": {
"access": "public"
},
"gitHead": "4165b8d72e1b9a1889c2767534cc619e21468110"
}