# dangtrungdev113999/shoes-code architecture

> Architecture diagram of the GitHub repository dangtrungdev113999/shoes-code, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dangtrungdev113999/shoes-code
- Repository: https://github.com/dangtrungdev113999/shoes-code

## Overview

##### 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.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Native Layer
    subgraph "Native Layer"
        Android["Android (Native)"]:::native
        iOS["iOS (Native)"]:::native
    end

    %% JavaScript Entry Point
    Entry["index.js (Entry Point)"]:::entry

    %% Navigation System
    Navigation["Navigation System (Routes)"]:::nav

    %% Container Views
    subgraph "Container Views"
        Auth["Auth Screen (src/containers)"]:::container
        Shoes["Shoes Screen (src/containers)"]:::container
        Slippers["Slippers Screen (src/containers)"]:::container
        Favourite["Favourite Screen (src/containers)"]:::container
        Settings["Settings Screen (src/containers)"]:::container
        User["User Screen (src/containers)"]:::container
    end

    %% State Management Layer
    ReduxModules["Redux Modules (State Management)"]:::redux

    %% UI/Presentation Layer
    UIComponents["Reusable UI Components (Components)"]:::ui

    %% Global Configuration & Assets
    Config["Global Config & Assets"]:::config

    %% Utility Functions
    Utilities["Utility Functions"]:::util

    %% Relationships
    Android -->|"bootstraps"| Entry
    iOS -->|"bootstraps"| Entry
    Entry -->|"initializes"| Navigation

    Navigation -->|"navigate"| Auth
    Navigation -->|"navigate"| Shoes
    Navigation -->|"navigate"| Slippers
    Navigation -->|"navigate"| Favourite
    Navigation -->|"navigate"| Settings
    Navigation -->|"navigate"| User

    Auth -->|"dispatchAction"| ReduxModules
    Shoes -->|"dispatchAction"| ReduxModules
    Slippers -->|"dispatchAction"| ReduxModules
    Favourite -->|"dispatchAction"| ReduxModules
    Settings -->|"dispatchAction"| ReduxModules
    User -->|"dispatchAction"| ReduxModules

    Auth -->|"renders"| UIComponents
    Shoes -->|"renders"| UIComponents
    Slippers -->|"renders"| UIComponents
    Favourite -->|"renders"| UIComponents
    Settings -->|"renders"| UIComponents
    User -->|"renders"| UIComponents

    Config -.->|"providesTheme"| UIComponents
    Config -.->|"providesConstants"| ReduxModules

    Utilities -.->|"helperFunctions"| UIComponents
    Utilities -.->|"helperFunctions"| ReduxModules

    %% Click Events
    click Android "https://github.com/dangtrungdev113999/shoes-code/tree/master/android"
    click iOS "https://github.com/dangtrungdev113999/shoes-code/tree/master/ios"
    click Entry "https://github.com/dangtrungdev113999/shoes-code/blob/master/index.js"
    click Navigation "https://github.com/dangtrungdev113999/shoes-code/tree/master/src/routes"
    click Auth "https://github.com/dangtrungdev113999/shoes-code/tree/master/src/containers"
    click Shoes "https://github.com/dangtrungdev113999/shoes-code/tree/master/src/containers"
    click Slippers "https://github.com/dangtrungdev113999/shoes-code/tree/master/src/containers"
    click Favourite "https://github.com/dangtrungdev113999/shoes-code/tree/master/src/containers"
    click Settings "https://github.com/dangtrungdev113999/shoes-code/tree/master/src/containers"
    click User "https://github.com/dangtrungdev113999/shoes-code/tree/master/src/containers"
    click ReduxModules "https://github.com/dangtrungdev113999/shoes-code/tree/master/src/modules"
    click UIComponents "https://github.com/dangtrungdev113999/shoes-code/tree/master/src/components"
    click Config "https://github.com/dangtrungdev113999/shoes-code/tree/master/src/config"
    click Utilities "https://github.com/dangtrungdev113999/shoes-code/tree/master/src/utils"

    %% Styles
    classDef native fill:#ffadad,stroke:#333,stroke-width:2px;
    classDef entry fill:#ffd6a5,stroke:#333,stroke-width:2px;
    classDef nav fill:#fdffb6,stroke:#333,stroke-width:2px;
    classDef container fill:#caffbf,stroke:#333,stroke-width:2px;
    classDef redux fill:#9bf6ff,stroke:#333,stroke-width:2px;
    classDef ui fill:#a0c4ff,stroke:#333,stroke-width:2px;
    classDef config fill:#bdb2ff,stroke:#333,stroke-width:2px;
    classDef util fill:#ffc6ff,stroke:#333,stroke-width:2px;
```
