# alierenkayhan/react_native_real_estate architecture

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

- Interactive diagram: https://gitdiagram.com/alierenkayhan/react_native_real_estate
- Repository: https://github.com/alierenkayhan/react_native_real_estate

## Overview

##### Project type and purpose
- This is a full-stack mobile application (Real Estate) built with Expo/React Native on the client and Appwrite as a cloud-hosted backend.
- Purpose: allow users to authenticate via Google, browse property listings, view details, manage profiles, and fetch/store data in Appwrite.

##### File structure
- Top-level “app” directory uses Expo Router’s file-based routing:
- `/app/_layout.tsx` – global layout & navigation container
- `/app/(root)/index.tsx` – Home screen
- `/app/(root)/(tabs)/*` – Bottom-tab screens: Explore, Profile
- `/app/properties/[id].tsx` – Dynamic property details page
- `/app/sign-in.tsx` – Sign-in screen
- `lib/appwrite.ts`: encapsulates all Appwrite SDK initialization and methods for authentication and CRUD operations.
- Global styling via `app/global.css`, integrated with Tailwind CSS (`tailwind.config.js`, `nativewind-env.d.ts`).
- Config files: `babel.config.js`, `metro.config.js`, `tsconfig.json`.

##### README for additional insights
- Uses Expo SDK 52, TypeScript, TailwindCSS, Nativewind, and Appwrite (Authentication, Database, Storage).
- Features: Google Auth, property listing/filter, search, dynamic routing, centralized data fetching (inspired by TanStack useQuery).

a. Main components (blocks):
- Mobile Device running the Expo App
- UI Layer (React Native screens & components)
- Navigation Layer (Expo Router file-based routing)
- Data Layer (lib/appwrite.ts, custom hooks/useQuery)
- Asset Layer (constants & static assets)
- External Services (Appwrite: Auth, Database, Storage)
b. Relationships & interactions:
1. User taps on a screen → UI Layer
2. UI triggers navigation via Router → Navigation Layer
3. UI/hooks call methods in Data Layer → Appwrite REST/SDK calls
4. Appwrite returns data → Data Layer transforms → UI updates
c. Architectural patterns & principles:
- Separation of concerns: UI vs. Data vs. Navigation
- File-based routing for automatic route generation
- Centralized API client (`lib/appwrite.ts`) for all backend interactions
- Reusable style system with Tailwind + Nativewind
d. Key technologies/frameworks:
- Expo SDK (bundler, assets pipeline, native APIs)
- React Native + TypeScript
- Expo Router (file-based navigation)
- Appwrite SDK (Auth, DB, Storage)
- Tailwind CSS/nativewind for styling

## Diagram (Mermaid)

```mermaid
flowchart TB
    classDef ui fill:#E3F2FD,stroke:#2196F3,color:#0D47A1
    classDef data fill:#E8F5E9,stroke:#43A047,color:#1B5E20
    classDef service fill:#FFEBEE,stroke:#E53935,color:#B71C1C
    classDef assets fill:#ECEFF1,stroke:#607D8B,color:#263238
    classDef config fill:#F3E5F5,stroke:#8E24AA,color:#4A148C
    classDef external fill:#FFF9C4,stroke:#FBC02D,color:#F57F17

    User((User)):::external
    User --> Layout

    subgraph "Mobile Device"
        direction TB
        Layout["Global Layout & Navigation Container"]:::ui
        subgraph "Screens"
            direction TB
            Home["Home Screen"]:::ui
            Explore["Explore Tab Screen"]:::ui
            Profile["Profile Tab Screen"]:::ui
            Details["Property Details Screen"]:::ui
            SignIn["Sign-In Screen"]:::ui
        end
        Layout --> Home
        Layout --> Explore
        Layout --> Profile
        Layout --> Details
        Layout --> SignIn

        DataLayer["Data Layer<br/>(lib/appwrite.ts & Custom Hooks)"]:::data
        Home --> DataLayer
        Explore --> DataLayer
        Profile --> DataLayer
        Details --> DataLayer
        SignIn --> DataLayer

        subgraph "Assets & Constants"
            direction TB
            Fonts["Fonts"]:::assets
            Icons["Icons"]:::assets
            Images["Images"]:::assets
            DataConst["data.ts"]:::assets
            IconsConst["icons.ts"]:::assets
            ImagesConst["images.ts"]:::assets
        end

        AssetsLink1( ):::assets
        DataLayer --> Fonts
        DataLayer --> Icons
        DataLayer --> Images
        DataLayer --> DataConst
        DataLayer --> IconsConst
        DataLayer --> ImagesConst

        subgraph "Styling & Project Config"
            direction TB
            Styling["Global Styles & Tailwind<br/>(app/global.css,<br/>tailwind.config.js,<br/>nativewind-env.d.ts)"]:::config
            Configs["Project Configs<br/>(babel.config.js,<br/>metro.config.js,<br/>tsconfig.json)"]:::config
        end
        Layout --> Styling
        Layout --> Configs
    end

    subgraph "Appwrite Cloud"
        direction TB
        Auth["Authentication"]:::service
        DB["Database"]:::service
        Storage["Storage"]:::service
    end

    DataLayer --> Auth
    DataLayer --> DB
    DataLayer --> Storage
    Auth --> DataLayer
    DB --> DataLayer
    Storage --> DataLayer

    click Layout "https://github.com/alierenkayhan/react_native_real_estate/blob/main/app/_layout.tsx"
    click Home "https://github.com/alierenkayhan/react_native_real_estate/blob/main/app/(root)/index.tsx"
    click Explore "https://github.com/alierenkayhan/react_native_real_estate/blob/main/app/(root)/(tabs)/explore.tsx"
    click Profile "https://github.com/alierenkayhan/react_native_real_estate/blob/main/app/(root)/(tabs)/profile.tsx"
    click Details "https://github.com/alierenkayhan/react_native_real_estate/blob/main/app/(root)/properties/[id].tsx"
    click SignIn "https://github.com/alierenkayhan/react_native_real_estate/blob/main/app/sign-in.tsx"
    click DataLayer "https://github.com/alierenkayhan/react_native_real_estate/blob/main/lib/appwrite.ts"
    click Fonts "https://github.com/alierenkayhan/react_native_real_estate/tree/main/assets/fonts"
    click Icons "https://github.com/alierenkayhan/react_native_real_estate/tree/main/assets/icons"
    click Images "https://github.com/alierenkayhan/react_native_real_estate/tree/main/assets/images"
    click DataConst "https://github.com/alierenkayhan/react_native_real_estate/blob/main/constants/data.ts"
    click IconsConst "https://github.com/alierenkayhan/react_native_real_estate/blob/main/constants/icons.ts"
    click ImagesConst "https://github.com/alierenkayhan/react_native_real_estate/blob/main/constants/images.ts"
    click Styling "https://github.com/alierenkayhan/react_native_real_estate/blob/main/app/global.css"
    click Styling "https://github.com/alierenkayhan/react_native_real_estate/blob/main/tailwind.config.js"
    click Styling "https://github.com/alierenkayhan/react_native_real_estate/blob/main/nativewind-env.d.ts"
    click Configs "https://github.com/alierenkayhan/react_native_real_estate/blob/main/babel.config.js"
    click Configs "https://github.com/alierenkayhan/react_native_real_estate/blob/main/metro.config.js"
    click Configs "https://github.com/alierenkayhan/react_native_real_estate/blob/main/tsconfig.json"
```
