How alokinfilon/trackmate_frontend- works
Purpose and Runtime
TrackMate is a React Native mobile travel assistant for destination discovery, trip/bookings tracking, photo-memory collections, and profile/settings management. JavaScript/JSX runs in the React Native runtime, bundled by Metro; native Android and iOS hosts embed the application. Key entry points: index.js, App.jsx, android/app/src/main/java/com/trackmate/MainApplication.kt, and ios/trackMate/AppDelegate.swift.
Application Composition
App.jsx is the top-level composition boundary, expected to install shared providers and navigation. Cross-cutting application state is separated into React contexts for theme, language, authentication, and notifications:
• src/context/AuthContext.js
• src/context/ThemeContext.js
• src/context/LanguageContext.js
• src/context/NotificationContext.js
Theme tokens and translations support dynamic appearance and localized UI at src/theme/theme.js and src/translations/index.js.
Navigation and Session Flow
Navigation is centralized under React Navigation. src/navigation/RootNavigator.jsx governs top-level route selection, including onboarding/authenticated boundaries; src/navigation/MainTabNavigator.jsx owns the primary post-login tab experience. Authentication UI flows through src/screens/login/index.jsx and src/screens/signup/index.jsx, with session/API interaction delegated to src/services/authService.js.
Domain State and Backend Boundary
Redux-style store slices model core client state for authentication, profile, and trips:
• src/store/index.js
• src/store/slices/authSlice.js
• src/store/slices/tripsSlice.js
Network access is intentionally behind the services layer: src/services/apiClient.js, src/services/httpService.js, and src/services/endpoints.js. Screens and hooks should consume this boundary rather than directly issuing HTTP requests. Local persistence is isolated in src/utils/storage.js.
Primary Product Flows
Home discovery presents categories, promotions, search, and destination cards, then routes into place detail and trip planning: src/screens/home/index.jsx, src/screens/place-detail/index.jsx. Trip lifecycle/dashboard presentation is handled in src/screens/dashboard/index.jsx and src/screens/dashboard/TripDashboardList.jsx.
Memory management is a self-contained feature area: src/screens/ImageUploadPage/index.jsx coordinates image upload, collections, collection detail, and an image-viewer modal. Its component decomposition provides a boundary for camera/gallery integration and trip-associated media:
• src/screens/ImageUploadPage/components/ImageUploadView/index.js
• src/screens/ImageUploadPage/components/CollectionsListView/index.js
• src/screens/ImageUploadPage/components/ImageViewerModal/index.js
Profile and Preference Subsystem
src/screens/profile/index.jsx is the settings hub, which routes to distinct preference/account surfaces. User-profile state is represented by src/store/slices/profileSlice.js; appearance and language settings connect to their corresponding providers. Account security, billing, notification settings, and travel preferences are organized beneath src/screens/profile/screens/.
Notifications and Native Infrastructure
Firebase Cloud Messaging is configured natively on Android through android/app/google-services.json and accessed from the JS service boundary via src/services/fcmService.js and src/services/notificationService.js. Android build/manifest integration resides at android/app/build.gradle and android/app/src/main/AndroidManifest.xml; iOS dependency/native project configuration resides at ios/Podfile and ios/trackMate.xcodeproj/project.pbxproj. Bundled fonts and image assets support the design system at assets/fonts, src/assets/images, and android/app/src/main/assets/fonts.
Components 20
Runtime hosts
- Android host · Embeds the React Native application and native FCM setup.
android/app/src/main/java/com/trackmate/MainApplication.kt - iOS host · Embeds the React Native application.
ios/trackMate/AppDelegate.swift - JS entry
index.js
App shell & state
- App composition · Installs shared providers and navigation.
App.jsx - Shared contexts · Authentication, theme, language, and notification state.
src/context/AuthContext.js - Theme & translations
src/theme/theme.js - Client store · Owns auth, profile, and trip slices.
src/store/index.js - Root navigation · Selects onboarding/authenticated route boundaries.
src/navigation/RootNavigator.jsx - Main tabs · Primary post-login experience.
src/navigation/MainTabNavigator.jsx
Product experiences
- Login & signup
src/screens/login/index.jsx - Discovery & planning · Searches destinations and enters trip planning.
src/screens/home/index.jsx - Trip dashboard · Presents the trip lifecycle and dashboards.
src/screens/dashboard/index.jsx - Memory collections · Coordinates uploads, collections, and image viewing.
src/screens/ImageUploadPage/index.jsx - Profile & preferences · Routes to account and travel preference surfaces.
src/screens/profile/index.jsx
Services & integrations
- Auth service
src/services/authService.js - API service boundary · Centralizes network access for screens and hooks.
src/services/apiClient.js - Local persistence
src/utils/storage.js - Notification services · Bridges push messaging into the JavaScript app.
src/services/fcmService.js - Remote backend
- Firebase Cloud Messaging
Connections 24
- Android host → JS entry: hosts bundle
- iOS host → JS entry: hosts bundle
- JS entry → App composition: mounts
- App composition → Shared contexts: installs
- App composition → Root navigation: renders
- Shared contexts → Theme & translations: applies
- Shared contexts → Client store: coordinates state
- Root navigation → Login & signup: unauthenticated flow
- Root navigation → Main tabs: authenticated flow
- Main tabs → Discovery & planning: tab route
- Main tabs → Trip dashboard: tab route
- Main tabs → Memory collections: tab route
- Main tabs → Profile & preferences: tab route
- Login & signup → Auth service: sign in / sign up
- Auth service → API service boundary: uses
- Auth service → Local persistence: persists session
- Discovery & planning → API service boundary: loads destinations
- Trip dashboard → Client store: reads trip state
- Memory collections → API service boundary: uploads and manages media
- Profile & preferences → Client store: reads profile state
- API service boundary → Remote backend: HTTP requests
- Notification services → Firebase Cloud Messaging: receives push
- Android host → Firebase Cloud Messaging: native configuration
- Shared contexts → Notification services: notification state