How stratezone/mobile works
Project type and purpose
• This is a mobile-only, full-stack client application built with Expo (React Native) using file-based routing.
• Its purpose is to let users browse and book “tables” (game appointments), manage profiles (including payments and history), participate in a community forum, exchange vouchers, view tournaments, and receive notifications.
Key architectural elements revealed by the file tree
• Top-level “app” folder uses Expo’s file-based router for navigation. It contains a tab navigator (“app/(tab)”), with subfolders for each tab:
• appointment, auth, clause, community, product, profile, tournament, notification
• Reusable UI is in “components/…” (buttons, cards, dialogs, bottom sheets, etc.).
• Global state is handled via React Context providers (“context/auth-context.tsx”, “context/select-table.tsx”).
• API requests are encapsulated in “helpers/api-requests.ts”.
• Configuration values are in “config/index.ts”; type definitions under “constants/types”.
• Assets (fonts, images) are under “assets/…”.
• Native projects for iOS/Android are managed by Expo (ios/…, metro.config.js, app.json, etc.).
Main components
A. Mobile App (Expo JS Runtime)
• File-based Router → Tab Navigator
• Tab screens: AppointmentTab, AuthTab, ClauseTab, CommunityTab, ProductTab, ProfileTab, TournamentTab, NotificationTab
• Shared UI Component Library (components/)
• State Management Layer (AuthContext, SelectTableContext)
• API Service Layer (helpers/api-requests.ts + config)
• Style System (nativewind/tailwind.config.js + global.css)
• Asset Store (fonts, images)
• Third-party SDKs: Expo modules (Notifications, Secure Storage, etc., if used)
B. External Systems
• Backend API Service (REST or GraphQL)
• Authentication Provider (OAuth / custom JWT)
• Payment Gateway (in-app purchase / external payment API)
• Push Notification Service (Expo Push, FCM / APNs)
Relationships & interactions
• Router directs user events to Screen Components.
• Screen Components call into Context or directly invoke API Service to fetch/post data.
• Context providers maintain auth state, selected table, and expose that to UI.
• API Service uses config base URL to communicate with the backend (Authentication, Table booking, Community threads, Transactions, etc.).
• Backend returns JSON, which the service layer normalizes (using TypeScript types) and passes back to contexts or screens.
• Asset Store provides static resources for UI.
• Expo runtime bundles all JS/TS and serves it to the device via Metro bundler, enabling hot reload in development.
Architectural patterns & design principles
• Separation of concerns:
• Navigation (file-based router)
• Presentation (screens + reusable components)
• Stateful logic (React Context)
• Data access (API layer)
• File-based routing enforces a 1:1 mapping of files to navigation routes.
• Type safety through TypeScript types in “constants/types”.
• Theming/styling via Tailwind (nativewind) and global style guide (UIStyleGuide).
• Modular assets: grouping of images and fonts.