# arulkumar-web/laundry_app architecture

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

- Interactive diagram: https://gitdiagram.com/arulkumar-web/laundry_app
- Repository: https://github.com/arulkumar-web/laundry_app

## Overview

##### Project type and purpose
- This is a full-stack mobile application (“Laundry App”) built with Expo and React Native.
- It targets Android (native folder) and cross-platform JavaScript (app/ directory).
- It uses file-based routing (app/(…)/… .js), Redux for client-side state, and Firebase for backend services (auth, database).

##### File structure
Top-level:
- android/… – Native Android project generated by Expo/EAS.
- app/… – Expo’s file-based routing entrypoint. Contains screens grouped by layouts: authenticate, tabs (home, basket, orders).
- components/ – Reusable UI pieces (e.g., DressItem.js).
- redux/ – Redux reducers (CartReducer.js).
- store.js – Redux store instantiation.
- firebase.js – Firebase client initialization.
- assets/ – Fonts and images.
- scripts/reset-project.js – Utility to scaffold a fresh app.
- package.json, eas.json, tsconfig.json – Project configuration.

##### README
- Confirms Expo + React Native stack.
- Instructions to install, run, and reset.
- No separate Node-backend: Firebase is the backend.

##### Main components
a. Mobile App (React Native + Expo)
- UI layer (Screens & Components)
- Routing layer (file-based router in app/)
- State management (Redux store)
b. Native runtime layer (Expo Go or development build)
- Android folder / native modules
c. Service layer
- Firebase services (Authentication, Firestore, Storage)
- firebase.js wrapper for SDK calls
d. Build & Deployment
- Metro bundler / expo CLI
- EAS / Android build pipeline

##### Relationships and interactions
- User taps UI → Routing loads a screen component
- Screen dispatches Redux actions → CartReducer updates state
- Thunks or service functions in firebase.js call Firebase APIs → read/write data
- Firebase responses flow back to Redux → UI re-renders
- Expo CLI manages bundling and hot reload → Native app

##### Architectural patterns and design principles
- Layered architecture: Presentation → State → Service → External
- File-based routing for modular screens
- Unidirectional data flow (Redux)
- Separation of concerns: UI components vs. state logic vs. Firebase service wrapper

##### Technologies & frameworks
- React Native + Expo Framework
- React Navigation (via file-based routing)
- Redux for state management
- Firebase SDK (Auth, Firestore)
- Android native code (Kotlin) for release builds
- Metro bundler, EAS build & deploy

##### Detail
- Explicitly break out each screen group (Authenticate, Home, Basket, Orders).
- Where reusable components sit.
- File-based router as its own module.
- Native Android folder as the final output container for the app.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Mobile UI Layer
    subgraph "Mobile UI" 
        direction TB
        subgraph "Screens (File-based Routing)" 
            direction TB
            subgraph "Authenticate"
                direction TB
                AuthLayout["_layout.js"]:::frontend
                Login["login.js"]:::frontend
                Register["register.js"]:::frontend
                click AuthLayout "https://github.com/arulkumar-web/laundry_app/blob/main/app/(authenticate)/_layout.js"
                click Login "https://github.com/arulkumar-web/laundry_app/blob/main/app/(authenticate)/login.js"
                click Register "https://github.com/arulkumar-web/laundry_app/blob/main/app/(authenticate)/register.js"
            end
            subgraph "Tabs"
                direction TB
                TabsLayout["_layout.js"]:::frontend
                click TabsLayout "https://github.com/arulkumar-web/laundry_app/blob/main/app/(tabs)/_layout.js"
                subgraph "Home"
                    direction TB
                    HomeLayout["_layout.js"]:::frontend
                    HomeAdd["add.js"]:::frontend
                    HomeAddress["address.js"]:::frontend
                    HomeIndex["index.js"]:::frontend
                    click HomeLayout "https://github.com/arulkumar-web/laundry_app/blob/main/app/(tabs)/home/_layout.js"
                    click HomeAdd "https://github.com/arulkumar-web/laundry_app/blob/main/app/(tabs)/home/add.js"
                    click HomeAddress "https://github.com/arulkumar-web/laundry_app/blob/main/app/(tabs)/home/address.js"
                    click HomeIndex "https://github.com/arulkumar-web/laundry_app/blob/main/app/(tabs)/home/index.js"
                end
                subgraph "Basket"
                    direction TB
                    BasketLayout["_layout.js"]:::frontend
                    BasketCart["cart.js"]:::frontend
                    BasketIndex["index.js"]:::frontend
                    BasketSelect["select.js"]:::frontend
                    click BasketLayout "https://github.com/arulkumar-web/laundry_app/blob/main/app/(tabs)/basket/_layout.js"
                    click BasketCart "https://github.com/arulkumar-web/laundry_app/blob/main/app/(tabs)/basket/cart.js"
                    click BasketIndex "https://github.com/arulkumar-web/laundry_app/blob/main/app/(tabs)/basket/index.js"
                    click BasketSelect "https://github.com/arulkumar-web/laundry_app/blob/main/app/(tabs)/basket/select.js"
                end
                subgraph "Orders"
                    direction TB
                    OrdersLayout["_layout.js"]:::frontend
                    OrdersIndex["index.js"]:::frontend
                    click OrdersLayout "https://github.com/arulkumar-web/laundry_app/blob/main/app/(tabs)/orders/_layout.js"
                    click OrdersIndex "https://github.com/arulkumar-web/laundry_app/blob/main/app/(tabs)/orders/index.js"
                end
            end
            IndexScreen["index.js"]:::frontend
            click IndexScreen "https://github.com/arulkumar-web/laundry_app/blob/main/app/index.js"
        end
        subgraph "Reusable Components"
            direction TB
            DressItem["DressItem.js"]:::frontend
            click DressItem "https://github.com/arulkumar-web/laundry_app/blob/main/components/DressItem.js"
        end
    end

    %% State Management
    subgraph "State Management" 
        direction TB
        Store["store.js"]:::state
        CartReducer["CartReducer.js"]:::state
        click Store "https://github.com/arulkumar-web/laundry_app/blob/main/store.js"
        click CartReducer "https://github.com/arulkumar-web/laundry_app/blob/main/redux/CartReducer.js"
    end

    %% Service Layer
    subgraph "Service Layer"
        direction TB
        FirebaseWrapper["firebase.js"]:::service
        FirebaseServices["Firebase Services"]:::external
        click FirebaseWrapper "https://github.com/arulkumar-web/laundry_app/blob/main/firebase.js"
    end

    %% Native Runtime
    subgraph "Native Runtime"
        direction TB
        AndroidDir["android/"]:::external
        MainActivity["MainActivity.kt"]:::external
        MainApplication["MainApplication.kt"]:::external
        click AndroidDir "https://github.com/arulkumar-web/laundry_app/tree/main/android/"
        click MainActivity "https://github.com/arulkumar-web/laundry_app/blob/main/android/app/src/main/java/.../MainActivity.kt"
        click MainApplication "https://github.com/arulkumar-web/laundry_app/blob/main/android/app/src/main/java/.../MainApplication.kt"
    end

    %% Build & Deployment
    subgraph "Build & Deployment"
        direction TB
        ExpoCLI["package.json"]:::build
        EASConfig["eas.json"]:::build
        TSConfig["tsconfig.json"]:::build
        AppConfig["app.json"]:::build
        ResetScript["reset-project.js"]:::build
        click ExpoCLI "https://github.com/arulkumar-web/laundry_app/blob/main/package.json"
        click EASConfig "https://github.com/arulkumar-web/laundry_app/blob/main/eas.json"
        click TSConfig "https://github.com/arulkumar-web/laundry_app/blob/main/tsconfig.json"
        click AppConfig "https://github.com/arulkumar-web/laundry_app/blob/main/app.json"
        click ResetScript "https://github.com/arulkumar-web/laundry_app/blob/main/scripts/reset-project.js"
    end

    %% Assets Pipeline
    Assets["assets/ (images & fonts)"]:::build

    %% Core Firebase
    FireAuth["Authentication"]:::external
    Firestore["Firestore & Storage"]:::external

    %% Connections
    %% UI to State
    AuthLayout -->|"dispatch actions"| Store
    Login -->|"dispatch actions"| Store
    Register -->|"dispatch actions"| Store
    HomeIndex -->|"dispatch actions"| Store
    BasketCart -->|"dispatch actions"| Store
    OrdersIndex -->|"dispatch actions"| Store
    Store -->|"state updates"| AuthLayout
    Store -->|"state updates"| HomeIndex

    %% UI to Services
    HomeIndex -->|"service calls"| FirebaseWrapper
    BasketCart -->|"service calls"| FirebaseWrapper

    %% Service to External
    FirebaseWrapper -->|"uses Auth API"| FireAuth
    FirebaseWrapper -->|"uses Firestore API"| Firestore

    %% Build to Native
    ExpoCLI -->|"bundles with Metro"| NativeRuntime
    Assets -->|"packaged by bundler"| ExpoCLI
    EASConfig -->|"deploy config"| ExpoCLI

    %% Platform integration
    ExpoCLI -->|"generates binary"| AndroidDir

    classDef frontend fill:#d0e8ff,stroke:#3399ff,color:#000;
    classDef state fill:#d5fdd5,stroke:#2eb82e,color:#000;
    classDef service fill:#ffe6b3,stroke:#ff9900,color:#000;
    classDef external fill:#ffd9d9,stroke:#ff4d4d,color:#000;
    classDef build fill:#e6e6e6,stroke:#999999,color:#000;
```
