diff --git a/app/mobile/.buckconfig b/app/mobile/.buckconfig new file mode 100644 index 00000000..934256cb --- /dev/null +++ b/app/mobile/.buckconfig @@ -0,0 +1,6 @@ + +[android] + target = Google Inc.:Google APIs:23 + +[maven_repositories] + central = https://repo1.maven.org/maven2 diff --git a/app/mobile/.editorconfig b/app/mobile/.editorconfig new file mode 100644 index 00000000..7c286132 --- /dev/null +++ b/app/mobile/.editorconfig @@ -0,0 +1,3 @@ +# Windows files +[*.bat] +end_of_line = crlf diff --git a/app/mobile/.eslintrc.js b/app/mobile/.eslintrc.js new file mode 100644 index 00000000..40c6dcd0 --- /dev/null +++ b/app/mobile/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: '@react-native-community', +}; diff --git a/app/mobile/.flowconfig b/app/mobile/.flowconfig new file mode 100644 index 00000000..4320b707 --- /dev/null +++ b/app/mobile/.flowconfig @@ -0,0 +1,65 @@ +[ignore] +; We fork some components by platform +.*/*[.]android.js + +; Ignore "BUCK" generated dirs +/\.buckd/ + +; Ignore polyfills +node_modules/react-native/Libraries/polyfills/.* + +; Flow doesn't support platforms +.*/Libraries/Utilities/LoadingView.js + +[untyped] +.*/node_modules/@react-native-community/cli/.*/.* + +[include] + +[libs] +node_modules/react-native/interface.js +node_modules/react-native/flow/ + +[options] +emoji=true + +exact_by_default=true + +format.bracket_spacing=false + +module.file_ext=.js +module.file_ext=.json +module.file_ext=.ios.js + +munge_underscores=true + +module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' +module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' + +suppress_type=$FlowIssue +suppress_type=$FlowFixMe +suppress_type=$FlowFixMeProps +suppress_type=$FlowFixMeState + +[lints] +sketchy-null-number=warn +sketchy-null-mixed=warn +sketchy-number=warn +untyped-type-import=warn +nonstrict-import=warn +deprecated-type=warn +unsafe-getters-setters=warn +unnecessary-invariant=warn +signature-verification-failure=warn + +[strict] +deprecated-type +nonstrict-import +sketchy-null +unclear-type +unsafe-getters-setters +untyped-import +untyped-type-import + +[version] +^0.158.0 diff --git a/app/mobile/.gitattributes b/app/mobile/.gitattributes new file mode 100644 index 00000000..45a3dcb2 --- /dev/null +++ b/app/mobile/.gitattributes @@ -0,0 +1,3 @@ +# Windows files should use crlf line endings +# https://help.github.com/articles/dealing-with-line-endings/ +*.bat text eol=crlf diff --git a/app/mobile/.gitignore b/app/mobile/.gitignore new file mode 100644 index 00000000..cc53454e --- /dev/null +++ b/app/mobile/.gitignore @@ -0,0 +1,60 @@ +# OSX +# +.DS_Store + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate + +# Android/IntelliJ +# +build/ +.idea +.gradle +local.properties +*.iml +*.hprof + +# node.js +# +node_modules/ +npm-debug.log +yarn-error.log + +# BUCK +buck-out/ +\.buckd/ +*.keystore +!debug.keystore + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/ + +*/fastlane/report.xml +*/fastlane/Preview.html +*/fastlane/screenshots + +# Bundle artifact +*.jsbundle + +# CocoaPods +/ios/Pods/ diff --git a/app/mobile/.prettierrc.js b/app/mobile/.prettierrc.js new file mode 100644 index 00000000..84196d95 --- /dev/null +++ b/app/mobile/.prettierrc.js @@ -0,0 +1,7 @@ +module.exports = { + bracketSpacing: false, + jsxBracketSameLine: true, + singleQuote: true, + trailingComma: 'all', + arrowParens: 'avoid', +}; diff --git a/app/mobile/.watchmanconfig b/app/mobile/.watchmanconfig new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/app/mobile/.watchmanconfig @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/app/mobile/App.js b/app/mobile/App.js new file mode 100644 index 00000000..edda80df --- /dev/null +++ b/app/mobile/App.js @@ -0,0 +1,51 @@ +/** + * Sample React Native App + * https://github.com/facebook/react-native + * + * @format + * @flow strict-local + */ + +import React from 'react'; +import type {Node} from 'react'; +import { + SafeAreaView, + ScrollView, + StatusBar, + StyleSheet, + Text, + useColorScheme, + View, + Button, +} from 'react-native'; + +const App: () => Node = () => { + + const test = () => { + console.log("PRESSED: 7000"); + var ws = new WebSocket('ws://192.168.13.233:7000/status'); + ws.onerror = (e) => { + console.log("error: ", e); + } + ws.onmessage = (e) => { + console.log("message: ", e); + } + ws.onclose = (e) => { + console.log("close: ", e); + } + ws.onopen = (e) => { + console.log("connected"); + ws.send('something'); + } + } + + return ( + + +