# uplsuman/middleman architecture

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

- Interactive diagram: https://gitdiagram.com/uplsuman/middleman
- Repository: https://github.com/uplsuman/middleman

## Overview

##### Project type and purpose
- This is a React Native mobile application (full-stack in the sense of cross-platform mobile UI + native iOS/Android layers).
- The README describes standard RN bootstrapping with Metro, Android and iOS build processes.

##### File structure
- Top-level “android” and “ios” directories contain native modules, build scripts, Gradle/Xcode projects.
- “src” holds all JavaScript/TypeScript code:
- “components” follows an atomic hierarchy (atoms, molecules, organisms)
- “scenes” are feature screens (BookingModule, CategoryModule, etc.)
- “reduxStorage” implements Redux Toolkit slices and the central store
- “navigations” configures React Navigation stacks and tabs
- “utilities” includes APIService, AsyncStorage wrappers, i18n, validation, dimension helpers
- Config files: babel.config.js, metro.config.js, tsconfig.json, eslint/prettier, package.json, Podfile, build.gradle

##### README for additional insights
- Project uses TypeScript, Redux Toolkit, React Navigation, custom native fonts/assets

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% JS Environment
    subgraph "JS Environment"
        Metro["Metro Bundler"]:::tool
        JSRuntime["JS Runtime\n(React Native Bridge)"]:::tool
    end

    Metro -->|"bundles JS"| JSRuntime

    %% UI Layer
    subgraph "UI Layer"
        Atoms["Atoms\n(src/components/atoms)"]:::ui
        Molecules["Molecules\n(src/components/molecules)"]:::ui
        Organisms["Organisms\n(src/components/organisms)"]:::ui
        Scenes["Screens/Scenes\n(src/scenes)"]:::ui
    end

    JSRuntime -->|"renders components"| Atoms
    Atoms --> Molecules
    Molecules --> Organisms
    Organisms --> Scenes

    %% Navigation Layer
    subgraph "Navigation Layer"
        NavIndex["Navigations\n(index.tsx)"]:::ui
        NavConfig["Navigation Config\n(navigation.tsx)"]:::ui
        TabNav["Tab Navigator\n(TabNavigator.tsx)"]:::ui
        CustomTab["Custom Tab Bar\n(CustomTabBar.tsx)"]:::ui
    end

    Scenes -->|"defines screens"| NavIndex
    NavIndex --> NavConfig
    NavConfig --> TabNav
    TabNav --> CustomTab

    %% State Management
    subgraph "State Management"
        Store["Redux Store\n(store.ts)"]:::state
        Hooks["Redux Hooks\n(hooks.ts)"]:::state
        subgraph "Redux Slices"
            UserSlice["User Slice\n(UserSlice.tsx)"]:::state
            AppointmentSlice["Appointment Slice\n(appointmentSlice.tsx)"]:::state
            BookingSlice["Booking Slice\n(bookingSlice.tsx)"]:::state
            CategorySlice["Category Slice\n(categorySlice.tsx)"]:::state
            EditProfileSlice["Edit Profile Slice\n(editProfileSlice.tsx)"]:::state
            LocationSlice["Location Slice\n(locationSlice.tsx)"]:::state
            NotificationSlice["Notification Slice\n(notificationSlice.tsx)"]:::state
            ProfessionalSlice["Professional Slice\n(professionalSlice.tsx)"]:::state
            PromotionSlice["Promotion Slice\n(promotionSlice.tsx)"]:::state
            ThemeSlice["Theme Slice\n(themeSlice.tsx)"]:::state
            UserInterestsSlice["User Interests Slice\n(userInterestsSlice.tsx)"]:::state
            UtilitySlice["Utility Slice\n(utilitySlice.tsx)"]:::state
        end
    end

    Scenes -->|"dispatches actions"| Store
    Store -->|"provides state"| Scenes
    Hooks --> Store

    %% Services Layer
    subgraph "Services Layer"
        APIService["API Service\n(APIService.tsx)"]:::service
        AsyncService["AsyncStorage Service\n(AsyncStorageService.tsx)"]:::service
        I18n["i18n\n(i18n.tsx)"]:::service
        Validation["Validation Schema\n(ValidationSchema.tsx)"]:::service
        CustomHooks["Custom Hooks\n(CustomHookes.ts)"]:::service
        UtilityMethods["Utility Methods\n(UtilityMethods.tsx)"]:::service
    end

    APIService -->|"HTTP requests"| ExternalAPI
    ExternalAPI -->|"responses"| APIService
    APIService -->|"dispatches"| Store
    AsyncService -->|"persists data"| Store

    %% Native Modules
    JSRuntime <--> NativeModules["Native Modules"]:::native
    subgraph "Native Modules"
        Android["Android\n(android/)"]:::native
        MainApp["MainApplication.kt"]:::native
        MainActivity["MainActivity.kt"]:::native
        iOS["iOS\n(ios/)"]:::native
        AppDelegate["AppDelegate.swift"]:::native
    end

    NativeModules --> Android
    Android --> MainApp
    Android --> MainActivity
    NativeModules --> iOS
    iOS --> AppDelegate

    %% External Backend
    ExternalAPI["External Backend API"]:::external

    %% Connections between Layers
    JSRuntime --> Scenes
    Scenes --> APIService

    %% Click Events
    click Metro "https://github.com/uplsuman/middleman/blob/main/metro.config.js"
    click JSRuntime "https://github.com/uplsuman/middleman/blob/main/index.js"
    click Atoms "https://github.com/uplsuman/middleman/tree/main/src/components/atoms"
    click Molecules "https://github.com/uplsuman/middleman/tree/main/src/components/molecules"
    click Organisms "https://github.com/uplsuman/middleman/tree/main/src/components/organisms"
    click Scenes "https://github.com/uplsuman/middleman/tree/main/src/scenes"
    click NavIndex "https://github.com/uplsuman/middleman/blob/main/src/navigations/index.tsx"
    click NavConfig "https://github.com/uplsuman/middleman/blob/main/src/navigations/navigation.tsx"
    click TabNav "https://github.com/uplsuman/middleman/blob/main/src/navigations/TabNavigator.tsx"
    click CustomTab "https://github.com/uplsuman/middleman/blob/main/src/navigations/CustomTabBar.tsx"
    click Store "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/store.ts"
    click Hooks "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/hooks.ts"
    click UserSlice "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/reduxSlice/UserSlice.tsx"
    click AppointmentSlice "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/reduxSlice/appointmentSlice.tsx"
    click BookingSlice "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/reduxSlice/bookingSlice.tsx"
    click CategorySlice "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/reduxSlice/categorySlice.tsx"
    click EditProfileSlice "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/reduxSlice/editProfileSlice.tsx"
    click LocationSlice "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/reduxSlice/locationSlice.tsx"
    click NotificationSlice "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/reduxSlice/notificationSlice.tsx"
    click ProfessionalSlice "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/reduxSlice/professionalSlice.tsx"
    click PromotionSlice "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/reduxSlice/promotionSlice.tsx"
    click ThemeSlice "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/reduxSlice/themeSlice.tsx"
    click UserInterestsSlice "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/reduxSlice/userInterestsSlice.tsx"
    click UtilitySlice "https://github.com/uplsuman/middleman/blob/main/src/reduxStorage/reduxSlice/utilitySlice.tsx"
    click APIService "https://github.com/uplsuman/middleman/blob/main/src/utilities/APIService.tsx"
    click AsyncService "https://github.com/uplsuman/middleman/blob/main/src/utilities/AsyncStorageService.tsx"
    click I18n "https://github.com/uplsuman/middleman/blob/main/src/utilities/i18n.tsx"
    click Validation "https://github.com/uplsuman/middleman/blob/main/src/utilities/ValidationSchema.tsx"
    click CustomHooks "https://github.com/uplsuman/middleman/blob/main/src/utilities/CustomHookes.ts"
    click UtilityMethods "https://github.com/uplsuman/middleman/blob/main/src/utilities/UtilityMethods.tsx"
    click Android "https://github.com/uplsuman/middleman/tree/main/android/"
    click MainApp "https://github.com/uplsuman/middleman/blob/main/android/app/src/main/java/com/middleman/MainApplication.kt"
    click MainActivity "https://github.com/uplsuman/middleman/blob/main/android/app/src/main/java/com/middleman/MainActivity.kt"
    click iOS "https://github.com/uplsuman/middleman/tree/main/ios/"
    click AppDelegate "https://github.com/uplsuman/middleman/blob/main/ios/middleman/AppDelegate.swift"

    %% Styles
    classDef ui fill:#D6EAF8,stroke:#21618C,color:#21618C;
    classDef state fill:#D5F5E3,stroke:#196F3D,color:#196F3D;
    classDef service fill:#FDEBD0,stroke:#B9770E,color:#B9770E;
    classDef native fill:#E5E7E9,stroke:#424949,color:#424949;
    classDef tool fill:#EBDEF0,stroke:#512E5F,color:#512E5F;
    classDef external fill:#FADBD8,stroke:#922B21,color:#922B21;
```
