How martymfly/expo-file-manager works
Main Components
• App Entry Point: At the center is the App.tsx file which initializes the application.
• Navigation Layers: The /navigation folder contains various navigators (MainNavigator, HomeStackNavigator, SettingsStackNavigator) that define the screen routing logic.
• UI Screens: Under the /screens folder are specific pages such as Browser, FileTransfer, ImageGalleryView, LockScreen, Main, MiscFileView, Settings, VideoPlayer, and Web. These represent the higher-level visual components of the application.
• UI & Reusable Components: The /components folder includes UI pieces like ActionSheet, a collection of Browser UI components (dialogs, file items, image selection components), and file viewers (e.g., PDFViewer). These are the building blocks used within screens.
• State Management / Features: The /features folder shows Redux-like slices (imagesSlice, snackbarSlice, tabbarStyleSlice, themeSlice) managing different parts of the application state. Also, store.ts is central to managing and wiring the global application state.
• External Patches & Configurations: The patches folder (for example, a patch for react-native-image-viewing) and various configuration files (.eslintrc, babel.config.js, tsconfig.json, etc.) represent non-business logic but are critical for build and runtime behavior.
Relationships and Interactions
• The App.tsx acts as the entry point that ties together the navigation setup, state management (Redux store, slices) and conditionally loads screens.
• Navigation components determine the flow between screens (e.g., from the Browser screen to FileTransfer or Settings), with navigators managing stacks and screen hierarchies.
• UI screens interact with Features (Redux slices) to fetch, manipulate, and display file and app state. Data flows from hooks and state management to screen components.
• Reusable components (in /components) are embedded within the screens and communicate with the state (via Redux or hooks) to reflect user actions (like downloading files, selecting images, etc.).
• Utility functions are used by both components and features to perform common operations.
• Integration with external systems (like file transfer over websockets) is indicated in the README and may be reflected as external service blocks along with the built-in Web Browser component.
Architectural Patterns
• Component-Based Architecture: The clear separation into screens, components, and feature slices implies a modular, reusable design.
• MV* Patterns: The “view” layer is built with React Native components; state is managed with Redux-like slices; and logic is abstracted into hooks.
• Navigation Patterns: Use of stack navigators indicates a typical mobile navigation flow.
• Separation of Concerns: The distinctions between UI components, state management, and utility functions ensure each module has a single responsibility.