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,83 @@
export interface Editor {
id: string;
name: string;
binary: string;
isTerminalEditor: boolean;
paths: string[];
keywords: string[];
}
/**
Get info about the default editor.
The user is expected to have the `$EDITOR` environment variable set, and if not, a user-friendly error is thrown.
@returns Metadata on the default editor.
@example
```
import {defaultEditor} from 'env-editor';
defaultEditor();
// {
// id: 'atom',
// name: 'Atom',
// binary: 'atom',
// isTerminalEditor: false,
// paths: [
// '/Applications/Atom.app/Contents/Resources/app/atom.sh'
// ],
// keywords: []
// }
```
*/
export function defaultEditor(): Editor;
/**
Get info about a specific editor.
@param editor - This can be pretty flexible. It matches against all the data it has. For example, to get Sublime Text, you could write either of the following: `sublime`, `Sublime Text`, `subl`.
@returns Metadata on the specified editor.
@example
```
import {getEditor} from 'env-editor';
getEditor('sublime');
// {
// id: 'sublime',
// name: 'Sublime Text',
// binary: 'subl',
// isTerminalEditor: false,
// paths: [
// '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
// '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl'
// ],
// keywords: []
// }
```
*/
export function getEditor(editor: string): Editor;
/**
@returns Metadata on all the editors.
@example
```
import {allEditors} from 'env-editor';
allEditors();
// [
// {
// id: 'atom',
// …
// },
// {
// id: 'sublime,
// …
// },
// …
// ]
```
*/
export function allEditors(): Editor[];

View File

@@ -0,0 +1,188 @@
'use strict';
const path = require('path');
const allEditors = () => [
{
id: 'sublime',
name: 'Sublime Text',
binary: 'subl',
isTerminalEditor: false,
paths: [
'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
'/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl'
],
keywords: []
},
{
id: 'atom',
name: 'Atom',
binary: 'atom',
isTerminalEditor: false,
paths: [
'/Applications/Atom.app/Contents/Resources/app/atom.sh'
],
keywords: []
},
{
id: 'vscode',
name: 'Visual Studio Code',
binary: 'code',
isTerminalEditor: false,
paths: [
'/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code'
],
keywords: [
'vs code'
]
},
{
id: 'webstorm',
name: 'WebStorm',
binary: 'webstorm',
isTerminalEditor: false,
paths: [],
keywords: [
'wstorm'
]
},
{
id: 'textmate',
name: 'TextMate',
binary: 'mate',
isTerminalEditor: false,
paths: [],
keywords: []
},
{
id: 'vim',
name: 'Vim',
binary: 'vim',
isTerminalEditor: true,
paths: [],
keywords: []
},
{
id: 'neovim',
name: 'NeoVim',
binary: 'nvim',
isTerminalEditor: true,
paths: [],
keywords: [
'vim'
]
},
{
id: 'intellij',
name: 'IntelliJ IDEA',
binary: 'idea',
isTerminalEditor: false,
paths: [],
keywords: [
'idea',
'java',
'jetbrains',
'ide'
]
},
{
id: 'nano',
name: 'GNU nano',
binary: 'nano',
isTerminalEditor: true,
paths: [],
keywords: []
},
{
id: 'emacs',
name: 'GNU Emacs',
binary: 'emacs',
isTerminalEditor: true,
paths: [],
keywords: []
},
{
id: 'emacsforosx',
name: 'GNU Emacs for Mac OS X',
binary: 'Emacs',
isTerminalEditor: false,
paths: [
'/Applications/Emacs.app/Contents/MacOS/Emacs'
],
keywords: []
},
{
id: 'android-studio',
name: 'Android Studio',
binary: 'studio',
isTerminalEditor: false,
paths: [
'/Applications/Android Studio.app/Contents/MacOS/studio',
'/usr/local/Android/android-studio/bin/studio.sh',
'C:\\Program Files (x86)\\Android\\android-studio\\bin\\studio.exe',
'C:\\Program Files\\Android\\android-studio\\bin\\studio64.exe'
],
keywords: [
'studio'
]
}
];
const getEditor = editor => {
editor = editor.trim();
const needle = editor.toLowerCase();
const id = needle.split(/[/\\]/).pop().replace(/\s/g, '-');
const binary = id.split('-')[0];
for (const editor of allEditors()) {
// TODO: Maybe use `leven` module for more flexible matching
if (
needle === editor.id ||
needle === editor.name.toLowerCase() ||
binary === editor.binary
) {
return editor;
}
for (const editorPath of editor.paths) {
if (path.normalize(needle) === path.normalize(editorPath.toLowerCase())) {
return editor;
}
}
for (const keyword of editor.keywords) {
if (needle === keyword) {
return editor;
}
}
}
return {
id,
name: editor,
binary,
isTerminalEditor: false,
paths: [],
keywords: []
};
};
module.exports.defaultEditor = () => {
const editor = process.env.EDITOR || process.env.VISUAL;
if (!editor) {
throw new Error(
// eslint-disable-next-line indent
`
Your $EDITOR environment variable is not set.
Set it to the command/path of your editor in ~/.zshenv or ~/.bashrc:
export EDITOR=atom
`
);
}
return getEditor(editor);
};
module.exports.getEditor = getEditor;
module.exports.allEditors = allEditors;

View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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,53 @@
{
"name": "env-editor",
"version": "0.4.2",
"description": "Get metadata on the default editor or a specific editor",
"license": "MIT",
"repository": "sindresorhus/env-editor",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"env",
"editor",
"environment",
"variable",
"default",
"editors",
"main",
"user",
"meta",
"metadata",
"info",
"name",
"binary",
"path",
"sublime",
"atom",
"vscode",
"webstorm",
"textmate",
"vim",
"neovim",
"intellij",
"nano",
"emacs"
],
"devDependencies": {
"ava": "^2.4.0",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

View File

@@ -0,0 +1,103 @@
# env-editor
> Get metadata on the default editor or a specific editor
This module is used by [`open-editor`](https://github.com/sindresorhus/open-editor).
## Supported editors
- Sublime Text
- Atom
- Visual Studio Code
- WebStorm
- TextMate
- Vim
- NeoVim
- IntelliJ
- GNU nano
- GNU Emacs
- Android Studio
## Install
```
$ npm install env-editor
```
## Usage
```js
const {defaultEditor, getEditor, allEditors} = require('env-editor');
defaultEditor();
/*
{
id: 'atom',
name: 'Atom',
binary: 'atom',
isTerminalEditor: false,
paths: [
'/Applications/Atom.app/Contents/Resources/app/atom.sh'
],
keywords: []
}
*/
getEditor('sublime');
/*
{
id: 'sublime',
name: 'Sublime Text',
binary: 'subl',
isTerminalEditor: false,
paths: [
'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
'/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl'
],
keywords: []
}
*/
allEditors();
/*
[
{
id: 'atom',
},
{
id: 'sublime,
},
]
*/
```
## API
### defaultEditor()
Returns metadata on the default editor.
The user is expected to have the `$EDITOR` environment variable set, and if not, a user-friendly error is thrown.
### getEditor(editor)
Returns metadata on the specified editor.
#### editor
Type: `string`
This can be pretty flexible. It matches against all the data it has.
For example, to get Sublime Text, you could write either of the following: `sublime`, `Sublime Text`, `subl`.
### allEditors()
Returns an array with metadata on all the editors.