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,20 @@
import fs from 'fs/promises';
import path from 'path';
export async function resolveFontPaths(fonts: string[], projectRoot: string) {
const promises = fonts.map(async (p) => {
const resolvedPath = path.resolve(projectRoot, p);
const stat = await fs.stat(resolvedPath);
if (stat.isDirectory()) {
const dir = await fs.readdir(resolvedPath);
return dir.map((file) => path.join(resolvedPath, file));
}
return [resolvedPath];
});
return (await Promise.all(promises))
.flat()
.filter(
(p) => p.endsWith('.ttf') || p.endsWith('.otf') || p.endsWith('.woff') || p.endsWith('.woff2')
);
}

View File

@@ -0,0 +1,38 @@
import { ConfigPlugin, createRunOncePlugin } from 'expo/config-plugins';
import { withFontsAndroid } from './withFontsAndroid';
import { withFontsIos } from './withFontsIos';
const pkg = require('expo-font/package.json');
export type FontProps = {
fonts?: string[];
android?: {
fonts?: string[];
};
ios?: {
fonts?: string[];
};
};
const withFonts: ConfigPlugin<FontProps> = (config, props) => {
if (!props) {
return config;
}
const iosFonts = [...(props.fonts ?? []), ...(props.ios?.fonts ?? [])];
if (iosFonts.length > 0) {
config = withFontsIos(config, iosFonts);
}
const androidFonts = [...(props.fonts ?? []), ...(props.android?.fonts ?? [])];
if (androidFonts.length > 0) {
config = withFontsAndroid(config, androidFonts);
}
return config;
};
export default createRunOncePlugin(withFonts, pkg.name, pkg.version);

View File

@@ -0,0 +1,28 @@
import { ConfigPlugin, withDangerousMod } from 'expo/config-plugins';
import fs from 'fs/promises';
import path from 'path';
import { resolveFontPaths } from './utils';
export const withFontsAndroid: ConfigPlugin<string[]> = (config, fonts) => {
return withDangerousMod(config, [
'android',
async (config) => {
const resolvedFonts = await resolveFontPaths(fonts, config.modRequest.projectRoot);
await Promise.all(
resolvedFonts.map(async (asset) => {
const fontsDir = path.join(
config.modRequest.platformProjectRoot,
'app/src/main/assets/fonts'
);
await fs.mkdir(fontsDir, { recursive: true });
const output = path.join(fontsDir, path.basename(asset));
if (output.endsWith('.ttf') || output.endsWith('.otf')) {
await fs.copyFile(asset, output);
}
})
);
return config;
},
]);
};

View File

@@ -0,0 +1,63 @@
import { ExpoConfig } from '@expo/config-types';
import {
ConfigPlugin,
IOSConfig,
InfoPlist,
XcodeProject,
withInfoPlist,
withXcodeProject,
} from 'expo/config-plugins';
import path from 'path';
import { resolveFontPaths } from './utils';
export const withFontsIos: ConfigPlugin<string[]> = (config, fonts) => {
config = addFontsToTarget(config, fonts);
config = addFontsToPlist(config, fonts);
return config;
};
function addFontsToTarget(config: ExpoConfig, fonts: string[]) {
return withXcodeProject(config, async (config) => {
const resolvedFonts = await resolveFontPaths(fonts, config.modRequest.projectRoot);
const project = config.modResults;
const platformProjectRoot = config.modRequest.platformProjectRoot;
IOSConfig.XcodeUtils.ensureGroupRecursively(project, 'Resources');
addResourceFile(project, platformProjectRoot, resolvedFonts);
return config;
});
}
function addFontsToPlist(config: ExpoConfig, fonts: string[]) {
return withInfoPlist(config, async (config) => {
const resolvedFonts = await resolveFontPaths(fonts, config.modRequest.projectRoot);
const existingFonts = getUIAppFonts(config.modResults);
const fontList = resolvedFonts.map((font) => path.basename(font)) ?? [];
const allFonts = [...existingFonts, ...fontList];
config.modResults.UIAppFonts = Array.from(new Set(allFonts));
return config;
});
}
function addResourceFile(project: XcodeProject, platformRoot: string, f: string[]) {
for (const font of f) {
const fontPath = path.relative(platformRoot, font);
IOSConfig.XcodeUtils.addResourceFileToGroup({
filepath: fontPath,
groupName: 'Resources',
project,
isBuildFile: true,
verbose: true,
});
}
}
function getUIAppFonts(infoPlist: InfoPlist): string[] {
const fonts = infoPlist['UIAppFonts'];
if (fonts != null && Array.isArray(fonts) && fonts.every((font) => typeof font === 'string')) {
return fonts as string[];
}
return [];
}