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,2 @@
node_modules/
npm-debug.log

View File

@@ -0,0 +1,66 @@
## _readline_
> Read a file line by line.
## Install
## Important. In node 10 there is a core module named readline. Please use linebyline instead, it is the same module just renamed:
[Npm linebyline](https://www.npmjs.com/package/linebyline)
```sh
npm install linebyline
```
## Test
```sh
npm install .
npm test
```
## What's this?
Simple streaming readline module for NodeJS. Reads a file and buffers new lines emitting a _line_ event for each line.
## Usage
### Simple
```js
var readline = require('linebyline'),
rl = readline('./somefile.txt');
rl.on('line', function(line, lineCount, byteCount) {
// do something with the line of text
})
.on('error', function(e) {
// something went wrong
});
```
### ASCII file decoding
As the underlying `fs.createReadStream` doesn't care about the specific ASCII encoding of the file, an alternative way to decode the file is by telling the `readline` library to retain buffer and then decoding it using a converter (e.g. [`iconv-lite`](https://www.npmjs.com/package/iconv-lite)).
```js
var readline = require('linebyline'),
rl = readline('./file-in-win1251.txt', {
retainBuffer: true //tell readline to retain buffer
});
rl.on("line", function (data,linecount){
var line = iconv.decode(data, 'win1251');
// do something with the line of converted text
});
```
##API
## readLine(readingObject[, options])
### Params:
* `readingObject` - file path or stream object
* `options` can include:
* `maxLineLength` - override the default 4K buffer size (lines longer than this will not be read)
* `retainBuffer` - avoid converting to String prior to emitting 'line' event; will pass raw buffer with encoded data to the callback
### Return:
* **EventEmitter**
## License
BSD © [Craig Brookes](http://craigbrookes.com/)

View File

@@ -0,0 +1,22 @@
{
"name": "readline",
"version": "1.3.0",
"description": "Simple streaming readline module.",
"main": "readline.js",
"scripts": {
"test": "tap --tap --stderr --timeout=120 test/*.js"
},
"dependencies":{},
"devDependencies":{
"tap":"0.4.3",
"iconv-lite":"0.4.13"
},
"repository": "git@github.com:maleck13/readline.git",
"keywords": [
"readline",
"line by line",
"file"
],
"author": "craig brookes",
"license": "BSD"
}

View File

@@ -0,0 +1,60 @@
var fs = require('fs'),
EventEmitter = require('events').EventEmitter,
util = require('util');
var readLine = module.exports = function(file, opts) {
if (!(this instanceof readLine)) return new readLine(file, opts);
EventEmitter.call(this);
opts = opts || {};
opts.maxLineLength = opts.maxLineLength || 4096; // 4K
opts.retainBuffer = !!opts.retainBuffer; //do not convert to String prior to invoking emit 'line' event
var self = this,
lineBuffer = new Buffer(opts.maxLineLength),
lineLength = 0,
lineCount = 0,
byteCount = 0,
emit = function(lineCount, byteCount) {
try {
var line = lineBuffer.slice(0, lineLength);
self.emit('line', opts.retainBuffer? line : line.toString(), lineCount, byteCount);
} catch (err) {
self.emit('error', err);
} finally {
lineLength = 0; // Empty buffer.
}
};
this.input = ('string' === typeof file) ? fs.createReadStream(file, opts) : file;
this.input.on('open', function(fd) {
self.emit('open', fd);
})
.on('data', function(data) {
for (var i = 0; i < data.length; i++) {
if (data[i] == 10 || data[i] == 13) { // Newline char was found.
if (data[i] == 10) {
lineCount++;
emit(lineCount, byteCount);
}
} else {
lineBuffer[lineLength] = data[i]; // Buffer new line data.
lineLength++;
}
byteCount++;
}
})
.on('error', function(err) {
self.emit('error', err);
})
.on('end', function() {
// Emit last line if anything left over since EOF won't trigger it.
if (lineLength) {
lineCount++;
emit(lineCount, byteCount);
}
self.emit('end');
})
.on('close', function() {
self.emit('close');
});
};
util.inherits(readLine, EventEmitter);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
file n (folder for keeping information) ïàïêà æ
I have a file that I keep all my telephone bills in.
Ó ìåíÿ åñòü ïàïêà, â êîòîðîé ÿ õðàíþ âñå ñ÷åòà çà òåëåôîí.
file n (tool) íàïèëüíèê ì
He used a file to smooth the corner of the wood.
Îí çà÷èñòèë íàïèëüíèêîì êðàé äåðåâà.
file n (computer file) ôàéë ì
Can you send me the file as an attachment in an email?
Ìîæåøü ïîñëàòü ìíå ýòîò ôàéë êàê ïðèëîæåíèå ê ýëåêòðîííîìó ïèñüìó?
I file all my telephone bills together.
ß ïîäøèâàþ âñå ñ÷åòà çà ýëåêòðè÷åñòâî âìåñòå.
file vtr (smooth with a file) øëèôîâàòü, çà÷èùàòü íåñîâ + âèí
He filed the wood.
Îí øëèôîâàë äåðåâî.

View File

@@ -0,0 +1,7 @@
1
2
3
4
5
6
7

View File

@@ -0,0 +1,138 @@
var fs = require('fs');
var readLine = require('../readline.js');
var test = require("tap").test;
test("test reading lines",function(t){
console.error("reading large file line by line asserts may take a while");
var rl = readLine('./fixtures/afile.txt');
rl.on("line", function (line,linecount){
t.ok(null !== line && undefined !== line);
});
rl.on("end",function (){
t.end();
});
});
test("numbers", function (t){
var rl = readLine('./fixtures/nmbr.txt');
var answer = 28;
var i=0;
rl.on("line", function (line){
var num = Number(line);
console.error(num);
i+=num;
});
rl.on("end", function (){
console.error(i,answer);
t.ok(answer === i, "answered");
t.end();
});
});
test("errors", function (t){
var rl = readLine("./Idontexist");
rl.on('error', function (e){
t.ok(e);
t.end();
});
rl.on('end', function (){
t.end();
});
rl.on('close', function(){
t.end();
});
});
test("line count", function(t){
var rl = readLine('./fixtures/nmbr.txt');
var expect = 7;
var actual = 0;
rl.on("line", function (line, ln){
console.log("line",line,ln);
actual=ln;
});
rl.on("end", function (){
t.ok(actual === expect,"line count is correct");
t.end();
});
});
test("byte count after first line", function(t){
var rl = readLine('./fixtures/nmbr.txt');
var actual = 0;
var expect;
rl.on("line", function (line, ln, byteCount){
if (expect === undefined) {
expect = line.length;
console.log("byte count",byteCount);
actual=byteCount;
t.ok(actual === expect,"byte count is correct");
t.end();
}
});
});
test("byte count", function(t){
var rl = readLine('./fixtures/nmbr.txt');
var expect = fs.statSync('./fixtures/nmbr.txt').size;
var actual = 0;
rl.on("line", function (line, ln, byteCount){
console.log("byte count",byteCount);
actual=byteCount;
});
rl.on("end", function (){
t.ok(actual === expect,"byte count is correct");
t.end();
});
});
test("processing error passed on", function(t){
var rl = readLine('./fixtures/nmbr.txt');
var lastError;
var lineCalls = 0;
rl.on("line", function (line, ln, byteCount){
lineCalls++;
if (ln === 7) {
throw new Error('fake error');
}
});
rl.on("error", function (err){
if (!lastError) {
lastError = err;
}
});
rl.on("end", function (){
t.ok(lastError.message === 'fake error','error is passed on');
t.ok(lineCalls === 7, 'line count ok');
t.end();
});
});
test("test ascii file reading",function(t){
var iconv = require('iconv-lite');
var testFileValidationKeywords = {
1: 'папка',
3: 'телефон',
11: 'электричество',
14: 'дерево'
};
var rl = readLine('./fixtures/file-in-win1251.txt', {
retainBuffer: true
});
rl.on("line", function (data,linecount){
var line = iconv.decode(data, 'win1251');
t.ok(!testFileValidationKeywords[linecount] || line.indexOf(testFileValidationKeywords[linecount]) > -1);
});
rl.on("end",function (){
t.end();
});
});