How codergon/paletti works
Project Type and Purpose
• Project Type: A React Native mobile application.
File Structure
• Top-level Directories: The file tree shows separate directories for iOS and Android platform-specific implementations along with a core “src” directory for the shared React Native front-end code.
• Key Directories:
• "src": Contains TypeScript/React Native code including all screens (Splash, Eyedropper, Palettes, Comparator, Settings), components, hooks, context, utilities, and navigation.
• "ios" & "android": These include native code for iOS and Android, with iOS having specialized modules like PixelColor and PaletteFrameProcessorPlugin which integrate with the front-end.
• Configuration files (babel.config.js, metro.config.js, package.json, etc.) indicate integration with native libraries (e.g., react-native-reanimated, vision-camera).
README for Additional Insights
• It specifically lists the major screens and how they tie into user flows—starting from the Splash screen (for permissions) through to the main app interfaces (Eyedropper, Palettes, Comparator, Settings).
a. Main Components:
• Front-end Application:
• Navigation and Routing: Represented by src/App.tsx and src/navigation.
• Screens: Splash, Eyedropper, Palettes, Comparator, and Settings.
• UI Components: Modularized components under “src/components” (common UI elements like AppStatusBar, Loader, AnimatedStatusBar, etc.).
• Context Providers: AppContext, LogicContext, SettingsContext, ShareContext for global state management.
• Native Integrations:
• iOS Specific: Components like PixelColor, PaletteFrameProcessorPlugin (implemented in Swift/Objective-C), bridged via the bridging header.
• Android Specific: The Android folder contains manifest, Gradle configurations and similar native setup.
• External Libraries and Configurations:
• react-native-reanimated, react-native-vision-camera, and UIImageColors (as mentioned in the README and Podfile).
b. Relationships and Interactions:
• Flow of Data: From the camera feed (via native frame processor plugins) into the front-end JS code.
• Communication: The native modules communicate with the React Native layer through worklets or JS wrappers (e.g., getColor in src/utils).
• Navigation: The main App component routes to different screens depending on user permissions and interactions.
• Shared State: Using Context providers for passing application data among various screens and components.
c. Architectural Patterns:
• Separation of Concerns: Clear division between view (screens/components in src), state management (context providers), and native functionality (iOS & Android directories).
• Integration Pattern: Use of React Native to bridge between JS and native code using modules (e.g., PixelColor, getColor).
• Modularity and Reusability: Components, hooks, and utility functions are modularized to promote code reuse.
d. Relevant Technologies and Frameworks:
• Technologies: React Native, TypeScript, JavaScript.
• Frameworks/Libraries: react-native-reanimated, react-native-vision-camera, and various native modules.
• Native Code: Swift, Objective-C (iOS) and Java (Android).
Elements
• The routing logic between different screens (e.g., from Splash to Eyedropper).
• For the front-end components versus utility modules and configuration files.