- 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
54 lines
1.5 KiB
JavaScript
Executable File
54 lines
1.5 KiB
JavaScript
Executable File
var cc = require('./lib/utils')
|
|
var join = require('path').join
|
|
var deepExtend = require('deep-extend')
|
|
var etc = '/etc'
|
|
var win = process.platform === "win32"
|
|
var home = win
|
|
? process.env.USERPROFILE
|
|
: process.env.HOME
|
|
|
|
module.exports = function (name, defaults, argv, parse) {
|
|
if('string' !== typeof name)
|
|
throw new Error('rc(name): name *must* be string')
|
|
if(!argv)
|
|
argv = require('minimist')(process.argv.slice(2))
|
|
defaults = (
|
|
'string' === typeof defaults
|
|
? cc.json(defaults) : defaults
|
|
) || {}
|
|
|
|
parse = parse || cc.parse
|
|
|
|
var env = cc.env(name + '_')
|
|
|
|
var configs = [defaults]
|
|
var configFiles = []
|
|
function addConfigFile (file) {
|
|
if (configFiles.indexOf(file) >= 0) return
|
|
var fileConfig = cc.file(file)
|
|
if (fileConfig) {
|
|
configs.push(parse(fileConfig))
|
|
configFiles.push(file)
|
|
}
|
|
}
|
|
|
|
// which files do we look at?
|
|
if (!win)
|
|
[join(etc, name, 'config'),
|
|
join(etc, name + 'rc')].forEach(addConfigFile)
|
|
if (home)
|
|
[join(home, '.config', name, 'config'),
|
|
join(home, '.config', name),
|
|
join(home, '.' + name, 'config'),
|
|
join(home, '.' + name + 'rc')].forEach(addConfigFile)
|
|
addConfigFile(cc.find('.'+name+'rc'))
|
|
if (env.config) addConfigFile(env.config)
|
|
if (argv.config) addConfigFile(argv.config)
|
|
|
|
return deepExtend.apply(null, configs.concat([
|
|
env,
|
|
argv,
|
|
configFiles.length ? {configs: configFiles, config: configFiles[configFiles.length - 1]} : undefined,
|
|
]))
|
|
}
|