Skip to content

Commit e645785

Browse files
committed
add initial react-native app, with ui-schema 0.5.0-alpha.3
1 parent 135b535 commit e645785

File tree

14 files changed

+9747
-1
lines changed

14 files changed

+9747
-1
lines changed

.github/workflows/blank.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: UI-Schema React Native CI
2+
3+
env:
4+
DOCKER_BUILDKIT: 1
5+
6+
on:
7+
push:
8+
branches: [ main, develop, feature/** ]
9+
pull_request:
10+
branches: [ main, develop, feature/** ]
11+
# create:
12+
# tags:
13+
# - '[0-9]+.[0-9]+.[0-9]+*'
14+
15+
# Allows you to run this workflow manually from the Actions tab
16+
workflow_dispatch:
17+
18+
jobs:
19+
build_node:
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
node-version: [ 24 ]
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Set Branch
27+
id: vars
28+
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/}
29+
- name: Use Node.js ${{ matrix.node-version }}
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
registry-url: 'https://registry.npmjs.org'
34+
35+
- name: Cache CI node_modules
36+
uses: actions/cache@v4
37+
env:
38+
cache-name: cache-node-modules
39+
with:
40+
# npm cache files are stored in `~/.npm` on Linux/macOS
41+
path: ~/.npm
42+
key: ${{ runner.os }}-build-${{ env.cache-name }}
43+
44+
- name: Setup Java
45+
uses: actions/setup-java@v4
46+
with:
47+
distribution: 'temurin'
48+
java-version: '21'
49+
50+
- name: Install dependencies
51+
run: npm install
52+
53+
- name: Build Web
54+
run: npx expo export -p web
55+
56+
- name: Build Android
57+
run: |
58+
npx expo prebuild --platform android
59+
chmod +x android/gradlew
60+
cd android
61+
./gradlew bundleRelease --no-daemon
62+
63+
- name: Upload Android Bundle
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: android-app-bundle
67+
path: android/app/build/outputs/bundle/release/app-release.aab
68+
69+
70+
71+
72+

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
2+
3+
# dependencies
4+
node_modules/
5+
6+
# Expo
7+
.expo/
8+
dist/
9+
web-build/
10+
android/
11+
ios/
12+
expo-env.d.ts
13+
14+
# Native
15+
.kotlin/
16+
*.orig.*
17+
*.jks
18+
*.p8
19+
*.p12
20+
*.key
21+
*.mobileprovision
22+
23+
# Metro
24+
.metro-health-check*
25+
26+
# debug
27+
npm-debug.*
28+
yarn-debug.*
29+
yarn-error.*
30+
31+
# macOS
32+
.DS_Store
33+
*.pem
34+
35+
# local env files
36+
.env*.local
37+
38+
# typescript
39+
*.tsbuildinfo
40+
41+
42+
.idea

README.md

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,80 @@
1-
# demo-react-native
1+
# UI-Schema React Native
2+
3+
Example app for [UI-Schema React](https://github.com/ui-schema/ui-schema) with [React Native](https://reactnative.dev/) and [Expo](https://expo.dev/).
4+
5+
Includes a custom UI-Schema binding with react-native `string`, `boolean` and `Select` widgets, and a basic multi-screen navigation structure. Check the [src/App.tsx](./src/App.tsx) file for the implementation details.
6+
7+
> [!NOTE]
8+
>
9+
> No experience with Expo/React Native. Without checking best practices or which packages/theme libraries exist.
10+
>
11+
> The Android and web preview and build were successful.
12+
13+
![screenshot of browser and android app preview](./assets/ui-schema-react-native.jpg)
14+
15+
## Setup
16+
17+
First, clone the repository and navigate into the directory:
18+
19+
```bash
20+
git clone https://github.com/ui-schema/demo-react-native.git
21+
cd demo-react-native
22+
```
23+
24+
Then install dependencies:
25+
26+
```bash
27+
npm install
28+
```
29+
30+
## Running the App
31+
32+
To run the app on your device or simulator:
33+
34+
```bash
35+
npm start
36+
```
37+
38+
To run the web version of the app:
39+
40+
```bash
41+
npm run web
42+
```
43+
44+
Or run the app on Android (you'll need to have an Android emulator or device connected):
45+
46+
```bash
47+
npm run android
48+
```
49+
50+
## Build the App
51+
52+
> For android/ios check the expo docs.
53+
54+
### Web
55+
56+
To build the web version of the app for deployment:
57+
58+
```bash
59+
npx expo export -p web
60+
```
61+
62+
This will create a `dist` directory containing the static web files.
63+
64+
You can run it with a basic `http` docker image like:
65+
66+
On unix:
67+
68+
```bash
69+
docker run -p 8080:80 -v ${PWD}/dist:/usr/local/apache2/htdocs/ httpd:2.4
70+
```
71+
72+
On windows:
73+
74+
```bash
75+
docker run -p 8080:80 -v "%cd%/dist":/usr/local/apache2/htdocs/ httpd:2.4
76+
```
77+
78+
## License
79+
80+
This project is licensed under the MIT License.

app.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"expo": {
3+
"name": "ui-schema-react-native",
4+
"slug": "ui-schema-react-native",
5+
"version": "0.5.0",
6+
"orientation": "portrait",
7+
"icon": "./assets/icon.png",
8+
"userInterfaceStyle": "light",
9+
"newArchEnabled": true,
10+
"splash": {
11+
"image": "./assets/splash-icon.png",
12+
"resizeMode": "contain",
13+
"backgroundColor": "#ffffff"
14+
},
15+
"ios": {
16+
"supportsTablet": true
17+
},
18+
"android": {
19+
"adaptiveIcon": {
20+
"foregroundImage": "./assets/adaptive-icon.png",
21+
"backgroundColor": "#ffffff"
22+
},
23+
"edgeToEdgeEnabled": true,
24+
"package": "com.anonymous.uischemareactnative"
25+
},
26+
"web": {
27+
"favicon": "./assets/favicon.png"
28+
}
29+
}
30+
}

assets/adaptive-icon.png

17.1 KB
Loading

assets/favicon.png

1.43 KB
Loading

assets/icon.png

21.9 KB
Loading

assets/splash-icon.png

17.1 KB
Loading

assets/ui-schema-react-native.jpg

62.8 KB
Loading

0 commit comments

Comments
 (0)