diff --git a/README.md b/README.md index 25bcbd33c..5a25068de 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,14 @@ Access the `xmtp-react-native` client SDK [reference documentation](https://xmtp ## Example app -Use the [XMTP React Native example app](example) as a tool to start building an app with XMTP. This basic messaging app has an intentionally unopinionated UI to help make it easier for you to build with. +Use the [XMTP React Native example app](example) as a tool to start building an app with XMTP. This basic messaging app has an intentionally unopinionated UI to help make it easier for you to build with. [See example/README.md](example/README.md) for more instructions. -Follow the [React Native guide](https://reactnative.dev/docs/environment-setup) to set up a CLI environment. +### Quickstart to use the example app: -To use the example app, run: +Follow the [React Native guide](https://reactnative.dev/docs/environment-setup) to set up a CLI environment. ```bash +npm install cd example npm install --force npm run [ios or android] diff --git a/example/README.md b/example/README.md new file mode 100644 index 000000000..c3877854b --- /dev/null +++ b/example/README.md @@ -0,0 +1,37 @@ +# XMTP React Native Example App + +This basic messaging app has an intentionally unopinionated UI to help make it easier for you to build with. + +## Running the Example App +Follow the [React Native guide](https://reactnative.dev/docs/environment-setup) to set up a CLI environment. + +To use the example app, run: + +```bash +npm install +cd example +npm install --force +npm run [ios or android] +``` + +## Running Example App Unit tests on local emulators +Running tests locally is useful when updating GitHub actions, or locally testing between changes. + +1. [Install docker](https://docs.docker.com/get-docker/) + +2. Start a local XMTP server (from example directory) + ```bash + docker-compose -p xmtp -f dev/local/docker-compose.yml up -d + ``` +3. Verify XMTP server is running + ```bash + docker-compose ls + + NAME STATUS CONFIG FILES + xmtp running(3) /xmtp-react-native/example/dev/local/docker-compose.yml + ``` +4. You can now run Unit tests on your local emulators +5. You can stop the local xmtp server with the following command + ```bash + docker-compose -p xmtp -f dev/local/docker-compose.yml down + ``` \ No newline at end of file