blob: 7850601472764f3628ea9b8618f68047dfa9caa2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# Social App
In-progress social app.
Uses:
- [React Native](https://reactnative.dev)
- [React Native for Web](https://necolas.github.io/react-native-web/)
- [React Navigation](https://reactnative.dev/docs/navigation#react-navigation)
- [MobX](https://mobx.js.org/README.html) and [MobX State Tree](https://mobx-state-tree.js.org/)
- [Async Storage](https://github.com/react-native-async-storage/async-storage)
## Build instructions
- Setup your environment [using the react native instructions](https://reactnative.dev/docs/environment-setup).
- After initial setup:
- `cd ios ; pod install`
- Start the dev servers
- `yarn dev-pds`
- `yarn dev-wallet`
- Run the dev app
- iOS: `yarn ios`
- Android: `yarn android`
- Web: `yarn web`
- Tips
- `npx react-native info` Checks what has been installed.
- On M1 macs, you need to exclude "arm64" from the target architectures
- Annoyingly this must be re-set via XCode after every pod install
## Various notes
### Env vars
Set using the `.env` file or using bash.
```
REACT_APP_AUTH_LOBBY = 'http://localhost:3001'
```
### Build behaviors
The `metro.config.js` file rewrites a couple of imports. This is partly to work around missing features in Metro, and partly to patch the bundle. Affected imports include:
- ucans
- one-webcrypto
### Cryptography
For native builds, we must provide a polyfill of `webcrypto`. We use [react-native-securerandom](https://github.com/robhogan/react-native-securerandom) for the CRNG and [msrcrypto](https://github.com/kevlened/msrCrypto) for the cryptography.
**NOTE** Keys are not currently stored securely.
### Polyfills
`./platform/polyfills.*.ts` adds polyfills to the environment. Currently this includes:
- webcrypto
- TextEncoder / TextDecoder
|