How kirbi96/appleoffortune works
Project type and purpose
• This is a React Native mobile application (“appleoffortune”), a slot-machine game targeting both Android and iOS.
• It contains platform-specific native projects (android/, ios/) plus a shared JavaScript/TypeScript codebase (src/).
File structure
• Top-level:
• android/ – Android native project (Gradle build scripts, Java entry points, resource folders).
• ios/ – iOS native project (Xcode workspace, Objective-C entry points, asset catalogs).
• src/ – Shared React Native code:
· components/ – reusable UI widgets
· screens/ – screen components (Home, etc.)
· static/ – style definitions, constants, text
· utils/ – helper functions (responsiveFontSize, pluralize)
• index.js – JS entry point that registers the root App component.
• babel.config.js, metro.config.js – bundler/transpiler configuration.
• __tests__/ – unit tests (Jest).
• No separate backend—game logic and state live entirely in the client.
README
• Confirms the purpose: “apple of fortune slot game.”
• No further architectural notes, so infer architecture from code organization.
a. Main components
• Presentation Layer (React Native JS)
• Game Logic Layer (stateful components + utils)
• Native Bridge/Runtime (Metro Bundler + React Native runtime)
• Platform Runtimes (Android JVM + iOS Objective-C/Swift)
• Build Toolchain (Gradle for Android, Xcode/Pods for iOS)
• Testing Layer (Jest)
b. Relationships & interactions
• Presentation Layer → Native Bridge/Runtime → Platform Runtimes
• Build Toolchain → Native Projects (android/, ios/)
• Metro Bundler sits between JS code and Native Bridge
c. Architectural patterns
• Component-based UI (React)
• Single codebase for cross-platform UI/business logic
• Platform adapters (native entry points in MainActivity.java/AppDelegate)
d. Key technologies
• React Native
• Metro Bundler
• Babel
• Android (Gradle, Java)
• iOS (Xcode, Objective-C, CocoaPods)
• Jest (testing)
Detailed call-outs
• Call out index.js as the bootstrap.
• MainActivity.java/AppDelegate.m as boundary between JS and native.
• Static/ folder as a resource bundle consumed by code.
• __tests__ off to the side illustrating unit test coverage.