A production-ready React Native template with AI-guided customization, comprehensive component library, and OpenSpec integration.
Build mobile apps 10x faster with a battle-tested foundation, clean architecture, and intelligent AI assistance.
- β‘οΈ React Native 0.81.4 with New Architecture (JSI enabled)
- π¨ Atomic Design System - Complete component library (atoms β molecules β organisms)
- π Theme System - Light/dark modes with design tokens
- π¦ WatermelonDB - Reactive, performant local database
- π§ Navigation - Bottom tabs with stack navigation ready
- π€ AI-Guided Development - OpenSpec integration for spec-driven workflows
- π§ Modular Features - Enable/disable features via configuration
- π± Production Ready - Performance optimized, tested patterns
- π― TypeScript Strict Mode - Full type safety
- π οΈ Modern Tooling - Biome for linting/formatting
- Node.js >= 18
- NPM >= 9
- React Native development environment (setup guide)
- For iOS: Xcode 14+ and CocoaPods
- For Android: Android Studio and JDK 17
- Clone the template
git clone https://github.com/amitayks/react-native-template.git your-app-name
cd your-app-name- Install dependencies
npm install- iOS: Install pods
cd ios && pod install && cd ..- Run the app
# iOS
npm run ios
# Android
npm run android- Setup wizard will launch automatically on first run
- Answer questions about your app
- Or provide a pre-configured
template.config.json - Wizard customizes the template for your project
src/
βββ components/ # UI Components (Atomic Design)
β βββ atoms/ # Basic building blocks (Button, Icon, etc.)
β βββ molecules/ # Simple combinations (SearchBar, etc.)
β βββ organisms/ # Complex components (SettingsDrawer, etc.)
β βββ templates/ # Page-level templates
βββ contexts/ # React Context providers
β βββ SettingsContext.tsx
β βββ NavigationContext.tsx
β βββ ToastContext.tsx
βββ hooks/ # Custom React hooks
βββ models/ # WatermelonDB models
β βββ Item.ts # Generic placeholder model
β βββ AppSettings.ts # App settings model
βββ navigation/ # Navigation configuration
β βββ RootNavigator.tsx
β βββ MainNavigator.tsx
β βββ OnboardingNavigator.tsx
βββ screens/ # Screen components
β βββ Home/ # Home screen
β βββ Settings/ # Settings screen
β βββ Onboarding/ # Onboarding flow
βββ services/ # Business logic & services
β βββ database/ # Database setup & repositories
β βββ storage/ # MMKV key-value storage
β βββ security/ # Encryption services
β βββ performance/ # Performance monitoring
βββ theme/ # Design system
β βββ colors.ts # Color palette & design tokens
β βββ useTheme.ts # Theme hook
βββ utils/ # Utility functions
β βββ animations/ # Animation configurations
β βββ constants/ # App constants
β βββ device/ # Device utilities
β βββ templateConfig.ts # Template configuration utility
βββ shared-types/ # TypeScript type definitions
openspec/ # OpenSpec integration
βββ project.md # Project context & conventions
βββ AGENTS.md # AI assistant instructions
βββ specs/ # Feature specifications
βββ changes/ # Change proposals
βββ ai-instructions/ # Detailed AI guidance docs
template.config.json # Template configuration
- Button - Multiple variants (primary, secondary, text, icon, ghost)
- Icon - Material Design icons
- Badge - Status badges
- ProgressBar - Animated progress indicator
- LabelTag - Tags for categorization
- ToastNotification - Toast messages
- SearchBar - Search input with icon
- BottomNavContainer - Generic bottom nav wrapper
- DateSectionHeader - Section headers for lists
- ProcessingIndicator - Processing status display
- AnimatedBottomNav - Animated bottom navigation
- SettingsDrawer - Full-featured settings panel
- HorizontalPageContainer - Swipeable page container
- ErrorBoundary - Error handling wrapper
- OnboardingTemplate - Multi-step onboarding flow
The heart of the template system. Controls project configuration, features, branding, and more.
{
"project": {
"name": "{{APP_NAME}}",
"packageName": "{{PACKAGE_NAME}}",
"description": "{{APP_DESCRIPTION}}"
},
"features": {
"ml": { "enabled": false },
"camera": { "enabled": false },
"search": { "enabled": false }
},
"branding": {
"theme": {
"primaryColor": "{{PRIMARY_COLOR}}",
"secondaryColor": "{{SECONDARY_COLOR}}"
}
}
}Placeholders {{LIKE_THIS}} are replaced during setup wizard.
Enable/disable modular features:
import { isFeatureEnabled } from '@utils/templateConfig';
if (isFeatureEnabled('camera')) {
// Camera feature code
}This template integrates with OpenSpec for spec-driven development with AI assistance.
Throughout the code, you'll find instruction blocks:
/* AI-INSTRUCTION-START:instruction-id
* Instructions for AI on how to customize this section
* Detailed guidance in openspec/ai-instructions/instruction-id.md
* OpenSpec Reference: specs/feature/spec.md
* AI-INSTRUCTION-END */These guide AI assistants (like Claude Code, GitHub Copilot, etc.) on proper customization.
- AI reads
openspec/project.mdfor project context - AI checks
template.config.jsonfor configuration - AI follows instructions in
openspec/AGENTS.md - AI uses OpenSpec for creating change proposals
- AI refers to
openspec/ai-instructions/for detailed guidance
# AI creates proposal
openspec/changes/add-user-profile/
βββ proposal.md # What and why
βββ tasks.md # Implementation checklist
βββ specs/ # Delta changes to requirements- Minimal functional placeholder
- Replace with your app's main functionality
- Uses Atomic Design components
- Theme-aware styling
- Theme selection (light/dark/system)
- Clear cache
- Delete all data
- Legal links (privacy, terms, licenses)
- App version display
- Multi-step onboarding flow
- Permission requests
- Feature highlights
- Skip/complete functionality
- Reactive, performant SQLite database
- JSI-powered for New Architecture
- Lazy loading and optimistic updates
- Item - Generic placeholder model (replace with your entities)
- AppSettings - Key-value app settings
import { database } from '@services/database/database';
const items = await database.get<Item>('{{TABLE_NAME}}').query().fetch();import { spacing, borderRadius, typography } from '@theme/colors';
const styles = StyleSheet.create({
container: {
padding: spacing.lg, // 24px
borderRadius: borderRadius.md, // 8px
},
text: {
fontSize: typography.fontSize.md, // 16px
fontWeight: typography.fontWeight.semibold, // 600
},
});import { useTheme } from '@theme/useTheme';
function MyComponent() {
const { colors, isDark } = useTheme();
return (
<View style={{ backgroundColor: colors.background }}>
<Text style={{ color: colors.text }}>Hello</Text>
</View>
);
}Before building production releases, you MUST configure a release keystore:
cd android/app
keytool -genkeypair -v -storetype PKCS12 -keystore release.keystore \
-alias app-key-alias -keyalg RSA -keysize 2048 -validity 10000You will be prompted for:
- Keystore password (remember this!)
- Your name
- Organizational unit
- Organization name
- City/Locality
- State/Province
- Two-letter country code
Edit android/gradle.properties and update these values:
APP_UPLOAD_STORE_FILE=release.keystore
APP_UPLOAD_KEY_ALIAS=app-key-alias
APP_UPLOAD_STORE_PASSWORD=your_password_here
APP_UPLOAD_KEY_PASSWORD=your_password_hereCRITICAL:
- β
Keep the keystore file (
release.keystore) backed up securely - β
Never commit
gradle.propertieswith real passwords to Git - β Use environment variables for CI/CD pipelines
β οΈ If you lose the keystore, you cannot update your published appβ οΈ Addgradle.propertiesto.gitignoreif storing real passwords
For CI/CD, use environment variables:
export APP_UPLOAD_STORE_PASSWORD=$KEYSTORE_PASSWORD
export APP_UPLOAD_KEY_PASSWORD=$KEY_PASSWORD# Development
npm start # Start Metro bundler
npm run android # Run on Android (debug)
npm run ios # Run on iOS (debug)
# Build
npm run apk # Build Android APK (debug)
npm run aab # Build Android App Bundle (release - REQUIRES KEYSTORE)
# Code Quality
npm run typecheck # TypeScript type checking
npm run lint # Lint code with Biome
npm run lint:fix # Fix linting issues
npm run format # Format code
npm test # Run tests| Package | Version | Purpose |
|---|---|---|
| React Native | 0.81.4 | Core framework |
| React | 19.1.0 | UI library |
| TypeScript | 5.9.3 | Type safety |
| WatermelonDB | 0.28.0 | Database |
| React Navigation | 7.x | Navigation |
| Reanimated | 3.19.2 | Animations |
| MMKV | 3.3.3 | Key-value storage |
| Biome | 2.2.5 | Linter/Formatter |
Full dependency list: See package.json
Components follow Atomic Design methodology for maximum reusability and maintainability.
- React Context + useReducer for global state
- Local state for UI state
- WatermelonDB observables for reactive data
- Components: UI only, no business logic
- Hooks: Reusable logic
- Services: Business logic, API calls, data manipulation
- Contexts: Global state management
- Repositories: Database access layer
- Create screen component in
src/screens/YourScreen/ - Add to navigation in
src/navigation/MainNavigator.tsx - Follow HomeScreen.tsx pattern
- Add AI instruction blocks for future customization
- Define model in
src/models/YourModel.ts - Update schema in
src/services/database/schema.ts - Register in
src/services/database/database.ts - Create repository (optional but recommended)
See openspec/ai-instructions/ for detailed guides.
- openspec/project.md - Comprehensive project context & conventions
- openspec/AGENTS.md - OpenSpec workflow guide
- openspec/ai-instructions/ - Detailed customization guides
- template.config.json - Configuration schema
This is a template repository. Once you clone it, it's yours to customize!
If you want to contribute improvements back to the template:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - See LICENSE file for details
Built with:
- React Native
- WatermelonDB
- React Navigation
- And many other amazing open-source projects
# Clean and rebuild
cd android && ./gradlew clean && cd ..
cd ios && pod install && cd ..
npm start -- --reset-cachenpm run typechecknpm run lint:fix# Clear app data and restart
# iOS: Delete app and reinstall
# Android: Settings β Apps β Your App β Clear Data- Documentation: openspec/project.md
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with β€οΈ for the React Native community
Start building your app today! π