π Start UI [native] is an opinionated native starter repository created & maintained by the BearStudio Team and other contributors. It represents our team's up-to-date stack that we use when creating native apps for our clients.
βοΈ Node.js, π¦ TypeScript, βοΈ React, π± React Native, π Expo, π Better Auth, ποΈ Uniwind, π§± React Native Reusables, π΄ Tanstack Form, π΄ Tanstack Query, π Hey API
pnpm create start-ui -t native myAppThat will scaffold a new folder with the latest version of π Start UI [native] π
cp .env.example .env # Setup your env variables
cp .vscode/settings.example.json .vscode/settings.json # (Optionnal) Setup your VS Code
pnpm install # Install dependenciesTip
Using Expo Go, local development urls should not be localhost, use public IP instead
EXPO_PUBLIC_BASE_URL # Base URL of your server, usefull if you are using Start UI [web]
# OPTIONAL TO OVERRIDE
EXPO_PUBLIC_AUTH_URL # Better-auth url (default `${EXPO_PUBLIC_BASE_URL}/api/auth`)
EXPO_PUBLIC_OPENAPI_URL # OpenAPI contract URL (default `${EXPO_PUBLIC_BASE_URL}/openapi/app/schema`)pnpm gen:apiA new folder /src/lib/hey-api/generated will be created with stuff like to combine use Tanstack Query to fetch data, based on env variables.
For example
import { api } from '@/lib/hey-api/api';
useQuery(api.bookGetByIdOptions({ path: { id: props.bookId } }));pnpm devApp name and bundle ID come from app.config.ts, evaluated at prebuild time. Each script runs prebuild --clean with the appropriate APP_ENV, then builds.
| Script | App name | Build type | Need |
|---|---|---|---|
dev:build:ios / dev:build:android |
Start UI [native] [Dev] | Dev/Debug | Local development, replacement of Expo Go |
build:staging:ios / build:staging:android |
Start UI [native] [Staging] | Release | Install staging release version locally |
build:production:ios / build:production:android |
Start UI [native] | Release | Install production version locally |
# Development (debug build, dev client)
pnpm dev:build:ios
pnpm dev:build:android
# Staging (release build, internal testing)
pnpm build:staging:ios
pnpm build:staging:android
# Production (release build, store-like)
pnpm build:production:ios
pnpm build:production:androidTip
If the app name is wrong, the native project was generated with the wrong APP_ENV. Re-run the same build script β it includes --clean to regenerate the native project.
You can use @dev-plugins pressing Shift + m in your Expo terminal.
Storybook is managed as a specific mode of the app that is launch apart in port 8083
pnpm dev:storybook # To run app in storybook modeTip
You can open Storybook in another tab and switch between the app and Storybook by pressing i or a in each terminal.
Put the custom svg files into the app/components/icons/svg-sources folder and then run the following command:
pnpm gen:iconsIf you want to use the same set of custom duotone icons that Start UI is already using, checkout Phosphor
Warning
All svg icons should be svg files prefixed by icon- (example: icon-externel-link) with square size and filled with #000 color (will be replaced by currentColor).
The GitHub Actions workflows require the following configuration.
Add at Settings β Secrets and variables β Actions β Variables:
| Variable | Description | Used by |
|---|---|---|
API_URL |
Base URL of your API server | EAS builds, preview, update, code quality, prepare-production |
AUTH_URL |
Better Auth URL (e.g. https://your-api.com/api/auth) |
EAS builds, preview, update, code quality, prepare-production |
OPENAPI_URL |
OpenAPI schema URL (e.g. https://your-api.com/openapi/app/schema) |
EAS builds, preview, update, code quality, prepare-production |
ASC_API_KEY_ID |
App Store Connect API Key ID (e.g. H3KZ2V5L32) for the Release Production workflow |
prepare-production |
Add at Settings β Secrets and variables β Actions β Secrets:
| Secret | Description | Used by |
|---|---|---|
EXPO_TOKEN |
Expo access token for EAS CLI | EAS build, development build, update, preview, prepare-production |
APP_STORE_CONNECT_API_KEY |
Base64-encoded App Store Connect API key (.p8 file) for store submission | prepare-production |
Create an Expo token at expo.dev/accounts/{account}/settings/access-tokens.
For APP_STORE_CONNECT_API_KEY: export your App Store Connect API key as base64 (base64 -i AuthKey_XXX.p8) and store the result as the secret. The prepare-production workflow decodes it at runtime for eas submit.
For the Release Production workflow, also configure eas.json submit.production with your App Store Connect credentials (ascAppId, ascApiKeyId, ascApiKeyIssuerId, ascApiKeyPath), and set the ASC_API_KEY_ID variable to match your key ID (used in the key filename).
| Workflow | Trigger | Description |
|---|---|---|
| EAS build | Manual | Build app β select profile (development, staging, production) in the GitHub UI |
| EAS Development build | Manual | Build development client (internal) |
| EAS Update | Manual | Publish OTA update β select channel (development, staging, production) in the GitHub UI |
| EAS Preview | Pull request | Publish preview update on PR branch |
| Release Production | Manual | Build production, then submit to App Store and Play Store |
| Profile | Purpose |
|---|---|
| development | Dev client for local development (internal distribution) |
| staging | Internal distribution for testers (never sent to stores) |
| production | Store build (auto-increments, submitted via Release Production workflow) |
To be able to use previews on PR, you have to setup your project with EAS
- Configure GitHub variables and secrets (see above)
- Setup Expo project: https://expo.dev/
- Create your project
- Get project's id
- Set as
EAS_PROJECT_IDinapp.config.ts
- Setup eas
eas logineas init --id {projectid}eas update:configure
