This folder contains most of the Typescript and Javascript code needed for the Berty Messenger mobile apps. The code is organized into packages in ./js/packages
. Only some of them are freestanding.
Please, read the main README.md
file first.
directory | description |
---|---|
api/ | Interfaces with the Berty golang services |
messenger-app/ | Berty Messenger react root |
berty-i18n/ | Locale support files |
components | React Native components |
go-bridge/ | Berty daemon native module |
grpc-bridge/ | Collection of grpc utilities used to interface with the daemon |
navigation/ | Berty Messenger + react-native-navigation |
store/ | App state control using React hooks and Context |
styles/ | Generates StyleSheet utilities and styles that conform to our design specs |
web-dev-app/ | A minimal React web app that allows us to easily test our store functionality (currently not supported) |
$ cd ./js
$ make help
💡 First, verify you have the relevant Requirements 😉
## Optional if not modifying any .proto file
## Generate files using protobuf
$ make generate
## Build and serve UI
$ make metro.start
## Optional if using only one device
## Run this with different ports to test with multiple devices
$ BERTY_DAEMON_PORT=1337 make daemon.start
$ BERTY_DAEMON_PORT=1338 make daemon.start
## iOS
## Run iOS app in debug mode
$ make ios.debug
## Optional if using only one device
## Run this with different iOS device names
$ IOS_DEVICE=__IOS_DEVICE_NAME_1__ make ios.debug
$ IOS_DEVICE=__IOS_DEVICE_NAME_2__ make ios.debug
💡 You can check available virtual iOS devices with `xcrun simctl list`
## Android
## Run Android app in debug mode
$ make android.debug
## Optional if using only one device
## Run this with different Android device IDs
$ ANDROID_DEVICE=__ANDROID_DEVICE_ID_1__ make android.debug
$ ANDROID_DEVICE=__ANDROID_DEVICE_ID_2__ make android.debug
💡 You can check available Android Virtual Devices with `adb devices`
🚧 This debugging tool is primarily used internally and not actively maintained except by developers for their own usage.
TODO: This is currently not working, we need to port the transpiler config and catch up
yarn
npx
cd packages/web-dev-app && yarn && yarn start
BERTY_DAEMON_PORT=1337 make daemon.start
BERTY_DAEMON_PORT=1338 make daemon.start
yarn start
should have opened a browser tab already but if that's not the case, navigate to localhost:3000
In the app's ui, you have to choose a daemon port when you create your account, if you started the services using the commands above, you will have a service on port 1337
and one on port 1338
You can use one normal tab and one private tab to have two accounts at the same time
- The General React Native requirements
- iOS dev reqs and/or Android dev reqs
- Watchman to enable live reloading
- Docker Desktop
- The gomobile package:
go get golang.org/x/mobile/cmd/gomobile/... && gomobile init
💡 $GOPATH
may need to be set explicitly (usually $HOME/go
)
- Homebrew or package manager of choice
- Node >= 12.x
- The yarn package manager
- Mac OS X
- XCode (latest stable)
- An Android app development environment, e.g. Android Studio
- Android SDK, with the following enabled (in Android Studio Code in
Tools --> SDK Manager
):- Android SDK Build-Tools
- LLDB
- NDK
- Cmake
- Android SDK Command-line Tools
- A physical or virtual Android device (in Android Studio,
Tools --> AVD Manager
) - Java 8. If you already have another version of Java, you can use a version manager and Homebrew to add another installation. Some nice instructions are given here.
💡 Check you can run all the commands sdkmanager
, emulator
, ndk-bundle
, and adb
(these are binaries in $ANDROID_HOME
subfolders)