How grantalba/pioneer-movie-expo works
Project Type & Purpose
• This is a React Native mobile application built with Expo, using file-based routing (Expo Router) to implement a movie browsing UI. It fetches data from the external TMDb API, displays lists of movies, and navigates to detail screens with trailers and similar recommendations.
High-Level Architecture Components
a. Frontend (Mobile Client)
• Expo runtime (supports iOS, Android, Expo Go)
• Expo Router (file-based navigation layer)
• React Native screens under app/ (Splash, Home, Details)
• UI Components under components/ (e.g., MovieList, TopRatedMovie)
b. API Service Layer
• hooks/useApi.ts wraps Axios for HTTP calls
• Environment config (.env, EXPO_PUBLIC_TMDB_AUTH_KEY)
c. External Service
• TMDb REST API (movies, trailers, similar content)
d. Build & Configuration
• Babel (babel.config.js), TypeScript config (tsconfig.json), ESlint/Prettier
• Reset script (scripts/reset-project.js)
Relationships & Data Flow
• Screens invoke custom hooks (useApi) → Axios calls to TMDb → JSON responses.
• Data flows back through hooks → passed to UI components (MovieList, Each, TopRatedMovie).
• Navigation actions (Expo Router) link screens; tapping a movie card triggers route to /details/[id].
Architectural Patterns & Principles
• File-based routing: Each file in app/ corresponds to a navigation route.
• Hooks for data abstraction: useApi centralizes HTTP logic; theme hooks centralize styling logic.
• Separation of concerns:
• Presentation (screens, components)
• Business logic / data access (hooks)
• Configuration & constants (environment vars, constants/)