A production-ready Expo/React Native template following architectural best practices.
- Framework: React Native + Expo
- Navigation: Expo Router (file-based)
- Styling: NativeWind (Tailwind CSS for React Native)
- State Management:
- React Query (TanStack Query) for server state
- Zustand for client state
- Forms: React Hook Form + Zod
- Storage: AsyncStorage + Expo SecureStore
- HTTP: Axios
- Language: TypeScript (strict mode)
✓ Complete folder structure (Feature-based + Atomic UI hybrid)
✓ Custom UI primitives with NativeWind
✓ Dark mode support out of the box
✓ Type-safe configuration and constants
✓ Path aliases configured (@/, @components/, etc.)
✓ React Query + Zustand setup
✓ Storage wrappers (secure and regular)
✓ Responsive design utilities
- Node.js 22+ and npm/yarn
- Expo CLI (
npm install -g expo-cli) - iOS Simulator (Mac) or Android Studio
- Clone the repository
git clone <repo-url>
cd expo-template- Install dependencies
npm install- Set up environment variables
cp .env.example .env
# Edit .env with your configuration- Start the development server
npx expo start- Run on your device
- Press
ifor iOS simulator - Press
afor Android emulator - Scan QR code with Expo Go app
expo-template/
├── app/ # Expo Router screens (file-based routing)
│ ├── _layout.tsx # Root layout with providers
│ └── index.tsx # Home screen
├── src/
│ ├── components/
│ │ ├── ui/ # UI Primitives (Button, Input, Text, Card)
│ │ └── shared/ # Shared components
│ ├── features/ # Feature modules (self-contained)
│ ├── hooks/ # Global hooks (useDebounce, useResponsive)
│ ├── services/ # API client, storage wrappers
│ ├── providers/ # React context providers
│ ├── constants/ # App-wide constants (routes, strings, etc.)
│ ├── lib/ # Utilities (cn function, helpers)
│ ├── types/ # Global TypeScript types
│ └── config/ # Environment and feature flags
├── assets/
│ └── fonts/ # Inter font family
├── global.css # Tailwind/NativeWind theme
└── tailwind.config.js # Tailwind configuration
- Use NativeWind
classNameprop for all styling - Object-based variant maps (not inline conditional styles)
cn()utility for class merging- CSS variables for colors (supports dark mode)
- All strings in
@/constants/strings - All routes in
@/constants/routes - All API endpoints in
@/constants/api - All storage keys in
@/constants/storage-keys - Never hardcode these values
- Server data: React Query
- Client state: Zustand
- Form state: React Hook Form + Zod
- Local state: useState/useReducer
- Screens:
kebab-case.tsx - Components:
PascalCase.tsx - Hooks:
camelCase.ts(use prefix) - Types:
camelCase.types.ts
# Start development server
npm start
# Run on iOS
npm run ios
# Run on Android
npm run android
# Type check
npx tsc --noEmit
# Build for production
eas build --platform ios
eas build --platform android- Create feature folder:
src/features/my-feature/ - Add components:
src/features/my-feature/components/ - Add hooks:
src/features/my-feature/hooks/ - Add services:
src/features/my-feature/services/ - Add types:
src/features/my-feature/types/ - Export public API:
src/features/my-feature/index.ts
Copy .env.example to .env and configure:
API_URL: Backend API base URLAPI_TIMEOUT: Request timeout in millisecondsENABLE_ANALYTICS: Enable/disable analyticsENABLE_PUSH_NOTIFICATIONS: Enable/disable push notifications
- Feature-based structure: Features are self-contained modules
- Atomic UI: Reusable primitives composed into complex components
- Type safety: Strict TypeScript, no
anytypes - No hardcoded values: All strings, routes, endpoints in constants
- Single responsibility: Each component/function does one thing well
See the guidelines/ folder for complete architectural documentation:
- Project structure
- State management strategy
- Component design patterns
- Styling and theming
- Forms and validation
- And more...
MIT