# adrianhajdin/react_native-restate architecture

> Architecture diagram of the GitHub repository adrianhajdin/react_native-restate, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adrianhajdin/react_native-restate
- Repository: https://github.com/adrianhajdin/react_native-restate

## Overview

Real Scout is an Expo/React Native real-estate app. Users sign in with Google, browse featured and searchable/filterable property listings, open property details, and manage their profile. Listing and detail requests, plus current-user and OAuth operations, use Appwrite through shared client functions and a centralized fetching hook. The README documents the major screens and capabilities; some screen implementations were not excerpted, so their internal links are limited to indexed imports or documented behavior.

Main entry points: [`lib/appwrite.ts`](https://github.com/adrianhajdin/react_native-restate/blob/main/lib/appwrite.ts) (Appwrite operations), [`app/(root)/(tabs)/index.tsx`](https://github.com/adrianhajdin/react_native-restate/blob/main/app/(root)/(tabs)/index.tsx) (Home listings), [`app/(root)/(tabs)/explore.tsx`](https://github.com/adrianhajdin/react_native-restate/blob/main/app/(root)/(tabs)/explore.tsx) (Explore listings), [`app/(root)/properties/[id].tsx`](https://github.com/adrianhajdin/react_native-restate/blob/main/app/(root)/properties/%5Bid%5D.tsx) (Property details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Property discovery"]
  node_home["Home listings<br/>[index.tsx]"]
  node_explore["Explore listings<br/>[explore.tsx]"]
  node_search["Search input<br/>[Search.tsx]"]
  node_filters["Category filters<br/>[Filters.tsx]"]
  node_categories["Listing categories<br/>[data.ts]"]
end

subgraph group_property["Property experience"]
  node_property_detail["Property details<br/>[&#91;id&#93;.tsx]"]
  node_cards["Property cards<br/>[Cards.tsx]"]
  node_comments["Review comment<br/>[Comment.tsx]"]
  node_empty_state["Empty results<br/>[NoResults.tsx]"]
end

subgraph group_identity["Identity and data"]
  node_profile["User profile<br/>[profile.tsx]"]
  node_sign_in["Google sign-in<br/>[sign-in.tsx]"]
  node_session_context["User session"]
  node_fetch_hook["Fetch state hook<br/>[useAppwrite.ts]"]
  node_appwrite_api["Appwrite operations<br/>[appwrite.ts]"]
end

subgraph group_shared["Shared presentation"]
  node_static_data["Property sample data<br/>[data.ts]"]
  node_icons["Icon assets<br/>[icons.ts]"]
  node_images["Image assets<br/>[images.ts]"]
end

node_visitor(("App user"))
node_appwrite_service[("Appwrite backend")]
node_google(("Google OAuth"))

node_visitor -->|"signs in"| node_sign_in
node_sign_in -->|"calls login"| node_appwrite_api
node_appwrite_api -->|"starts OAuth"| node_google
node_appwrite_api -->|"authenticates and queries"| node_appwrite_service
node_sign_in -->|"refreshes session"| node_session_context
node_session_context -->|"loads user"| node_fetch_hook
node_session_context -->|"gets current user"| node_appwrite_api
node_visitor -->|"browses listings"| node_home
node_home -->|"fetches listings"| node_fetch_hook
node_home -->|"requests properties"| node_appwrite_api
node_home -->|"renders"| node_search
node_home -->|"renders"| node_filters
node_home -->|"renders listings"| node_cards
node_home -->|"renders when empty"| node_empty_state
node_filters -->|"reads categories"| node_categories
node_visitor -->|"browses properties"| node_explore
node_explore -->|"fetches listings"| node_fetch_hook
node_explore -->|"requests properties"| node_appwrite_api
node_explore -->|"renders"| node_search
node_explore -->|"renders"| node_filters
node_explore -->|"renders listings"| node_cards
node_visitor -->|"opens property"| node_property_detail
node_property_detail -->|"loads property"| node_fetch_hook
node_property_detail -->|"requests property"| node_appwrite_api
node_property_detail -->|"renders review"| node_comments
node_visitor -->|"manages profile"| node_profile
node_profile -->|"reads user session"| node_session_context
node_profile -->|"uses account operations"| node_appwrite_api
node_appwrite_api -.->|"uses gallery data"| node_static_data

click node_home "https://github.com/adrianhajdin/react_native-restate/blob/main/app/(root)/(tabs)/index.tsx"
click node_explore "https://github.com/adrianhajdin/react_native-restate/blob/main/app/(root)/(tabs)/explore.tsx"
click node_search "https://github.com/adrianhajdin/react_native-restate/blob/main/components/Search.tsx"
click node_filters "https://github.com/adrianhajdin/react_native-restate/blob/main/components/Filters.tsx"
click node_categories "https://github.com/adrianhajdin/react_native-restate/blob/main/constants/data.ts"
click node_property_detail "https://github.com/adrianhajdin/react_native-restate/blob/main/app/(root)/properties/%5Bid%5D.tsx"
click node_cards "https://github.com/adrianhajdin/react_native-restate/blob/main/components/Cards.tsx"
click node_comments "https://github.com/adrianhajdin/react_native-restate/blob/main/components/Comment.tsx"
click node_empty_state "https://github.com/adrianhajdin/react_native-restate/blob/main/components/NoResults.tsx"
click node_profile "https://github.com/adrianhajdin/react_native-restate/blob/main/app/(root)/(tabs)/profile.tsx"
click node_sign_in "https://github.com/adrianhajdin/react_native-restate/blob/main/app/sign-in.tsx"
click node_session_context "https://github.com/adrianhajdin/react_native-restate/blob/main/lib/global-provider.tsx"
click node_fetch_hook "https://github.com/adrianhajdin/react_native-restate/blob/main/lib/useAppwrite.ts"
click node_appwrite_api "https://github.com/adrianhajdin/react_native-restate/blob/main/lib/appwrite.ts"
click node_static_data "https://github.com/adrianhajdin/react_native-restate/blob/main/lib/data.ts"
click node_icons "https://github.com/adrianhajdin/react_native-restate/blob/main/constants/icons.ts"
click node_images "https://github.com/adrianhajdin/react_native-restate/blob/main/constants/images.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_home,node_explore,node_search,node_filters,node_categories,node_visitor toneBlue
class node_property_detail,node_cards,node_comments,node_empty_state,node_appwrite_service toneAmber
class node_profile,node_sign_in,node_session_context,node_fetch_hook,node_appwrite_api toneMint
class node_static_data,node_icons,node_images toneRose
class node_google toneIndigo
```

## Components

### Property discovery

- [Home listings](https://github.com/adrianhajdin/react_native-restate/blob/main/app/(root)/(tabs)/index.tsx): `app/(root)/(tabs)/index.tsx`
- [Explore listings](https://github.com/adrianhajdin/react_native-restate/blob/main/app/(root)/(tabs)/explore.tsx): `app/(root)/(tabs)/explore.tsx`
- [Search input](https://github.com/adrianhajdin/react_native-restate/blob/main/components/Search.tsx): `components/Search.tsx`
- [Category filters](https://github.com/adrianhajdin/react_native-restate/blob/main/components/Filters.tsx): `components/Filters.tsx`
- [Listing categories](https://github.com/adrianhajdin/react_native-restate/blob/main/constants/data.ts): `constants/data.ts`

### Property experience

- [Property details](https://github.com/adrianhajdin/react_native-restate/blob/main/app/(root)/properties/%5Bid%5D.tsx): `app/(root)/properties/[id].tsx`
- [Property cards](https://github.com/adrianhajdin/react_native-restate/blob/main/components/Cards.tsx): `components/Cards.tsx`
- [Review comment](https://github.com/adrianhajdin/react_native-restate/blob/main/components/Comment.tsx): `components/Comment.tsx`
- [Empty results](https://github.com/adrianhajdin/react_native-restate/blob/main/components/NoResults.tsx): `components/NoResults.tsx`

### Identity and data

- [User profile](https://github.com/adrianhajdin/react_native-restate/blob/main/app/(root)/(tabs)/profile.tsx): `app/(root)/(tabs)/profile.tsx`
- [Google sign-in](https://github.com/adrianhajdin/react_native-restate/blob/main/app/sign-in.tsx): `app/sign-in.tsx`
- [User session](https://github.com/adrianhajdin/react_native-restate/blob/main/lib/global-provider.tsx): `lib/global-provider.tsx`
- [Fetch state hook](https://github.com/adrianhajdin/react_native-restate/blob/main/lib/useAppwrite.ts): `lib/useAppwrite.ts`
- [Appwrite operations](https://github.com/adrianhajdin/react_native-restate/blob/main/lib/appwrite.ts): `lib/appwrite.ts`

### Shared presentation

- [Property sample data](https://github.com/adrianhajdin/react_native-restate/blob/main/lib/data.ts): `lib/data.ts`
- [Icon assets](https://github.com/adrianhajdin/react_native-restate/blob/main/constants/icons.ts): `constants/icons.ts`
- [Image assets](https://github.com/adrianhajdin/react_native-restate/blob/main/constants/images.ts): `constants/images.ts`

### Other components

- **App user**
- **Appwrite backend**
- **Google OAuth**

## Connections

- App user → Google sign-in: signs in (evidence: `README.md`)
- Google sign-in → Appwrite operations: calls login (evidence: `app/sign-in.tsx`)
- Appwrite operations → Google OAuth: starts OAuth (evidence: `lib/appwrite.ts`)
- Appwrite operations → Appwrite backend: authenticates and queries (evidence: `lib/appwrite.ts`)
- Google sign-in → User session: refreshes session (evidence: `app/sign-in.tsx`)
- User session → Fetch state hook: loads user (evidence: `lib/global-provider.tsx`)
- User session → Appwrite operations: gets current user (evidence: `lib/global-provider.tsx`)
- App user → Home listings: browses listings (evidence: `README.md`)
- Home listings → Fetch state hook: fetches listings (evidence: `app/(root)/(tabs)/index.tsx`)
- Home listings → Appwrite operations: requests properties (evidence: `app/(root)/(tabs)/index.tsx`)
- Home listings → Search input: renders (evidence: `app/(root)/(tabs)/index.tsx`)
- Home listings → Category filters: renders (evidence: `app/(root)/(tabs)/index.tsx`)
- Home listings → Property cards: renders listings (evidence: `app/(root)/(tabs)/index.tsx`)
- Home listings → Empty results: renders when empty (evidence: `app/(root)/(tabs)/index.tsx`)
- Category filters → Listing categories: reads categories (evidence: `components/Filters.tsx`)
- App user → Explore listings: browses properties (evidence: `README.md`)
- Explore listings → Fetch state hook: fetches listings (evidence: `app/(root)/(tabs)/explore.tsx`)
- Explore listings → Appwrite operations: requests properties (evidence: `app/(root)/(tabs)/explore.tsx`)
- Explore listings → Search input: renders (evidence: `app/(root)/(tabs)/explore.tsx`)
- Explore listings → Category filters: renders (evidence: `app/(root)/(tabs)/explore.tsx`)
- Explore listings → Property cards: renders listings (evidence: `app/(root)/(tabs)/explore.tsx`)
- App user → Property details: opens property
- Property details → Fetch state hook: loads property (evidence: `app/(root)/properties/[id].tsx`)
- Property details → Appwrite operations: requests property (evidence: `app/(root)/properties/[id].tsx`)
- Property details → Review comment: renders review (evidence: `app/(root)/properties/[id].tsx`)
- App user → User profile: manages profile (evidence: `README.md`)
- User profile → User session: reads user session (evidence: `app/(root)/(tabs)/profile.tsx`)
- User profile → Appwrite operations: uses account operations (evidence: `app/(root)/(tabs)/profile.tsx`)
- Appwrite operations → Property sample data: uses gallery data
