# mukeshkumar1699/zomato-guide architecture

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

- Interactive diagram: https://gitdiagram.com/mukeshkumar1699/zomato-guide
- Repository: https://github.com/mukeshkumar1699/zomato-guide

## Overview

##### Project type and purpose
- This is a native Android mobile application that clones key features of Zomato.
- It provides user authentication (phone OTP via Firebase), location-based restaurant search, restaurant details & reviews, and basic ordering workflows.

##### File‐structure highlights
- app/src/main/java/com/mukeshproject/zomatoguide/activities & fragments – UI layer (Activities & Fragments drive screens).
- app/src/main/java/com/mukeshproject/zomatoguide/adapter & viewholder – RecyclerView adapters & view holders for list displays.
- app/src/main/java/com/mukeshproject/zomatoguide/api – Networking (ApiClient + Retrofit setup).
- app/src/main/java/com/mukeshproject/zomatoguide/model & listof… – Data models representing API responses & JSON parsing.
- app/src/main/java/com/mukeshproject/zomatoguide/sharedpreferences – Local storage (PreferenceHelper for session, tokens).
- Google-services.json – Firebase integration for Auth and possibly Realtime Database/Firestore.
- res/raw/*.json – Static configuration/mapping files.
- Third‐party libs in Gradle: Retrofit (network calls), Glide (image loading), Lottie (animations), Firebase (Auth), Google Location Manager.

##### Insights from README
- Confirms Android + Firebase + Google Location + Retrofit + Glide + Lottie tech stack.
- App requires GPS, Internet, Android ≥5.1.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Device Boundary
    subgraph "Android Device"
        %% Presentation Layer
        subgraph "Presentation Layer"
            Activities["Activities"] 
            Fragments["Fragments"]
            Adapters["RecyclerView Adapters"]
            ViewHolders["RecyclerView ViewHolders"]
        end
        %% Service Layer
        subgraph "Service Layer"
            ApiClient["ApiClient (Retrofit)"]
            Network["Network (Retrofit Interface)"]
            BackgroundThread["BackgroundThread"]
            PreferenceHelper["PreferenceHelper"]
            CustomComparator["CustomComparator"]
        end
        %% Data Layer
        subgraph "Data Layer"
            DataModels["Data Models (Models & FireData)"]
            StaticJSON["Static JSON Resources"]
        end
    end

    %% External Services
    ZomatoAPI["Zomato REST API"] 
    FirebaseAuth["Firebase Auth"]
    FirebaseDB["Firebase Database/Firestore"]
    GoogleLocation["Google Location Manager"]

    %% Connections: UI to Service
    Activities -->|"fetchRestaurants(params)"| ApiClient
    Fragments -->|"fetchRestaurantDetails(id)"| ApiClient
    Activities -->|"signInWithPhoneAuth()"| FirebaseAuth
    %% Service to External
    ApiClient -->|"GET /search"| ZomatoAPI
    ZomatoAPI -->|"JSON response"| ApiClient
    ApiClient -->|"parse to POJOs"| DataModels
    ApiClient -->|"save(userToken)"| PreferenceHelper
    PreferenceHelper -->|"retrieve(session)"| Activities
    BackgroundThread -->|"runs network tasks"| ApiClient
    FirebaseAuth -->|"authToken"| PreferenceHelper
    Activities -->|"loadStaticConfig()"| StaticJSON
    GoogleLocation -->|"location coords"| ApiClient
    PreferenceHelper -->|"get(token)"| ApiClient
    %% Service to Firebase DB (optional user data)
    ApiClient -->|"userDataRead/write"| FirebaseDB

    %% Click Events
    click Activities "https://github.com/mukeshkumar1699/zomato-guide/tree/master/app/src/main/java/com/mukeshproject/zomatoguide/activities/"
    click Fragments "https://github.com/mukeshkumar1699/zomato-guide/tree/master/app/src/main/java/com/mukeshproject/zomatoguide/fragments/"
    click Adapters "https://github.com/mukeshkumar1699/zomato-guide/tree/master/app/src/main/java/com/mukeshproject/zomatoguide/adapter/"
    click ViewHolders "https://github.com/mukeshkumar1699/zomato-guide/tree/master/app/src/main/java/com/mukeshproject/zomatoguide/viewholder/"
    click ApiClient "https://github.com/mukeshkumar1699/zomato-guide/blob/master/app/src/main/java/com/mukeshproject/zomatoguide/api/ApiClient.java"
    click Network "https://github.com/mukeshkumar1699/zomato-guide/blob/master/app/src/main/java/com/mukeshproject/zomatoguide/api/Network.java"
    click BackgroundThread "https://github.com/mukeshkumar1699/zomato-guide/blob/master/app/src/main/java/com/mukeshproject/zomatoguide/model/BackgroundThread.java"
    click PreferenceHelper "https://github.com/mukeshkumar1699/zomato-guide/blob/master/app/src/main/java/com/mukeshproject/zomatoguide/sharedpreferences/PreferenceHelper.java"
    click CustomComparator "https://github.com/mukeshkumar1699/zomato-guide/blob/master/app/src/main/java/com/mukeshproject/zomatoguide/CustomComparator.java"
    click StaticJSON "https://github.com/mukeshkumar1699/zomato-guide/tree/master/app/src/main/res/raw/"
    click FirebaseAuth "https://github.com/mukeshkumar1699/zomato-guide/blob/master/app/google-services.json"

    %% Styles
    classDef presentation fill:#BBDEFB,stroke:#0D47A1,stroke-width:1px
    classDef service fill:#C8E6C9,stroke:#1B5E20,stroke-width:1px
    classDef data fill:#FFE0B2,stroke:#E65100,stroke-width:1px
    classDef external fill:#E0E0E0,stroke:#424242,stroke-width:1px

    class Activities,Fragments,Adapters,ViewHolders presentation
    class ApiClient,Network,BackgroundThread,PreferenceHelper,CustomComparator service
    class DataModels,StaticJSON data
    class ZomatoAPI,FirebaseAuth,FirebaseDB,GoogleLocation external
```
