A modern React Native movie discovery app built with Expo, featuring The Movie Database (TMDB) integration, favorites management, and beautiful UI components.
- π― Movie Discovery: Browse popular and trending movies
- π Smart Search: Find movies with real-time search functionality
- β€οΈ Favorites Management: Save and manage your favorite movies
- π Cast Profiles: Detailed actor/actress information with biography and filmography
- π Dark/Light Theme: Automatic theme switching support
- π± Cross-Platform: Works on iOS, Android, and web
- β‘ Performance Optimized: Built with React Query for efficient data caching
- π¨ Modern UI: Beautiful interface using Gluestack UI components
To use the movie discovery features, you need to obtain a TMDB API key:
- Go to The Movie Database (TMDB)
- Create an account or sign in
- Navigate to Settings > API
- Request an API key (choose "Developer" option)
- Fill out the required information
Create a .env file in the project root and add:
EXPO_PUBLIC_TMDB_API_KEY=your_actual_api_key_hereImportant:
- The
.envfile is gitignored for security - Never commit your actual API key to version control
- If you prefer, you can directly edit
lib/api-config.tsand replaceYOUR_TMDB_API_KEY_HEREwith your actual API key
- Node.js (version 18 or higher)
- npm or yarn
- Expo CLI (
npm install -g @expo/cli) - For iOS development: Xcode (macOS only)
- For Android development: Android Studio with SDK
- Watchman (recommended for macOS)
- Install Node.js: Download from nodejs.org
- Install Watchman (macOS only):
brew install watchman
- Install Expo CLI:
npm install -g @expo/cli
-
Clone the repository:
git clone <repository-url> cd martaflix
-
Install dependencies:
npm install
-
Set up environment variables:
cp .env.example .env # Edit .env and add your TMDB API key -
Start the development server:
npm start
-
Prebuild native projects (required for simulators):
npx expo prebuild --clean
-
Run on platforms:
- iOS Simulator:
npm run ios - Android Emulator:
npm run android
- iOS Simulator:
- Web Browser:
npm run web - Physical Device: Use Expo Go app and scan the QR code
# Run unit tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage- Zustand: Chosen for its simplicity and excellent TypeScript support. Provides clean, minimal boilerplate for global state management. Stores are organized in the
store/directory with MMKV persistence. - React Query: Used for server state management, providing automatic caching, background updates, and optimistic updates.
- Expo Router: File-based routing system that provides type-safe navigation and follows modern React patterns.
- Gluestack UI: Modern component library with excellent customization and accessibility features.
- NativeWind: Tailwind CSS for React Native, providing utility-first styling with theme support.
- MMKV: Fast, secure key-value storage for persisting favorites and user preferences.
- Async Storage: Backup storage solution for broader compatibility.
- Modular Architecture: Components are broken down into single-responsibility units
- Centralized State Management: Global stores organized in
store/directory with corresponding hook wrappers inhooks/ - Absolute Imports: Clean import paths using
@/prefix - Type Safety: Comprehensive TypeScript types for all data structures
- Theme Store (
store/theme-store.ts): Manages light/dark mode with system theme detection and MMKV persistence - Favorites Store (
store/favorites-store.ts): Handles movie favorites with optimistic updates and persistent storage - Hook Wrappers: Each store has a corresponding hook in
hooks/for better abstraction (e.g.,useTheme(),useFavorites()) - Testing: Comprehensive unit tests for all stores in
store/__tests__/
- API Reliability: Assumed TMDB API has good uptime and consistent response format
- Image Availability: Assumed movie posters and backdrops are generally available from TMDB
- Network Connectivity: App assumes basic internet connectivity for core functionality
- Device Capabilities: Targeted modern devices with adequate memory and processing power
- User Behavior: Assumed users will primarily browse and save favorites rather than detailed movie management
- Platform Support: Focused on iOS and Android with web as bonus platform
- Challenge: Implementing consistent dark/light theme across all components
- Solution: Created centralized theme store with Zustand and used NativeWind's dark mode utilities
- Challenge: Movie posters loading slowly and consuming memory
- Solution: Implemented proper image caching with Expo Image and skeleton loading states
- Challenge: Maintaining favorites across app restarts
- Solution: Integrated MMKV with Zustand middleware for automatic persistence
- Challenge: Avoiding excessive API calls during search
- Solution: Implemented custom debounce hook with 300ms delay
- Challenge: Testing components with API dependencies and navigation
- Solution: Created comprehensive mocks and used React Native Testing Library best practices
- β Movie Listing: Display popular and trending movies with posters
- β Movie Details: Show detailed information including cast, overview, and ratings
- β Search Functionality: Real-time movie search with debouncing
- β Favorites Management: Add/remove movies from favorites with persistence
- β Responsive Design: Works across different screen sizes
- β Navigation: Intuitive tab-based navigation structure
- β Error Handling: Graceful error states and user feedback
- β Loading States: Skeleton loaders and activity indicators
- β TypeScript: Fully typed codebase with strict configuration
- β State Management: Zustand for global state, React Query for server state
- β Component Architecture: Modular, reusable components under 80 lines
- β Testing: Unit tests for utilities and complex components
- β Code Quality: ESLint configuration with consistent formatting
- β Theme Support: Complete dark/light mode implementation
- β Offline Capabilities: Favorite movies available offline
- β Performance Optimization: Image caching, memo usage, and query optimization
- β Accessibility: ARIA labels and native accessibility props
- β Animation: Smooth transitions with React Native Reanimated
- β Web Support: Full web compatibility with responsive design
- β Test Coverage: Comprehensive unit test suite with coverage reporting
- β Error Boundaries: Graceful error handling throughout the app
- β
Cast Detail Screen: Interactive cast member profiles with comprehensive actor/actress information
- Biography, personal details (birth date, place of birth, known for department)
- Movie filmography with "Known For" section showing their popular movies
- Seamless navigation from movie details to cast profiles and back to movies
- Custom loading skeleton component for optimal user experience
- Consistent card heights and proper spacing in horizontal movie lists
- Full theme support and accessibility features throughout
Total Estimated Time: ~13 hours
- Initial Setup & Configuration: 2 hours
- API Integration & Types: 2 hours
- Core Components Development: 1 hour
- Navigation & Routing: 2 hours
- State Management Setup: 1 hour
- UI/UX Polish & Theming: 2 hours
- Testing Implementation: 2 hours
- Documentation & Refinement: 1 hour
βββ api/ # API functions and TMDB integration
βββ app/ # Expo Router screens and navigation
β βββ (tabs)/ # Tab-based navigation screens
β βββ movie/ # Movie detail screens
β βββ cast/ # Cast detail screens
βββ components/ # Reusable UI components
β βββ ui/ # Core UI components (buttons, inputs)
β βββ *.tsx # Feature-specific components
βββ store/ # Zustand stores for global state management
β βββ favorites-store.ts # Favorites management with MMKV persistence
β βββ theme-store.ts # Theme management with MMKV persistence
β βββ __tests__/ # Store unit tests
βββ hooks/ # Custom React hooks and store wrappers
βββ lib/ # Utilities, storage, and configuration
βββ types/ # TypeScript type definitions
βββ constants/ # App constants and configuration
βββ examples/ # Perfect styling examples and patterns
βββ assets/ # Images, fonts, and static assets
- Framework: Expo (React Native)
- Language: TypeScript
- UI Library: Gluestack UI
- Styling: NativeWind (Tailwind CSS for RN)
- Navigation: Expo Router
- State Management: Zustand + React Query
- Storage: MMKV + Async Storage
- Testing: Jest + React Native Testing Library
- API Client: Axios
- Icons: Lucide React Native
- Cursor: Cursor rules to keep maintain the knowledge of the project
# Development
npm start # Start Expo development server
npx expo prebuild --clean # Generate native projects (required for simulators)
npm run ios # Run on iOS simulator (after prebuild)
npm run android # Run on Android emulator (after prebuild)
npm run web # Run in web browser
# Testing
npm test # Run unit tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Generate coverage report
# Quality
npm run lint # Run ESLintThis project is licensed under the MIT License.
Built with β€οΈ using React Native and Expo