Modern Expo + Expo Router template with a small, production-oriented baseline: file-based navigation, a theme system, i18n, and a lightweight state setup.
- React Native: 0.88.0-rc.4 + React 19.3.0 (New Architecture)
- Expo: SDK 58
- Navigation: Expo Router (tabs, stacks, modals)
- TypeScript: strict type checking
- Package manager: bun (
bun install,bun.lock)
- Styling: Tamagui Tailwind (
@tamagui/tailwindView/Text/styled+className) for RN views +@expo/uistyle/textStyle on native trees - Theming: light/dark mode + system theme sync (Legend State store feeds
TamaguiProvider/Theme) - Design tokens: colors, spacing, typography, radii, shadows
- UI:
@expo/uiuniversal components (Host, Button, Text, Column, Row, etc.) - 2D Graphics: react-native-skia 3.7.0 (unscoped Skia 3); tab one renders an animated Skia canvas (
src/screens/tab-one/pulse-canvas.tsx) colored from the theme - Pressable: local gesture-handler pressable kept for custom hit targets
- Layouts: Base/Bare/Modal layouts for screens
- State: Legend State with MMKV persistence
- Database: WatermelonDB (Nitro SQLite adapter) in
src/data; tab two adds and lists notes - List rendering: LegendList v3 utility wrapper
- Monetization: RevenueCat utility
- Quality: Oxlint + Lefthook
app/ # Expo Router layouts & route wrappers
├── (tabs)/ # Tab routes & tab layout
├── _layout.tsx # Root layout & providers
├── modal-one.tsx # Modal route
├── stack-one.tsx # Stack push route
└── +not-found.tsx # Unmatched route
src/
├── components/ # Common, layouts
├── data/ # WatermelonDB schema, migrations, models, database
├── hooks/ # App-level hooks (refresh control, etc.)
├── i18n/ # i18next setup + locales (en)
├── providers/ # Top-level providers (ErrorBoundary, etc.)
├── screens/ # Screen UI rendered by routes
├── stores/ # App stores (settings, etc.)
├── theme/ # Theme system (tokens, hooks, store)
├── types/ # Shared TS types
└── utils/ # Utilities (storage, logger, date, etc.)
brew install oven-sh/bun/bun # or: curl -fsSL https://bun.sh/install | bash
bun install
bun run startRun native:
bun run ios
bun run androidAdd or remove dependencies with bun add / bun remove; bun owns the lockfile (bun.lock), so npm install, pnpm install, and expo install must not be used to change the tree.
Development and production installs can sit side by side. app.json holds the production identity; app.config.ts suffixes it when APP_VARIANT is not production. When APP_VARIANT is unset (local start, ios, android, prebuild) it defaults to development; production must be requested explicitly.
| Variant | APP_VARIANT |
Name | Bundle ID / package |
|---|---|---|---|
| Dev (default) | unset, development or dev |
my-template-app (Dev) |
com.mytemplateproject.dev |
| Preview | preview |
my-template-app (Preview) |
com.mytemplateproject.preview |
| Production | production |
my-template-app |
com.mytemplateproject |
EAS profiles in eas.json set APP_VARIANT explicitly per build. Only the development build registers the generated exp+<slug> scheme so the Metro QR code opens the Dev app.
Read the resolved variant at runtime with Constants.expoConfig?.extra?.variant. Register each identifier separately with Sentry, and any other service keyed to bundle ID.
Switching a local native project to another variant:
APP_VARIANT=production bunx expo prebuild --cleanUse APP_VARIANT=development bunx expo prebuild --clean before the next dev session so CLI schemes point at the Dev app again.
Use @expo/ui universal components wrapped in Host.
import { Button, Host, Text } from "@expo/ui";
export function Example() {
return (
<Host matchContents>
<Text textStyle={{ fontSize: 24, fontWeight: "600" }}>Welcome</Text>
<Button label="Continue" onPress={() => {}} />
</Host>
);
}RN views are styled with Tamagui Tailwind: View and Text from @tamagui/tailwind take a className of utilities.
import { View } from "@tamagui/tailwind";
export function Card() {
return <View className="gap-1 rounded-lg bg-surface-elevated p-4">{/* ... */}</View>;
}Setup
tamagui.config.ts(repo root) builds the config from@tamagui/config/v6and replaces its tokens and themes with the template's own, imported fromsrc/theme/constantsandsrc/theme/themes:space/size=Spacing(p-4= 16,p-3.5= 14,gap-1= 4)radius=BorderRadius(rounded-lg= 12;noneis a reserved Tamagui name,rounded-noneworks without it)color= flattenedColors(bg-gray-50,text-primary-500)light/darkthemes =lightColorScheme/darkColorSchemeflattened to kebab-case keys:bg-background-primary,bg-surface-elevated,text-text-secondary,border-border-secondary,bg-interactive-primary-hover. Theme classes switch with the mode.
MainProviderwraps the app inTamaguiProvider+<Theme name={mode}>;modecomes from the Legend State theme store (themePrefs$), which remains the single source of truth for light/dark.metro.config.jswraps the config withwithTamaguifrom@tamagui/metro-plugin(components: ["tamagui", "@tamagui/tailwind"]).babel.config.jsonly needsbabel-preset-expoand the Reanimated plugin.- Third-party components that do not take
className(SafeAreaView,GestureHandlerRootView,Animated.View, SkiaCanvas) are wrapped once at module level withstyledNative(Component, "classes")from@/components/common/styled-native.
Rules
- Conflicting classes resolve by position, not like web Tailwind: write the winning class last (
rounded rounded-r-none). - Use
flex-1forflex: 1; fixed font sizes and percentages use arbitrary values (text-[16px],max-w-[60%]). - Props that take a style object, not a class (
contentContainerStyle, computed safe-area offsets), get a plain object; read tokens withgetTokenValue("4", "space")fromtamagui(Tamagui v3 keys have no$prefix). @expo/uiprops (style,textStyleonHost/Column/Text, …) are@expo/ui's own API and stay inline.
To sync an app with this template, copy tamagui.config.ts, the withTamagui metro wrapper, MainProvider, styled-native.ts, and src/theme.
import { Button, Host, Text } from "@expo/ui";
import { useTheme } from "@/theme";
export function ThemeExample() {
const { mode, isDark, toggleMode } = useTheme();
return (
<Host colorScheme={isDark ? "dark" : "light"} matchContents>
<Text>
Mode: {mode} ({isDark ? "dark" : "light"})
</Text>
<Button label="Toggle theme" onPress={toggleMode} variant="outlined" />
</Host>
);
}This template ships with English resources by default. Add more languages by extending src/i18n/locales/* and resources in src/i18n/index.ts.
Local persistence uses WatermelonDB through react-native-watermelondb, a Nitro (JSI) C++ SQLite engine for iOS and Android. The API follows upstream; imports come from react-native-watermelondb.
src/data/schema.ts,src/data/migrations.ts— schema and migrations. Bumpversionand add a migration step together.src/data/models/— models without decorators: declare typed fields and bind them withdefineColumns(src/data/define-columns.ts), e.g.src/data/models/note.ts. Register new models inmodelClassesinsrc/data/database.ts.src/data/database.ts— thedatabaseinstance anddatabaseReady(await it before the first query or write; Android schema setup is async).DatabaseProvideris composed intoMainProvider, souseDatabase()works anywhere under the root layout.src/screens/tab-two— add/list example (useNotes.tsobserves a query).
Needs a development build — the native module does not run in Expo Go. Requires react-native-nitro-modules and rxjs. Metro lists react-native-watermelondb in nonInlinedRequires. After changing native deps, rebuild native (bun run prebuild or an EAS development build).
react-native-skia (the unscoped Skia 3 package, successor of @shopify/react-native-skia) is installed. The tab one demo animates a Canvas with a Reanimated shared value and takes its colors from useTheme(), so it follows light/dark.
Subscriptions use RevenueCat (react-native-purchases + react-native-purchases-ui). Set the public SDK keys in .env:
EXPO_PUBLIC_REVENUECAT_IOS_API_KEYEXPO_PUBLIC_REVENUECAT_ANDROID_API_KEY
The wrapper expects a premium entitlement and paywall placements settings and onboarding_v1 in the RevenueCat dashboard. Initialization is skipped when the current platform key is missing.
Expo Go can load the SDK in Preview API Mode, but real purchases require a development build. After adding or changing these native packages, remake the native client (bun run prebuild or an EAS development build).
bun run start- start Expo dev serverbun run ios- run iOS buildbun run android- run Android buildbun run lint- run Oxlint (check only)bun run lint:fix- run Oxlint with auto-fixbun run typecheck- TypeScript typecheckbun run verify:locales- verify i18n key parity across localesbun run prebuild- regenerate native projects (APP_VARIANT=developmentwithprebuild:dev)