Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 67f1fc1

Browse files
authored
feat: Expo mobile app — full integration by MaTriXy (ruvnet#83)
feat: full app integration — all screens wired and working
2 parents 4e925db + df39401 commit 67f1fc1

126 files changed

Lines changed: 22403 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

mobile/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
EXPO_PUBLIC_DEFAULT_SERVER_URL=http://192.168.1.100:8080

mobile/.eslintrc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
parserOptions: {
5+
ecmaVersion: 'latest',
6+
sourceType: 'module',
7+
ecmaFeatures: {
8+
jsx: true,
9+
},
10+
},
11+
plugins: ['@typescript-eslint', 'react', 'react-hooks'],
12+
extends: [
13+
'eslint:recommended',
14+
'plugin:react/recommended',
15+
'plugin:react-hooks/recommended',
16+
'plugin:@typescript-eslint/recommended',
17+
],
18+
settings: {
19+
react: {
20+
version: 'detect',
21+
},
22+
},
23+
rules: {
24+
'react/react-in-jsx-scope': 'off',
25+
},
26+
};

mobile/.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2+
3+
# dependencies
4+
node_modules/
5+
6+
# Expo
7+
.expo/
8+
dist/
9+
web-build/
10+
expo-env.d.ts
11+
12+
# Native
13+
.kotlin/
14+
*.orig.*
15+
*.jks
16+
*.p8
17+
*.p12
18+
*.key
19+
*.mobileprovision
20+
21+
# Metro
22+
.metro-health-check*
23+
24+
# debug
25+
npm-debug.*
26+
yarn-debug.*
27+
yarn-error.*
28+
29+
# macOS
30+
.DS_Store
31+
*.pem
32+
33+
# local env files
34+
.env*.local
35+
36+
# typescript
37+
*.tsbuildinfo
38+
39+
# generated native folders
40+
/ios
41+
/android

mobile/.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

mobile/App.tsx

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import { useEffect } from 'react';
2+
import { NavigationContainer, DarkTheme } from '@react-navigation/native';
3+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
4+
import { StatusBar } from 'expo-status-bar';
5+
import { SafeAreaProvider } from 'react-native-safe-area-context';
6+
import { apiService } from '@/services/api.service';
7+
import { rssiService } from '@/services/rssi.service';
8+
import { wsService } from '@/services/ws.service';
9+
import { ThemeProvider } from './src/theme/ThemeContext';
10+
import { usePoseStore } from './src/stores/poseStore';
11+
import { useSettingsStore } from './src/stores/settingsStore';
12+
import { RootNavigator } from './src/navigation/RootNavigator';
13+
14+
export default function App() {
15+
const serverUrl = useSettingsStore((state) => state.serverUrl);
16+
const rssiScanEnabled = useSettingsStore((state) => state.rssiScanEnabled);
17+
18+
useEffect(() => {
19+
apiService.setBaseUrl(serverUrl);
20+
const unsubscribe = wsService.subscribe(usePoseStore.getState().handleFrame);
21+
wsService.connect(serverUrl);
22+
23+
return () => {
24+
unsubscribe();
25+
wsService.disconnect();
26+
};
27+
}, [serverUrl]);
28+
29+
useEffect(() => {
30+
if (!rssiScanEnabled) {
31+
rssiService.stopScanning();
32+
return;
33+
}
34+
35+
const unsubscribe = rssiService.subscribe(() => {
36+
// Consumers can subscribe elsewhere for RSSI events.
37+
});
38+
rssiService.startScanning(2000);
39+
40+
return () => {
41+
unsubscribe();
42+
rssiService.stopScanning();
43+
};
44+
}, [rssiScanEnabled]);
45+
46+
useEffect(() => {
47+
(globalThis as { __appStartTime?: number }).__appStartTime = Date.now();
48+
}, []);
49+
50+
const navigationTheme = {
51+
...DarkTheme,
52+
colors: {
53+
...DarkTheme.colors,
54+
background: '#0A0E1A',
55+
card: '#0D1117',
56+
text: '#E2E8F0',
57+
border: '#1E293B',
58+
primary: '#32B8C6',
59+
},
60+
};
61+
62+
return (
63+
<GestureHandlerRootView style={{ flex: 1 }}>
64+
<SafeAreaProvider>
65+
<ThemeProvider>
66+
<NavigationContainer theme={navigationTheme}>
67+
<RootNavigator />
68+
</NavigationContainer>
69+
</ThemeProvider>
70+
</SafeAreaProvider>
71+
<StatusBar style="light" />
72+
</GestureHandlerRootView>
73+
);
74+
}

mobile/app.config.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export default {
2+
name: 'WiFi-DensePose',
3+
slug: 'wifi-densepose',
4+
version: '1.0.0',
5+
ios: {
6+
bundleIdentifier: 'com.ruvnet.wifidensepose',
7+
},
8+
android: {
9+
package: 'com.ruvnet.wifidensepose',
10+
},
11+
// Use expo-env and app-level defaults from the project configuration when available.
12+
};

mobile/app.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"expo": {
3+
"name": "mobile",
4+
"slug": "mobile",
5+
"version": "1.0.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/icon.png",
8+
"userInterfaceStyle": "light",
9+
"splash": {
10+
"image": "./assets/splash-icon.png",
11+
"resizeMode": "contain",
12+
"backgroundColor": "#ffffff"
13+
},
14+
"ios": {
15+
"supportsTablet": true
16+
},
17+
"android": {
18+
"adaptiveIcon": {
19+
"backgroundColor": "#E6F4FE",
20+
"foregroundImage": "./assets/android-icon-foreground.png",
21+
"backgroundImage": "./assets/android-icon-background.png",
22+
"monochromeImage": "./assets/android-icon-monochrome.png"
23+
},
24+
"predictiveBackGestureEnabled": false
25+
},
26+
"web": {
27+
"favicon": "./assets/favicon.png"
28+
}
29+
}
30+
}
17.1 KB
Loading
76.9 KB
Loading
4.04 KB
Loading

0 commit comments

Comments
 (0)