Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: react-native support #2675

Draft
wants to merge 63 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
860b411
feat: react-native scaffolding
onehassan Apr 22, 2024
83ca903
fix: adjust metro config
onehassan Apr 22, 2024
a2a7b69
fix: add @babel/plugin-transform-export-namespace plugin to babel config
onehassan Apr 22, 2024
65108d5
refactor app structure and update dependencies
onehassan Apr 22, 2024
e8a545e
feat: add basic app structure dependencies and RNCAsyncStorage package
onehassan Apr 24, 2024
51e20c7
feat: refactor to basic components and add auth gate
onehassan Apr 25, 2024
e18ac89
feat: add todos and storage screens
onehassan May 2, 2024
ecc3be7
fix: check for window.location before redirecting to oauth provider url
onehassan May 9, 2024
cfcbb30
chore: set moduleResolution to Node
onehassan May 16, 2024
a47c1be
fix: update window.location check for redirecting to OAuth provider URL
onehassan May 16, 2024
0205010
feat: refactor oauth signin to use an in-app-browser
onehassan May 20, 2024
6dd3b21
feat: add standalone nhost project for react-native example
onehassan May 21, 2024
f57a3bc
feat: refactor sign-in handle refresh session errors
onehassan May 21, 2024
bef9c75
chore: revert react-apollo nhost.toml changes
onehassan May 21, 2024
6e05c80
feat: add `apple-app-site-association` for native webauthn support
onehassan May 21, 2024
bffb300
feat: android webauthn setup
onehassan May 22, 2024
b3cec1e
wip: passkeys auth
onehassan May 23, 2024
06e6207
feat: Update AndroidManifest.xml and nhost.toml for new host URL
onehassan May 24, 2024
2ecf443
feat: add SignUpWithPassKeys screen
onehassan May 24, 2024
085020e
chore: refactor and cleanup example
onehassan May 28, 2024
9b5aa93
chore: add mocks and fix tests
onehassan May 28, 2024
e418ddc
chore: fix linter errors
onehassan May 28, 2024
1c013d3
chore: add MockBroadcastChannel for testing
onehassan May 29, 2024
fd61c38
chore: add README quick setup guide
onehassan May 29, 2024
b789324
chore: revert unnecessary changes
onehassan May 29, 2024
3254438
chore: remove webauthn site association files
onehassan May 29, 2024
f95a6b2
chore: Update README with setup instructions for iOS and Android
onehassan May 29, 2024
a0f5fc7
refactor: reorder components order in Main.tsx for better readability
onehassan May 29, 2024
3ebcb32
feat: added react-native template
onehassan Jun 6, 2024
51c5ec8
feat: add react-native guide to the docs
onehassan Jun 6, 2024
085c740
feat: adjust react native quickstart following feedback
onehassan Jun 7, 2024
b763e5c
docs: update react-native.mdx
onehassan Jun 7, 2024
fa83d41
chore: revert pnpm package manager to version 8.6.2
onehassan Jun 11, 2024
6bef017
chore: run `pnpm install`
onehassan Jun 11, 2024
f51e8f2
chore: Update @nhost/nhost-js to latest version in SvelteKit package.…
onehassan Jun 11, 2024
4364c43
chore: run `pnpm install`
onehassan Jun 11, 2024
9b1dd11
chore: run `pnpm dedupe`
onehassan Jun 11, 2024
93ff975
chore: set pnpm package manager version to 8.10.5
onehassan Jun 11, 2024
cfc4f33
chore: run `pnpm i --fix-lockfile`
onehassan Jun 11, 2024
d81195d
chore: fix lockfile
onehassan Jun 11, 2024
c38d1ec
chore: fix lockfile
onehassan Jun 11, 2024
50d3144
chore: update pnpm version on github actions
onehassan Jun 11, 2024
e484d7c
Revert "chore: update pnpm version on github actions"
onehassan Jun 11, 2024
f6c7ed9
update lockfile
onehassan Jun 12, 2024
b08754a
fix SvelteKit package.json
onehassan Jun 12, 2024
7bb3b1e
fix sveltekit lockfile
onehassan Jun 12, 2024
6dd4bbc
fix lockfiles
onehassan Jun 12, 2024
57305a3
chore: fix test script in package.json
onehassan Jun 12, 2024
bdf911d
chore: Add React Native support documentation
onehassan Jun 12, 2024
282007b
chore: Update React Native support documentation to mention lack of W…
onehassan Jun 13, 2024
cc43048
docs: Add dnsmasq configuration guide for network device connectivity
onehassan Jun 13, 2024
3f5a462
chore: fix steps order in README
onehassan Jun 13, 2024
f271a67
docs: improve react native docs
onehassan Jun 13, 2024
b917f6f
chore: fix dnsmasq command
onehassan Jun 13, 2024
7413f7e
chore: rebase
onehassan Jun 18, 2024
a08b405
chore: fix postinstall script
onehassan Jun 18, 2024
d2c015a
chore: update postinstall script
onehassan Jun 18, 2024
924ca97
chore: run "unlink" instead of postinstall script
onehassan Jun 18, 2024
cda132a
chore: fix lock-file
onehassan Jun 18, 2024
035149b
fix lockfile
onehassan Jun 18, 2024
b12580a
fix lockfile
onehassan Jun 18, 2024
d6bf8ab
restore lockfile
onehassan Jun 18, 2024
50dc87c
fix lockfile
onehassan Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
121 changes: 121 additions & 0 deletions docs/guides/cli/connect-devices-to-local-nhost-project.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
title: Connect Devices to Local Nhost Project
description: Configuring dnsmasq for network device connectivity to a local Nhost project
icon: ethernet
---

## Introduction

If you want to connect to your local environment from other devices on the same network, such as Android emulators
or iPhone devices, you can use **dnsmasq**. Follow this guide for the necessary configuration steps to enable this
functionality for your local Nhost project running on your machine.

<Note>
Make sure to install **dnsmasq**. If you're using another OS, please refer to the [dnsmasq website](https://thekelleys.org.uk/dnsmasq/doc.html).

<Tabs>
<Tab title="macOS">
```shell Terminal
brew install dnsmasq
```
</Tab>
<Tab title="Debian">
```shell Terminal
apt-get install dnsmasq
```
</Tab>
<Tab title="Nix">
```shell Terminal
nix-env -iA nixpkgs.dnsmasq
```
</Tab>
</Tabs>
</Note>

# Configure dnsmasq for Android
<Warning>These steps are necessary when running on both an **Android emulator** or **physical Android device**</Warning>
<Steps>
<Step title="Configure dnsmasq">
Configure `dnsmasq` to resolve nhost service urls to your machine's special [loopback address](https://developer.android.com/studio/run/emulator-networking) `10.0.2.2`
```shell Terminal
sudo dnsmasq -d \
--address=/local.auth.nhost.run/10.0.2.2 \
--address=/local.graphql.nhost.run/10.0.2.2 \
--address=/local.storage.nhost.run/10.0.2.2 \
--address=/local.functions.nhost.run/10.0.2.2
```
</Step>
<Step title="Restart dnsmasq">
If you're using another OS, please refer to the [dnsmasq website](https://thekelleys.org.uk/dnsmasq/doc.html).
<Tabs>
<Tab title="macOS">
```shell Terminal
sudo brew services restart dnsmasq
```
</Tab>
<Tab title="Debian">
```shell Terminal
sudo systemctl restart dnsmasq
```
</Tab>
</Tabs>
</Step>
<Step title="Configure the android device/emulator's DNS settings">
1. Edit your network settings: Settings > Network & Internet > Internet > AndroidWifi
2. set `IP settings` to `Static`
3. set `DNS 1` and `DNS 2` to `10.0.2.2`
4. Save
</Step>
</Steps>

# Configure dnsmasq for iOS
<Warning>These steps are only necessary when running on physical iOS device, the iOS simulator uses the host machine's network, so no additional configuration is typically needed.</Warning>
<Steps>
<Step title="Inspect your machine's IP address on your network">
<Tabs>
<Tab title="macOS">
```shell Terminal
ipconfig getifaddr en0
```
</Tab>
<Tab title="Debian">
```shell Terminal
ip addr show dev en0 | grep 'inet ' | awk '{print $2}' | cut -d/ -f1
```
</Tab>
</Tabs>
</Step>
<Step title="Configure dnsmasq">
Configure `dnsmasq` to resolve nhost service urls to your machine's ip address.
<Warning>Make sure to replace every occurrence of **[your-machine-s-up-address]** with the address printed in Step `1`</Warning>

```shell Terminal
sudo dnsmasq -d \
--address=/local.auth.nhost.run/[your-machine-s-up-address] \
--address=/local.graphql.nhost.run/[your-machine-s-up-address] \
--address=/local.storage.nhost.run/[your-machine-s-up-address] \
--address=/local.functions.nhost.run/[your-machine-s-up-address]
```
</Step>
<Step title="Restart dnsmasq">
If you're using another OS, please refer to the [dnsmasq website](https://thekelleys.org.uk/dnsmasq/doc.html).
<Tabs>
<Tab title="macOS">
```shell Terminal
sudo brew services restart dnsmasq
```
</Tab>
<Tab title="Debian">
```shell Terminal
sudo systemctl restart dnsmasq
```
</Tab>
</Tabs>
</Step>
<Step title="Configure the iPhone's DNS settings">
1. Select the wifi you're connected and select `Configure DNS`
2. Select `Manual`
3. Click on `Add server` and type your local machine's IP address printed in Step `1`
4. Save
</Step>
</Steps>