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 @@
The MIT License (MIT)
Copyright (c) 2015-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,31 @@
<!-- Title -->
<h1 align="center">
👋 Welcome to <br><code>@expo/osascript</code>
</h1>
<p align="center">Tools for running osascripts in Node.</p>
<p align="center">
<img src="https://flat.badgen.net/packagephobia/install/@expo/osascript">
<a href="https://www.npmjs.com/package/@expo/osascript">
<img src="https://flat.badgen.net/npm/dw/@expo/osascript" target="_blank" />
</a>
</p>
<!-- Body -->
## Example
```sh
ccheever@Charless-MacBook-Air:~/projects/osascript$nesh -y
.Node v4.1.0
Type .help for more information
nesh*> .require .
osascript = require("/Users/ccheever/projects/osascript")
nesh*> yield osascript.execAsync('tell app "System Events" to count processes whose name is "Simulator"')
'1\n'
nesh*> yield osascript.spawnAsync('quit app "Safari"')
0
nesh*>
```

View File

@@ -0,0 +1,17 @@
import type { SpawnOptions, SpawnResult } from '@expo/spawn-async';
declare function escapeString(value: string): string;
declare function osascriptSpawnAsync(script: string | string[], opts?: SpawnOptions): Promise<SpawnResult>;
declare function isAppRunningAsync(appName: string): Promise<boolean>;
declare function safeIdOfAppAsync(appName: string): Promise<string | null>;
declare function openFinderToFolderAsync(dir: string, activate?: boolean): Promise<void>;
declare function openInAppAsync(appName: string, pth: string): Promise<SpawnResult>;
declare function chooseAppAsync(listOfAppNames: string[]): Promise<string | null>;
declare function chooseEditorAppAsync(preferredEditor?: string): Promise<string | null>;
declare function chooseTerminalAppAsync(): Promise<string | null>;
declare function openInEditorAsync(pth: string, preferredEditor?: string): Promise<SpawnResult>;
declare function openItermToSpecificFolderAsync(dir: string): Promise<SpawnResult>;
declare function openTerminalToSpecificFolderAsync(dir: string, inTab?: boolean): Promise<SpawnResult>;
declare function openFolderInTerminalAppAsync(dir: string, inTab?: boolean): Promise<SpawnResult>;
/** @deprecated */
declare function osascriptExecAsync(script: string | string[], opts?: SpawnOptions): Promise<string>;
export { chooseAppAsync, chooseEditorAppAsync, chooseTerminalAppAsync, escapeString, osascriptExecAsync as execAsync, isAppRunningAsync, openFinderToFolderAsync, openFolderInTerminalAppAsync, openInAppAsync, openInEditorAsync, openItermToSpecificFolderAsync, openTerminalToSpecificFolderAsync, safeIdOfAppAsync, osascriptSpawnAsync as spawnAsync, };

View File

@@ -0,0 +1,197 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.chooseAppAsync = chooseAppAsync;
exports.chooseEditorAppAsync = chooseEditorAppAsync;
exports.chooseTerminalAppAsync = chooseTerminalAppAsync;
exports.escapeString = escapeString;
exports.execAsync = osascriptExecAsync;
exports.isAppRunningAsync = isAppRunningAsync;
exports.openFinderToFolderAsync = openFinderToFolderAsync;
exports.openFolderInTerminalAppAsync = openFolderInTerminalAppAsync;
exports.openInAppAsync = openInAppAsync;
exports.openInEditorAsync = openInEditorAsync;
exports.openItermToSpecificFolderAsync = openItermToSpecificFolderAsync;
exports.openTerminalToSpecificFolderAsync = openTerminalToSpecificFolderAsync;
exports.safeIdOfAppAsync = safeIdOfAppAsync;
exports.spawnAsync = osascriptSpawnAsync;
const spawn_async_1 = __importDefault(require("@expo/spawn-async"));
const path_1 = __importDefault(require("path"));
function escapeString(value) {
return value
.replace(/\\/g, '\\\\')
.replace(/"/g, '\\"')
.replace(/\r/g, '\\r')
.replace(/\n/g, '\\n')
.replace(/\t/g, '\\t');
}
function shellQuote(value) {
return `'${value.replace(/'/g, `'\\''`)}'`;
}
function osascriptArgs(script) {
if (!Array.isArray(script)) {
script = [script];
}
const args = [];
for (const line of script) {
args.push('-e');
args.push(line);
}
return args;
}
async function osascriptSpawnAsync(script, opts) {
return await (0, spawn_async_1.default)('osascript', osascriptArgs(script), opts);
}
async function isAppRunningAsync(appName) {
const { stdout } = await osascriptSpawnAsync(`tell app "System Events" to count processes whose name is "${escapeString(appName)}"`);
return stdout.trim() !== '0';
}
async function safeIdOfAppAsync(appName) {
try {
const { stdout } = await osascriptSpawnAsync(`id of app "${escapeString(appName)}"`);
return stdout.trim();
}
catch {
return null;
}
}
async function openFinderToFolderAsync(dir, activate = true) {
await osascriptSpawnAsync([
'tell application "Finder"',
`open POSIX file "${escapeString(dir)}"`,
(activate && 'activate') || '',
'end tell',
]);
}
async function openInAppAsync(appName, pth) {
return await osascriptSpawnAsync(`tell app "${escapeString(appName)}" to open "${escapeString(path_1.default.resolve(pth))}"`);
}
async function chooseAppAsync(listOfAppNames) {
const runningAwaitables = [];
const appIdAwaitables = [];
for (const appName of listOfAppNames) {
runningAwaitables.push(isAppRunningAsync(appName));
appIdAwaitables.push(safeIdOfAppAsync(appName));
}
const running = await Promise.all(runningAwaitables);
const appIds = await Promise.all(appIdAwaitables);
let i;
for (i = 0; i < listOfAppNames.length; i++) {
if (running[i]) {
const appName = listOfAppNames[i];
if (appName != null) {
return appName;
}
}
}
for (i = 0; i < listOfAppNames.length; i++) {
if (appIds[i]) {
const appName = listOfAppNames[i];
if (appName != null) {
return appName;
}
}
}
return null;
}
async function chooseEditorAppAsync(preferredEditor) {
if (preferredEditor) {
// Make sure this editor exists
const appId = await safeIdOfAppAsync(preferredEditor);
if (appId) {
return preferredEditor;
}
else {
console.warn(`Your preferred editor (${preferredEditor}) isn't installed on this computer.`);
}
}
const editorsToTry = [
'Visual Studio Code',
'Atom',
'Sublime Text',
'TextMate',
'TextWrangler',
'Visual Studio Code',
'Brackets',
'SubEthaEdit',
'BBEdit',
'Textastic',
'UltraEdit',
'MacVim',
'CodeRunner 2',
'CodeRunner',
'TextEdit',
];
return await chooseAppAsync(editorsToTry);
}
async function chooseTerminalAppAsync() {
return await chooseAppAsync([
'iTerm 3',
'iTerm 2',
'iTerm',
'HyperTerm',
// 'Cathode',
// 'Terminator',
// 'MacTerm',
'Terminal',
]);
}
async function openInEditorAsync(pth, preferredEditor) {
const appName = await chooseEditorAppAsync(preferredEditor);
if (!appName) {
throw new Error('No editor found.');
}
console.log('Will open in ' + appName + ' -- ' + pth);
return await openInAppAsync(appName, pth);
}
async function openItermToSpecificFolderAsync(dir) {
const shellCommand = escapeString(`cd ${shellQuote(dir)} && clear`);
return await osascriptSpawnAsync([
'tell application "iTerm"',
'make new terminal',
'tell the first terminal',
'activate current session',
'launch session "Default Session"',
'tell the last session',
`write text "${shellCommand}"`,
'end tell',
'end tell',
'end tell',
]);
}
async function openTerminalToSpecificFolderAsync(dir, inTab = false) {
const shellCommand = escapeString(`cd ${shellQuote(dir)} && clear`);
if (inTab) {
return await osascriptSpawnAsync([
'tell application "terminal"',
'tell application "System Events" to tell process "terminal" to keystroke "t" using command down',
`do script with command "${shellCommand}" in selected tab of the front window`,
'end tell',
]);
}
else {
return await osascriptSpawnAsync([
'tell application "terminal"',
`do script "${shellCommand}"`,
'end tell',
'tell application "terminal" to activate',
]);
}
}
async function openFolderInTerminalAppAsync(dir, inTab = false) {
const program = await chooseTerminalAppAsync();
switch (program) {
case 'iTerm':
return await openItermToSpecificFolderAsync(dir);
case 'Terminal':
default:
return await openTerminalToSpecificFolderAsync(dir, inTab);
}
}
/** @deprecated */
async function osascriptExecAsync(script, opts) {
return (await osascriptSpawnAsync(script, opts)).stdout.trim();
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAiNE,wCAAc;AACd,oDAAoB;AACpB,wDAAsB;AACtB,oCAAY;AACU,uCAAS;AAC/B,8CAAiB;AACjB,0DAAuB;AACvB,oEAA4B;AAC5B,wCAAc;AACd,8CAAiB;AACjB,wEAA8B;AAC9B,8EAAiC;AACjC,4CAAgB;AACO,yCAAU;AA7NnC,oEAA2C;AAC3C,gDAAwB;AAExB,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK;SACT,OAAO,CAAC,KAAK,EAAE,MAAM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;IAE/C,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO;YACV,OAAO,MAAM,8BAA8B,CAAC,GAAG,CAAC,CAAC;QAEnD,KAAK,UAAU,CAAC;QAChB;YACE,OAAO,MAAM,iCAAiC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC;AAED,kBAAkB;AAClB,KAAK,UAAU,kBAAkB,CAAC,MAAyB,EAAE,IAAmB;IAC9E,OAAO,CAAC,MAAM,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;AACjE,CAAC"}

View File

@@ -0,0 +1,48 @@
{
"name": "@expo/osascript",
"version": "2.6.0",
"description": "Tools for running an osascripts in Node",
"license": "MIT",
"keywords": [
"osascript",
"mac",
"osx",
"spawn",
"exec"
],
"homepage": "https://github.com/expo/expo/tree/main/packages/@expo/osascript#readme",
"repository": {
"type": "git",
"url": "https://github.com/expo/expo.git",
"directory": "packages/@expo/osascript"
},
"bugs": {
"url": "https://github.com/expo/expo/issues"
},
"main": "build/index.js",
"files": [
"build"
],
"engines": {
"node": ">=12"
},
"dependencies": {
"@expo/spawn-async": "^1.8.0"
},
"devDependencies": {
"@types/node": "^22.14.0",
"expo-module-scripts": "56.0.2"
},
"publishConfig": {
"access": "public"
},
"gitHead": "c4c9867a0bcbb188e55ecaec4998e38d33108a5d",
"scripts": {
"build": "expo-module tsc",
"clean": "expo-module clean",
"lint": "expo-module lint",
"typecheck": "expo-module typecheck",
"test": "expo-module test",
"watch": "pnpm run build --watch --preserveWatchOutput"
}
}