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,86 @@
#include "AnimatedSensorModule.h"
#include <utility>
namespace reanimated {
AnimatedSensorModule::AnimatedSensorModule(
const PlatformDepMethodsHolder &platformDepMethodsHolder)
: platformRegisterSensorFunction_(platformDepMethodsHolder.registerSensor),
platformUnregisterSensorFunction_(
platformDepMethodsHolder.unregisterSensor) {}
AnimatedSensorModule::~AnimatedSensorModule() {
assert(sensorsIds_.empty());
}
jsi::Value AnimatedSensorModule::registerSensor(
jsi::Runtime &rt,
const std::shared_ptr<WorkletRuntime> &uiWorkletRuntime,
const jsi::Value &sensorTypeValue,
const jsi::Value &interval,
const jsi::Value &iosReferenceFrame,
const jsi::Value &sensorDataHandler) {
SensorType sensorType = static_cast<SensorType>(sensorTypeValue.asNumber());
auto shareableHandler = extractShareableOrThrow<ShareableWorklet>(
rt,
sensorDataHandler,
"[Reanimated] Sensor event handler must be a worklet.");
int sensorId = platformRegisterSensorFunction_(
sensorType,
interval.asNumber(),
iosReferenceFrame.asNumber(),
[sensorType,
shareableHandler,
weakUiWorkletRuntime = std::weak_ptr<WorkletRuntime>(uiWorkletRuntime)](
double newValues[], int orientationDegrees) {
auto uiWorkletRuntime = weakUiWorkletRuntime.lock();
if (uiWorkletRuntime == nullptr) {
return;
}
jsi::Runtime &uiRuntime = uiWorkletRuntime->getJSIRuntime();
jsi::Object value(uiRuntime);
if (sensorType == SensorType::ROTATION_VECTOR) {
// TODO: timestamp should be provided by the platform implementation
// such that the native side has a chance of providing a true event
// timestamp
value.setProperty(uiRuntime, "qx", newValues[0]);
value.setProperty(uiRuntime, "qy", newValues[1]);
value.setProperty(uiRuntime, "qz", newValues[2]);
value.setProperty(uiRuntime, "qw", newValues[3]);
value.setProperty(uiRuntime, "yaw", newValues[4]);
value.setProperty(uiRuntime, "pitch", newValues[5]);
value.setProperty(uiRuntime, "roll", newValues[6]);
} else {
value.setProperty(uiRuntime, "x", newValues[0]);
value.setProperty(uiRuntime, "y", newValues[1]);
value.setProperty(uiRuntime, "z", newValues[2]);
}
value.setProperty(
uiRuntime, "interfaceOrientation", orientationDegrees);
uiWorkletRuntime->runGuarded(shareableHandler, value);
});
if (sensorId != -1) {
sensorsIds_.insert(sensorId);
}
return jsi::Value(sensorId);
}
void AnimatedSensorModule::unregisterSensor(const jsi::Value &sensorId) {
// It is called during sensor hook unmounting
sensorsIds_.erase(sensorId.getNumber());
platformUnregisterSensorFunction_(sensorId.asNumber());
}
void AnimatedSensorModule::unregisterAllSensors() {
for (auto sensorId : sensorsIds_) {
platformUnregisterSensorFunction_(sensorId);
}
sensorsIds_.clear();
}
} // namespace reanimated

View File

@@ -0,0 +1,44 @@
#pragma once
#include <jsi/jsi.h>
#include <memory>
#include <unordered_set>
#include "PlatformDepMethodsHolder.h"
#include "Shareables.h"
#include "WorkletRuntime.h"
namespace reanimated {
using namespace facebook;
enum SensorType {
ACCELEROMETER = 1,
GYROSCOPE = 2,
GRAVITY = 3,
MAGNETIC_FIELD = 4,
ROTATION_VECTOR = 5,
};
class AnimatedSensorModule {
std::unordered_set<int> sensorsIds_;
RegisterSensorFunction platformRegisterSensorFunction_;
UnregisterSensorFunction platformUnregisterSensorFunction_;
public:
AnimatedSensorModule(
const PlatformDepMethodsHolder &platformDepMethodsHolder);
~AnimatedSensorModule();
jsi::Value registerSensor(
jsi::Runtime &rt,
const std::shared_ptr<WorkletRuntime> &uiWorkletRuntime,
const jsi::Value &sensorType,
const jsi::Value &interval,
const jsi::Value &iosReferenceFrame,
const jsi::Value &sensorDataContainer);
void unregisterSensor(const jsi::Value &sensorId);
void unregisterAllSensors();
};
} // namespace reanimated