# svnfrs/easy-laundry-react-native architecture

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

- Interactive diagram: https://gitdiagram.com/svnfrs/easy-laundry-react-native
- Repository: https://github.com/svnfrs/easy-laundry-react-native

## Overview

##### Main Components
- App Navigation & Routing: Show that the project’s entry point is the “app” directory which is organized by file-based routing. Clearly distinguish routes for authentication (login, otp, signup), guides, location, and the “tabs” section (with sub-components for cart, home, profile, and QR screens).
- UI Components: Represent the “components” folder which contains reusable UI elements like buttons, inputs, images, maps, etc. These components will be leveraged across multiple screens.
- State Management: Include the “contexts” folder (OrderContext, UserContext) which indicates the use of React’s context API for managing state across the app.
- Assets: Illustrate the “assets” folder, which houses fonts and images (including flags, sample images, and splash screens) used by the application.
- Configuration & Build Tools: Indicate that there are configuration files (babel.config.js, tailwind.config.js, tsconfig.json, eas.json) and build/deployment scripts which, although not part of the runtime architecture, are essential for the application’s tooling.

##### Relationships and Interactions
- Within the “(tabs)” group, break down further into its subdirectories (cart, home, profile, qr) where each tab represents a primary section of the app. For instance, the “home” tab has several sub-screens for details, payment, rinse, wash, and status flows.
- UI Components Interaction:
- UI component nodes (buttons, input fields, maps, navigation bars) to the screens where they are used. For example, illustrate that the “NavigationBar” component supports the file-based routing across multiple tabs.
- State Management Connection:
- Static Assets:
- Assets element (images, fonts) as a shared resource utilized by UI components and screens.

##### Architectural Patterns & Design Principles
- File-Based Routing: Emphasize that the project uses file-based routing (a pattern provided by Expo) to automatically map file structures to routes. This is key for understanding how user navigation is structured.
- Modular UI and Reusable Components: Highlight that the project greatly leverages a modular component structure to promote reuse and maintainability.
- Context API for State Sharing: Annotate the importance of the React contexts for state sharing across various parts of the application.
- Responsive, Resource-Driven Design: With assets like fonts and images, and configuration files (like tailwind), the design emphasizes an adaptive UI that works across multiple platforms.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Main Entry Point
    ExpoApp["Expo App (Entry Point: app directory)"]:::navigation

    %% Routing/Screens Subgraphs
    subgraph "Authentication Screens"
        AuthGroup["Auth Screens"]:::screens
        auth_login["login.tsx"]:::screens
        auth_otp["otp.tsx"]:::screens
        auth_signup["signup.tsx"]:::screens
        AuthGroup --> auth_login
        AuthGroup --> auth_otp
        AuthGroup --> auth_signup
    end

    subgraph "Guides Screens"
        GuideGroup["Guides Screens"]:::screens
        guides_layout["_layout.tsx"]:::screens
        guides_index["index.tsx"]:::screens
        guides_information["information.tsx"]:::screens
        guides_nearby["nearby.tsx"]:::screens
        guides_payment["payment.tsx"]:::screens
        GuideGroup --> guides_layout
        GuideGroup --> guides_index
        GuideGroup --> guides_information
        GuideGroup --> guides_nearby
        GuideGroup --> guides_payment
    end

    subgraph "Location Screens"
        LocationGroup["Location Screens"]:::screens
        location_chooser["chooser.tsx"]:::screens
        location_index["index.tsx"]:::screens
        location_list["list.tsx"]:::screens
        LocationGroup --> location_chooser
        LocationGroup --> location_index
        LocationGroup --> location_list
    end

    subgraph "Tabs Screens"
        TabsGroup["Tabs Main Layout"]:::screens
        %% Cart Tab
        subgraph "Cart Tab"
            cart_layout["_layout.tsx"]:::screens
            cart_index["index.tsx"]:::screens
            cart_layout --> cart_index
        end
        %% Home Tab
        subgraph "Home Tab"
            home_layout["_layout.tsx"]:::screens
            home_details["details.tsx"]:::screens
            home_index["index.tsx"]:::screens
            home_payment["payment.tsx & dynamic payment/[id].tsx"]:::screens
            home_rinse["rinse/[id].tsx"]:::screens
            home_wash["wash/[id].tsx"]:::screens
            home_status["status.tsx & dynamic status/[id].tsx"]:::screens
            home_layout --> home_details
            home_layout --> home_index
            home_layout --> home_payment
            home_layout --> home_rinse
            home_layout --> home_wash
            home_layout --> home_status
        end
        %% Profile Tab
        subgraph "Profile Tab"
            profile_layout["_layout.tsx"]:::screens
            profile_index["index.tsx"]:::screens
            profile_layout --> profile_index
        end
        %% QR Tab
        subgraph "QR Tab"
            qr_layout["_layout.tsx"]:::screens
            qr_index["index.tsx"]:::screens
            qr_layout --> qr_index
        end
    end

    %% Other Modules
    UIComponents["UI Components (components)"]:::ui
    subgraph "Contexts"
        Contexts["Contexts (OrderContext, UserContext)"]:::context
        order_context["OrderContext.tsx"]:::context
        user_context["UserContext.tsx"]:::context
        Contexts --> order_context
        Contexts --> user_context
    end
    Assets["Assets (Images & Fonts)"]:::assets
    subgraph "Configuration & Build Tools"
        Config["Configuration & Build Tools"]:::config
        babel["babel.config.js"]:::config
        tailwind["tailwind.config.js"]:::config
        tsconfig["tsconfig.json"]:::config
        eas["eas.json"]:::config
        appjson["app.json"]:::config
        reset_script["scripts/reset-project.js"]:::config
        build_dir["build/ (build/config.gypi)"]:::config
        Config --> babel
        Config --> tailwind
        Config --> tsconfig
        Config --> eas
        Config --> appjson
        Config --> reset_script
        Config --> build_dir
    end

    %% Connections from Entry Point to Modules
    ExpoApp -->|"routes"| AuthGroup
    ExpoApp -->|"routes"| GuideGroup
    ExpoApp -->|"routes"| LocationGroup
    ExpoApp -->|"routes"| TabsGroup
    ExpoApp -->|"uses"| UIComponents
    ExpoApp -->|"state managed by"| Contexts
    ExpoApp -->|"assets provided by"| Assets
    ExpoApp -->|"configured with"| Config

    %% Styling Classes
    classDef navigation fill:#cce8d5,stroke:#333,stroke-width:2px;
    classDef screens fill:#f9e79f,stroke:#333,stroke-width:2px;
    classDef ui fill:#aed6f1,stroke:#333,stroke-width:2px;
    classDef context fill:#d5f5e3,stroke:#333,stroke-width:2px;
    classDef assets fill:#fef9e7,stroke:#333,stroke-width:2px;
    classDef config fill:#f5cba7,stroke:#333,stroke-width:2px;

    %% Click Events for App Navigation & Routing
    click ExpoApp "https://github.com/svnfrs/easy-laundry-react-native/tree/main/app/"
    click AuthGroup "https://github.com/svnfrs/easy-laundry-react-native/tree/main/app/(auth)/"
    click auth_login "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(auth)/login.tsx"
    click auth_otp "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(auth)/otp.tsx"
    click auth_signup "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(auth)/signup.tsx"
    click GuideGroup "https://github.com/svnfrs/easy-laundry-react-native/tree/main/app/(guides)/"
    click guides_layout "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(guides)/_layout.tsx"
    click guides_index "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(guides)/index.tsx"
    click guides_information "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(guides)/information.tsx"
    click guides_nearby "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(guides)/nearby.tsx"
    click guides_payment "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(guides)/payment.tsx"
    click LocationGroup "https://github.com/svnfrs/easy-laundry-react-native/tree/main/app/(location)/"
    click location_chooser "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(location)/chooser.tsx"
    click location_index "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(location)/index.tsx"
    click location_list "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(location)/list.tsx"
    click TabsGroup "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/_layout.tsx"
    click cart_layout "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/(cart)/_layout.tsx"
    click cart_index "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/(cart)/index.tsx"
    click home_layout "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/(home)/_layout.tsx"
    click home_details "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/(home)/details.tsx"
    click home_index "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/(home)/index.tsx"
    click home_payment "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/(home)/payment.tsx"
    click home_rinse "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/(home)/rinse/[id].tsx"
    click home_wash "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/(home)/wash/[id].tsx"
    click home_status "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/(home)/status.tsx"
    click profile_layout "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/(profile)/_layout.tsx"
    click profile_index "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/(profile)/index.tsx"
    click qr_layout "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/(qr)/_layout.tsx"
    click qr_index "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app/(tabs)/(qr)/index.tsx"

    %% Click Events for Other Components
    click UIComponents "https://github.com/svnfrs/easy-laundry-react-native/tree/main/components/"
    click Contexts "https://github.com/svnfrs/easy-laundry-react-native/tree/main/contexts/"
    click order_context "https://github.com/svnfrs/easy-laundry-react-native/blob/main/contexts/OrderContext.tsx"
    click user_context "https://github.com/svnfrs/easy-laundry-react-native/blob/main/contexts/UserContext.tsx"
    click Assets "https://github.com/svnfrs/easy-laundry-react-native/tree/main/assets/"
    click babel "https://github.com/svnfrs/easy-laundry-react-native/blob/main/babel.config.js"
    click tailwind "https://github.com/svnfrs/easy-laundry-react-native/blob/main/tailwind.config.js"
    click tsconfig "https://github.com/svnfrs/easy-laundry-react-native/blob/main/tsconfig.json"
    click eas "https://github.com/svnfrs/easy-laundry-react-native/blob/main/eas.json"
    click appjson "https://github.com/svnfrs/easy-laundry-react-native/blob/main/app.json"
    click reset_script "https://github.com/svnfrs/easy-laundry-react-native/blob/main/scripts/reset-project.js"
    click build_dir "https://github.com/svnfrs/easy-laundry-react-native/tree/main/build/"
```
