Lite Version of
AIMobileLauncher
Explore the full-featured version here:
www.aimobilelauncher.com
A comprehensive React Native boilerplate built with Expo, following feature-first architecture principles. This project is a streamlined, lighter version of the AIMobileLauncher, including authentication, onboarding, internationalization, theming, and modern state management.
- Feature-First Architecture: Organized by business features rather than technical layers
- Authentication: Complete login system with secure token storage
- Onboarding: 3-step onboarding flow with questionnaires
- Internationalization: English and French language support
- Theming: Light/Dark/System theme support with Restyle
- State Management: Redux Toolkit with RTK Query
- Navigation: React Navigation with type-safe routing
- UI Components: Reusable components built with Restyle
- TypeScript: Full TypeScript support with strict configuration
- Secure Storage: Encrypted storage for sensitive data
- Performance: MMKV storage, FlashList, and optimized animations
- Error Handling: Global error boundary with recovery mechanisms
- Analytics: Built-in logging and analytics service
src/
βββ features/ # Feature-specific code
β βββ auth/ # Authentication feature
β β βββ api/ # API calls and endpoints
β β βββ components/ # Feature-specific components
β β βββ hooks/ # Custom hooks
β β βββ screens/ # Screen components
β β βββ services/ # Business logic
β β βββ store/ # State management
β β βββ types/ # Type definitions
β βββ onboarding/ # Onboarding flow
β βββ home/ # Home screen
β βββ settings/ # Settings screen
β βββ todos/ # Todos feature
βββ navigation/ # Navigation configuration
β βββ navigators/ # Navigator components
β βββ routes.ts # Route definitions
β βββ routes.types.ts # Navigation types
βββ services/ # Global services
β βββ api/ # API configuration
β βββ storage/ # Storage services
β βββ analytics/ # Analytics service
β βββ logging/ # Logging services
βββ store/ # Global store configuration
β βββ store.ts # Store setup
β βββ reducers.ts # Root reducer
β βββ app.slice.ts # App-level state
βββ ui/ # Shared UI components
β βββ components/ # Reusable components
β βββ style/ # Theme and styling
β βββ tokens/ # Design tokens
βββ utils/ # Utility functions
βββ schemas/ # Data validation schemas
βββ config/ # Configuration files
βββ entrypoints/ # App entry points
βββ providers/ # App providers
βββ locales/ # Translation files
- React Native with Expo
- TypeScript for type safety
- Redux Toolkit for state management
- RTK Query for API calls
- React Navigation for navigation
- Restyle for styling and theming
- React Hook Form with Zod validation
- i18next for internationalization
- Expo Secure Store for secure storage
- MMKV for high-performance storage
- Redux Persist for state persistence
- Biome for linting and formatting
- React Native Reanimated for animations
- FlashList for optimized lists
- Node.js (v16 or higher)
- Yarn package manager
- Expo CLI
- iOS Simulator or Android Emulator (for testing)
- Clone the repository:
git clone <repository-url>
cd mobileLauncherLt- Install dependencies:
yarn install- Start the development server:
yarn start- Run on your preferred platform:
# iOS
yarn ios
# Android
yarn android
# Web
yarn webEach feature is self-contained with its own:
- Components: Feature-specific UI components
- Screens: Screen components
- Hooks: Custom hooks for business logic
- Store: Redux slice and selectors
- API: RTK Query endpoints
- Services: Business logic services
- Types: TypeScript type definitions
- Redux Toolkit: Modern Redux with less boilerplate
- RTK Query: Powerful data fetching and caching
- Redux Persist: Automatic state persistence with MMKV
- Type-safe selectors: Using createSelector
- Restyle: Type-safe styling system
- Light/Dark themes: Automatic theme switching
- System theme: Follows device theme preference
- Design tokens: Consistent spacing, colors, and typography
- Type-safe navigation: Full TypeScript support
- Nested navigators: Stack β Tab navigation
- Authentication guards: Automatic route protection
- Deep linking: URL-based navigation support
Create a .env file in the root directory:
API_BASE_URL=https://your-api-url.comThe project uses path mapping for clean imports:
// Instead of
import { Button } from '../../../ui/components/button';
// Use
import { Button } from '#ui/components/button';- Create feature directory:
mkdir -p src/features/new-feature/{api,components,hooks,screens,services,store,types}- Follow the established patterns:
- Create types in
types/index.ts - Add Redux slice in
store/ - Create components in
components/ - Add screens in
screens/ - Implement hooks in
hooks/
- Create types in
- Create translation file in
src/locales/:
{
"common": {
"loading": "Loading...",
"error": "An error occurred"
}
}- Update
src/config/i18n.tsto include the new language
import { useTranslation } from 'react-i18next';
const MyComponent = () => {
const { t } = useTranslation();
return <Text>{t('common.loading')}</Text>;
};- Update
src/ui/tokens/colors.ts:
const palette = {
// Add new colors
brand: '#FF6B6B',
};- Use in components:
<Box backgroundColor="brand" />import { createBox } from '@shopify/restyle';
import { Theme } from '#ui/style/theme';
const StyledComponent = createBox<Theme>();
export const MyComponent = ({ ...props }) => {
return <StyledComponent {...props} />;
};The authentication system includes:
- Secure token storage with Expo Secure Store
- Automatic token refresh
- Login/logout functionality
- Protected routes
- User profile management
import { useAuth } from '#features/auth';
const MyComponent = () => {
const { user, isAuthenticated, login, logout } = useAuth();
// Use authentication state and methods
};- Update
src/navigation/routes.ts:
export const routes = {
// Add new routes
NewFeature: {
name: 'NewFeature',
args: noArgs,
} as const,
};- Update navigation types in
src/navigation/routes.types.ts
For sensitive data like tokens:
import { secureStorage } from '#services/storage/secure-storage';
// Store sensitive data
await secureStorage.setItem('auth_token', token);
// Retrieve sensitive data
const token = await secureStorage.getItem('auth_token');For high-performance storage:
import { mmkv } from '#services/storage/mmkv-storage';
// Store data
mmkv.set('user_preferences', JSON.stringify(preferences));
// Retrieve data
const preferences = mmkv.getString('user_preferences');The project uses React Native Reanimated for smooth animations:
import Animated, { useSharedValue, withSpring } from 'react-native-reanimated';
const MyComponent = () => {
const scale = useSharedValue(1);
const handlePress = () => {
scale.value = withSpring(1.2);
};
return (
<Animated.View style={{ transform: [{ scale }] }}>
{/* Your content */}
</Animated.View>
);
};For optimized list performance:
import { FlashList } from '@shopify/flash-list';
const MyList = () => {
return (
<FlashList
data={data}
renderItem={renderItem}
estimatedItemSize={100}
/>
);
};The project includes built-in performance monitoring:
import { logger } from '#services/logging';
// Log performance metrics
logger.logEvent('screen_load_time', {
screen: 'HomeScreen',
loadTime: 150,
});The project includes comprehensive unit testing with Jest and React Native Testing Library:
# Run all tests
yarn test
# Run tests in watch mode
yarn test:watch
# Run tests with coverage
yarn test:coverage- Unit Tests: Custom hooks, Redux slices, and utility functions
- Component Tests: UI component testing with React Native Testing Library
- API Tests: RTK Query endpoint testing
- Mocking: Comprehensive mocking for external dependencies
- Coverage: 70%+ code coverage requirement
src/
βββ features/
β βββ todos/
β βββ hooks/
β βββ __tests__/
β βββ use-todos.test.ts
βββ __tests__/
βββ setup.ts
# Check for linting issues
yarn lint
# Fix linting issues
yarn lint:fix
# Format code
yarn format
# Fix formatting issues
yarn format:fixThe project uses Biome for:
- Fast linting with TypeScript support
- Code formatting
- Import sorting
- Consistent code style
Follow the comprehensive development rules outlined in ai_articles/app_rules.md to maintain consistency and code quality:
- Feature-First Architecture: Organize code by business features
- UI Component Guidelines: Use Restyle for styling and follow component patterns
- State Management: Use Redux Toolkit and RTK Query patterns
- Testing Standards: Maintain 70%+ code coverage with comprehensive tests
- TypeScript Usage: Strict typing throughout the application
- Performance Optimization: Follow performance best practices
yarn start- Start the Expo development serveryarn ios- Run on iOS simulatoryarn android- Run on Android emulatoryarn web- Run on web browseryarn test- Run all testsyarn test:watch- Run tests in watch modeyarn test:coverage- Run tests with coverage reportyarn lint- Check for linting issuesyarn lint:fix- Fix linting issuesyarn format- Format codeyarn format:fix- Fix formatting issues
- iOS:
expo build:ios- Android:
expo build:android- Web:
expo build:webUpdate app.json for production settings:
{
"expo": {
"name": "Your App Name",
"slug": "your-app-slug",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
}
}
}- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Expo for the amazing development platform
- React Navigation for navigation
- Redux Toolkit for state management
- Restyle for styling
- React Native Reanimated for animations
If you have any questions or need help, please:
- Check the Issues page
- Create a new issue with detailed information
- Join our community discussions
Happy coding! π






