A modern, scalable React Native trivia game built with the latest technologies and best practices.
- Framework: Expo + Expo Router
- State Management: Zustand
- Data Fetching: TanStack Query + Axios
- Styling: NativeWind (Tailwind CSS for React Native)
- Language: TypeScript
- Navigation: Expo Router (file-based routing)
βββ app/ # Expo Router pages
β βββ _layout.tsx # Root layout
β βββ auth/ # Authentication pages
β β βββ login.tsx
β β βββ register.tsx
β βββ tabs/ # Main app tabs
β βββ index.tsx # Game screen
β βββ leaderboard.tsx
β βββ settings.tsx
βββ components/ # Reusable components
β βββ ui/ # Base UI components
β β βββ Button.tsx
β β βββ Card.tsx
β β βββ Input.tsx
β βββ game/ # Game-specific components
β β βββ QuestionCard.tsx
β β βββ AnswerButton.tsx
β β βββ ProgressBar.tsx
β βββ utils/ # Utility components
βββ stores/ # Zustand stores
β βββ authStore.ts
β βββ gameStore.ts
β βββ settingsStore.ts
βββ hooks/ # Custom hooks
β βββ useAuth.ts
β βββ useGame.ts
βββ services/ # API services
β βββ apiClient.ts
β βββ authService.ts
β βββ mockService.ts
βββ types/ # TypeScript types
β βββ auth.ts
β βββ game.ts
βββ constants/ # App constants
βββ Colors.ts
βββ Styles.ts
βββ GameConfig.ts
- authStore: User authentication state
- gameStore: Game state and history
- settingsStore: App settings and preferences
- Automatic caching and synchronization
- Background refetching
- Optimistic updates
- Error handling and retry logic
- Utility-first CSS approach
- Consistent design system
- Responsive design
- Dark mode support
- Secure login/register flow
- Token-based authentication
- Automatic token refresh
- Persistent sessions
- Multiple difficulty levels
- Category-based questions
- Real-time scoring
- Progress tracking
- Game history
- Modern, clean design
- Smooth animations
- Responsive layout
- Accessibility support
- Loading states
- Node.js 18+
- Expo CLI
- iOS Simulator (for iOS development)
- Android Studio (for Android development)
# Install dependencies
npm install
# Start development server
npm start
# Run on iOS
npm run ios
# Run on Android
npm run android- TypeScript for type safety
- ESLint for code quality
- Prettier for formatting
- Husky for git hooks
- Login: Email/password authentication
- Register: New user registration
- Demo Login: Quick access for testing
- Game: Interactive trivia gameplay
- Leaderboard: Player rankings
- Settings: App configuration
# API Configuration
EXPO_PUBLIC_API_URL=https://your-api-url.com
EXPO_PUBLIC_API_TIMEOUT=10000Custom colors and utilities defined in tailwind.config.js
# Build for iOS
expo build:ios
# Build for Android
expo build:android
# Build for Web
expo build:web- Configure app.json with proper bundle identifiers
- Build production version
- Submit to App Store/Google Play
npm testnpm run e2e- Lazy loading of components
- Image optimization
- Bundle splitting
- Memory management
- Crash reporting
- Performance metrics
- User analytics
- Secure token storage
- API request validation
- Input sanitization
- HTTPS enforcement
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
MIT License - see LICENSE file for details
- Expo team for the amazing framework
- React Native community
- Open source contributors
Built with β€οΈ using modern React Native practices