How pkwmapp/pkwmtt-frontend-mobile works
Project type and purpose
• This is a React Native mobile application (“PKWM App”) written in TypeScript.
• It’s a standalone front-end that runs on both Android and iOS, consumes a timetable backend API, and exposes features such as calendar integration, localization, and in-app settings.
Main components of the system
A. Mobile Platforms & Native Shell
• Android (MainActivity.kt, Gradle build scripts)
• iOS (AppDelegate.swift, Xcode project files)
B. React Native Runtime & Bundler
• JS engine (Hermes/JavaScriptCore)
• Metro Bundler (development only)
C. Entry Point & Navigation
• index.js → App.tsx → tabNavigator.tsx (React Navigation)
D. UI Layer
• src/app – feature screens (Auth, Main, Tabs)
• src/components – reusable UI & modals
• src/styles – global + UI-specific styles
E. State Management
• React Hooks + Zustand-style stores in src/store (authStore, settingsStore)
F. Business Logic / Services
• src/services/api.ts – HTTP client to PKWMTT-backend
• CalendarService – native calendar integration
• TimetableService, SettingsService, VersionService
G. Shared Infrastructure
• src/constants – app-wide constants
• src/translation – i18n/locales, react-native-localize integration
H. Tests & Mocks
• __tests__ & __mocks__ (Jest + React Native Testing Library)
I. DevOps / CI
• GitHub Actions workflows (CICD, testdeploy)
• Docker referenced (containerized CI; no Dockerfile here)
Relationships & data flows
1. User taps UI → React Native UI components render via App.tsx + tabNavigator
2. Navigation handler invokes screen logic (e.g. TimetableScreen)
3. Screen calls Hooks or Service layer
• Services may read/write local device resources via Native Modules
– AsyncStorage, device info, calendar API
• Services call api.ts to perform HTTP(s) requests to external PKWMTT-backend
4. Store updates (authStore or settingsStore) and triggers UI re-render
5. i18n module resolves translations and date/number formatting
Architectural patterns & design principles
• Feature-based folder structure (group screens, services, components by domain)
• Separation of concerns:
• UI vs. state vs. business logic vs. data access
• Native modules isolated under services/calendar & core api.ts
• Unidirectional data flow: components → services → stores → UI
• Dependency Injection via module imports; no global singletons outside stores
Final recommendations
• Layers: Device OS, RN runtime, JS app structure, external services.
• Be precise with folder/module names and data flows.
• Avoid over-splitting—group related screens/components under “UI Layer.”