How dangtrungdev113999/shoes-code works
Project Type & Purpose
• This is a cross‐platform mobile application built with React Native.
• The purpose of the app seems to be centered on a shoe (and slipper) related domain, including features like user authentication, favourites, and product display (e.g., Shoes and Slippers) along with user settings.
• The native directories (android and ios) and the extensive src directory (with components, containers, modules, and routes) also indicate a well‐structured, feature-rich application that leverages Redux for state management and a modular user interface.
File Structure
• Top-Level Organization:
• Native Code Folders: “android” and “ios” contain platform-specific configurations and entry points.
• “src” Folder: The majority of your application’s logic, UI, and state management reside here.
• “assets”: Contains fonts and images used across the app.
• “components” & “containers”: These folders define the UI components (presentational elements) and higher-level screens or views (like Auth, Favourite, Settings, Shoes, Slippers, User).
• “modules”: Each domain (Auth, Favourite, Settings, Shoes, Slippers, User) has its own folder for Redux actions, reducers, selectors, and thunks, suggesting a Redux-based architecture.
• “routes”: Contains React Navigation stacks and drawers which outline the app’s navigation flow.
• “utils” and “config”: Hold utilities, constants, and theming, which are critical for building the UI consistently.
a. Main Components to Include:
• Native Platforms: Android and iOS directories should be shown as the entry point for the mobile apps. These interact with the shared JavaScript business logic.
• JavaScript Entry Point: “index.js” that initializes the React Native app.
• UI/Presentation Layer: The “src/components” folder for reusable UI components.
• Container/Screen Components: The “src/containers” that implement the views for Auth, Favourite, Settings, Shoes, Slippers, and User.
• Navigation System: Under “src/routes” which defines AuthStack, MainDrawer, and nested stacks/tabs (ShoesStack, SlippersStack, etc.).
• State Management Layer: The “src/modules” directory that encapsulates Redux actions, reducers, selectors, and thunks for each domain.
• Global App Configuration: “src/config” and “assets” for theming, constants, fonts, and images.
• Utility Layer: “src/utils” for helper functions, translations, and data models.
b. Relationships & Interactions:
• The native layer (Android/iOS) boots up the app and loads “index.js.”
• “index.js” initializes the navigation system. Navigation components then route users into various container views.
• Each container links its view to domain-specific modules (Redux modules) that manage the state, execute network/API calls (visible in the “apis.ts” files), and handle business logic.
• Reusable UI components used within containers retrieve configuration and theme info from “src/config.”
• Supporting hooks under “src/hoocks” (likely “src/hooks”) interface with the application’s state and lifecycle events.
• Utility functions support translations and data transformation across the app.
c. Architectural Patterns & Principles:
• Separation of concerns is followed by clearly dividing UI (components & containers), business logic (modules with Redux patterns), and configuration/utilities.
• Modular architecture: Each domain (Auth, Shoes, etc.) has its own folder under “modules” and “containers,” making the system highly maintainable and scalable.
• Navigation: The use of stacks and drawers (under “src/routes”) indicates standard mobile navigation practices.
• Cross-platform: Shared JavaScript code across Android and iOS with native-specific folders for configurations.
d. Technologies & Frameworks:
• React Native: For developing cross-platform mobile applications.
• Redux (or a similar Flux pattern): Implied by the use of “actions,” “reducers,” “thunks,” and “selectors” in the modules.
• React Navigation: Evidenced by the structure found in the “src/routes” directory.
• Language/TypeScript: Noted by files like “.ts” and “.tsx” in the project.
• Additional tools: ESLint, Prettier for code quality, and Babel with metro.config.js for bundling.
Detailed Implementation Steps
• For each navigation branch, indicate container components (e.g., Auth, Shoes, Slippers, Favourite, Settings, User) and note that these are stored in the “src/containers” directory.
• Lastly, add “Config & Utilities” which interact with both UI components and Redux modules as needed.