How yafa91/warascore works
Project type and purpose
• This is a cross-platform mobile app built with Expo and React Native (TypeScript).
• It uses file-based routing (under the app/ directory) to define screens for news, live scores, user profiles, settings, notifications, articles, and match details.
• Native / platform code lives under android/ and ios/ for bundling and low-level integrations.
File structure
• app/
– Holds route-based screens (tabs, dynamic parameters, layouts).
– Example: app/(tabs)/news.tsx, app/MatchDetailsScreen/[matchId].tsx
• components/
• context/ and utils/context/
– Context providers for favorites and theme.
• hooks/
• utils/
– Helpers for notifications, favorite persistence, network overlays.
• assets/ and constants/
• android/ & ios/
– Native projects, Gradle/Gradle-wrapper, Xcode project files, Podfiles.
README for additional insights
• Confirms Expo setup, commands for building/running on iOS/Android/emulator.
• Indicates the use of Expo’s file-based router.
• No backend code is present, so the app relies on external APIs/services.
Main components
a. Mobile App Client
– UI Layer: Screens (file-based routes), Custom Components, Assets.
– State Layer: React Contexts (FavoritesContext, ThemeContext), Hooks.
– Business Logic / Data Layer: utils for network requests, notifications, favorite logic.
– Routing Layer: Expo Router (file-based routing under app/).
b. Native Platform Integrations
– Android (Gradle build, native modules), iOS (Xcode, CocoaPods, native modules).
– Expo runtime bridging JS and native.
c. External Services
– RESTful sports data API (live scores, articles).
– Push notification service (Expo Notifications or FCM/APNs).
– (Optional) Authentication provider if login/signup uses OAuth or email.
Relationships and interactions
• UI screens dispatch actions or call hooks/contexts.
• Contexts manage shared state (favorites, theme) and persist via AsyncStorage or native modules.
• Data layer functions invoke REST API endpoints to fetch match details, news, etc.
• Notification utilities register with Expo’s notification SDK and external APNs/FCM.
• Native modules (camera, storage, notifications) are exposed to JS via Expo’s bridge.
Architectural patterns & design principles
• Layered architecture: Presentation (UI) → State (Context/Hooks) → Data (utils/API) → Native Integration.
• File-based routing enforces clear mapping between URLs/paths and screen components.
• Separation of concerns: UI components vs. business logic vs. platform code.
• Reusability: Centralized components, hooks, and contexts.
Detail
• How contexts wrap the entire app (e.g., ThemeContext at root layout).
• Build flow: TSX → JS bundle → Expo runtime → Android/iOS deployment.
• Both JS-side and native-side modules where necessary.