Skip to content

Commit d039114

Browse files
chore: improved readme and added some scripts to improve devex (#260)
1 parent c4ba921 commit d039114

File tree

6 files changed

+49
-122
lines changed

6 files changed

+49
-122
lines changed

dapps/pos-app/.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
EXPO_PUBLIC_PROJECT_ID=""
2-
EXPO_PUBLIC_SENTRY_DSN=""
2+
EXPO_PUBLIC_SENTRY_DSN=""
3+
SENTRY_AUTH_TOKEN=""

dapps/pos-app/README.md

Lines changed: 21 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Welcome to your Expo app 👋
2-
3-
This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app).
1+
# Welcome to POS Sample app
42

53
## Get started
64

@@ -10,129 +8,36 @@ This is an [Expo](https://expo.dev) project created with [`create-expo-app`](htt
108
npm install
119
```
1210

13-
2. Start the app
11+
2. Set up environment variables
12+
13+
Create a `.env` file using the example template:
1414

1515
```bash
16-
npx expo start
16+
cp .env.example .env
1717
```
1818

19-
In the output, you'll find options to open the app in a
20-
21-
- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
22-
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
23-
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
24-
- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo
25-
26-
You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).
27-
28-
## Sentry Configuration
29-
30-
This project uses [Sentry](https://sentry.io/) for error tracking and monitoring. Before building the app, you need to configure Sentry authentication.
31-
32-
### Option 1: Using Sentry Wizard (Recommended)
33-
34-
Run the Sentry wizard to automatically configure your project:
35-
36-
```bash
37-
npx @sentry/wizard@latest -i reactNative
38-
```
39-
40-
This will:
41-
- Create/update the `sentry.properties` file in the `android/` and `ios/` directories
42-
- Set up your authentication token
43-
- Configure source map uploading
44-
45-
### Option 2: Manual Configuration
46-
47-
If you prefer to configure manually, you can set the `SENTRY_AUTH_TOKEN` environment variable:
48-
49-
```bash
50-
# DO NOT COMMIT YOUR AUTH TOKEN
51-
export SENTRY_AUTH_TOKEN=sntrys_YOUR_TOKEN_HERE
52-
```
53-
54-
Alternatively, you can add the token directly to the `sentry.properties` files:
55-
56-
**android/sentry.properties** and **ios/sentry.properties**:
57-
```properties
58-
defaults.url=https://sentry.io/
59-
defaults.org=walletconnect
60-
defaults.project=mobile-pos-react-native
61-
auth.token=YOUR_AUTH_TOKEN_HERE
62-
```
63-
64-
> **⚠️ Security Note**: Never commit your Sentry auth token to version control. Add `sentry.properties` to your `.gitignore` file.
65-
66-
### Getting Your Auth Token
67-
68-
1. Log in to [sentry.io](https://sentry.io/)
69-
2. Go to Settings → Account → API → Auth Tokens
70-
3. Create a new token with the following scopes:
71-
- `project:read`
72-
- `project:releases`
73-
- `org:read`
74-
75-
For more information on source maps and Expo integration, see the [Sentry Expo Documentation](https://docs.sentry.io/platforms/react-native/sourcemaps/uploading/expo/).
19+
Update the `.env` file with your configuration values.
7620

77-
## Android Release Configuration
21+
3. Create native folders
7822

79-
To build Android release versions of the app, you need to create a `secrets.properties` file in the `android/` directory with your keystore credentials.
80-
81-
### Option 1: Testing with Debug Signing (Recommended for Development)
82-
83-
For testing purposes, you can use the debug signing configuration. In `android/app/build.gradle`, ensure the release build type uses the debug signing config:
84-
85-
```gradle
86-
buildTypes {
87-
release {
88-
signingConfig signingConfigs.debug
89-
// ... other release configurations
90-
}
91-
}
92-
```
93-
94-
This allows you to build release APKs without setting up a production keystore.
95-
96-
### Option 2: Production Signing with secrets.properties
97-
98-
For production releases, create a file at `android/secrets.properties` with the following content:
99-
100-
```properties
101-
WC_FILENAME_UPLOAD=path/to/your-keystore.keystore
102-
WC_STORE_PASSWORD_UPLOAD=your_store_password
103-
WC_KEYSTORE_ALIAS=your_key_alias
104-
WC_KEY_PASSWORD_UPLOAD=your_key_password
105-
```
106-
107-
Then update the release signing config in `android/app/build.gradle` to use the release signing configuration instead of debug.
108-
109-
### Generating a Keystore
110-
111-
If you don't have a keystore file yet, you can generate one using the following command:
112-
113-
```bash
114-
keytool -genkeypair -v -storetype PKCS12 -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000
115-
```
116-
117-
This will prompt you to create passwords for the keystore and key. Make sure to:
118-
- Store the keystore file in a secure location
119-
- Remember the passwords you set
120-
- Never commit the keystore file or `secrets.properties` to version control
121-
122-
> **⚠️ Security Note**: The `secrets.properties` file is already excluded in the `.gitignore`. Never commit this file or your keystore to version control.
23+
```bash
24+
npm run prebuild
25+
```
12326

124-
For more information on Android app signing, see the [React Native documentation](https://reactnative.dev/docs/signed-apk-android).
27+
This will automatically set up the required files for development.
12528

126-
## Learn more
29+
4. Start the app
12730

128-
To learn more about developing your project with Expo, look at the following resources:
31+
```bash
32+
npm run android
33+
```
12934

130-
- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
131-
- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web.
35+
```bash
36+
npm run ios
37+
```
13238

133-
## Join the community
39+
## Production Releases
13440

135-
Join our community of developers creating universal apps.
41+
For production Android releases, you'll need the actual `secrets.properties` file and keystore. Get these from the mobile team or 1Password.
13642

137-
- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
138-
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.
43+
> **⚠️ Security Note**: Never commit `secrets.properties` or keystore files to version control.

dapps/pos-app/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dapps/pos-app/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"start": "expo start",
77
"android": "expo run:android",
88
"android:build": "cd android && ./gradlew assembleRelease",
9+
"prebuild": "expo prebuild",
10+
"postprebuild": "node scripts/setup-secrets.js",
911
"ios": "expo run:ios",
1012
"web": "expo start --web",
1113
"lint": "expo lint",
@@ -81,7 +83,8 @@
8183
"@walletconnect/sign-client": "2.23.0",
8284
"@walletconnect/types": "2.23.0",
8385
"@walletconnect/utils": "2.23.0",
84-
"hono": "4.10.2"
86+
"hono": "4.10.2",
87+
"tar": "7.5.2"
8588
},
8689
"private": true
8790
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const fs = require("fs");
2+
const path = require("path");
3+
4+
const secretsPath = path.join(process.cwd(), "android/secrets.properties");
5+
const mockPath = path.join(process.cwd(), "secrets.properties.mock");
6+
7+
if (!fs.existsSync(secretsPath) && fs.existsSync(mockPath)) {
8+
fs.copyFileSync(mockPath, secretsPath);
9+
console.log(
10+
"✔ Copied secrets.properties.mock to android/secrets.properties - Dont use this for production releases, ask the mobile team for the actual file",
11+
);
12+
} else if (fs.existsSync(secretsPath)) {
13+
console.log("android/secrets.properties already exists, skipping copy");
14+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
WC_FILENAME_UPLOAD=debug.keystore
2+
WC_STORE_PASSWORD_UPLOAD=android
3+
WC_KEYSTORE_ALIAS=androiddebugkey
4+
WC_KEY_PASSWORD_UPLOAD=android

0 commit comments

Comments
 (0)