# dmayank297/gembot architecture

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

- Interactive diagram: https://gitdiagram.com/dmayank297/gembot
- Repository: https://github.com/dmayank297/gembot

## Overview

##### Project type and purpose
- GemBot is a native Android chatbot application.
- It uses Jetpack Compose for UI, the MVVM pattern for architecture, Kotlin Coroutines for async work, and Google AI’s Gemini API as an external conversational engine.

##### File structure
- Top-level “app” module containing:
- build.gradle.kts, ProGuard rules
- src/main/java/com/example/gembot/
– Data: MessageData.kt (data model)
– Model: ChatViewModel.kt (ViewModel, business logic + API calls)
– Screen: ChatBotScreen.kt (Compose UI)
– Constant.kt (API keys, endpoint URLs)
– MainActivity.kt (hosts Compose content)
- src/main/res: images, strings, themes, xml backup/data-extraction rules
- src/androidTest & src/test: instrumentation and unit tests
- Root-level Gradle wrapper, gradle.properties, settings.gradle.kts include only the “app” module.

##### README for additional insights
- Confirms use of Jetpack Compose, Coroutines, Gemini SDK and Google AI Client Library.
- No local database or caching layer mentioned—conversations are ephemeral.

##### Elements
- Blue for UI components
- Green for ViewModel/Business Logic
- Yellow for Network Layer

## Diagram (Mermaid)

```mermaid
flowchart TB
    User["User (Android Device)"]
    
    subgraph "UI Layer"
        ChatBotScreen["ChatBotScreen (Compose UI)"]:::ui
        subgraph "UI Theme Resources"
            Color["Color.kt"]:::ui
            Type["Type.kt"]:::ui
            Theme["Theme.kt"]:::ui
        end
    end

    subgraph "Presentation Layer"
        MainActivity["MainActivity"]:::presentation
        ChatViewModel["ChatViewModel"]:::presentation
    end

    subgraph "Data Layer"
        MessageData["MessageData.kt"]:::data
        Constant["Constant.kt"]:::data
    end

    Network["Gemini SDK / Google AI Client"]:::network
    External{{"Google AI Gemini API"}}:::external

    subgraph "Resource Assets"
        Drawable["res/drawable/"]:::resources
        Mipmap["res/mipmap-*/"]:::resources
        ColorsXML["colors.xml"]:::resources
        StringsXML["strings.xml"]:::resources
        ThemesXML["themes.xml"]:::resources
    end

    subgraph "Test Modules"
        UnitTest["ExampleUnitTest.kt"]:::test
        InstrumentedTest["ExampleInstrumentedTest.kt"]:::test
    end

    User --> ChatBotScreen
    MainActivity --> ChatBotScreen
    ChatBotScreen --> ChatViewModel
    ChatViewModel --> MessageData
    ChatViewModel --> Constant
    ChatViewModel --> Network
    Network --> External
    External --> ChatViewModel
    ChatViewModel --> ChatBotScreen
    Drawable --> ChatBotScreen
    Mipmap --> ChatBotScreen
    ColorsXML --> ChatBotScreen
    StringsXML --> ChatBotScreen
    ThemesXML --> ChatBotScreen
    UnitTest --> ChatViewModel
    InstrumentedTest --> ChatBotScreen

    click ChatBotScreen "https://github.com/dmayank297/gembot/blob/main/app/src/main/java/com/example/gembot/Screen/ChatBot Screen.kt"
    click Color "https://github.com/dmayank297/gembot/blob/main/app/src/main/java/com/example/gembot/ui/theme/Color.kt"
    click Type "https://github.com/dmayank297/gembot/blob/main/app/src/main/java/com/example/gembot/ui/theme/Type.kt"
    click Theme "https://github.com/dmayank297/gembot/blob/main/app/src/main/java/com/example/gembot/ui/theme/Theme.kt"
    click MainActivity "https://github.com/dmayank297/gembot/blob/main/app/src/main/java/com/example/gembot/MainActivity.kt"
    click ChatViewModel "https://github.com/dmayank297/gembot/blob/main/app/src/main/java/com/example/gembot/Model/ChatViewModel.kt"
    click MessageData "https://github.com/dmayank297/gembot/blob/main/app/src/main/java/com/example/gembot/Data/MessageData.kt"
    click Constant "https://github.com/dmayank297/gembot/blob/main/app/src/main/java/com/example/gembot/Constant.kt"
    click Drawable "https://github.com/dmayank297/gembot/tree/main/app/src/main/res/drawable/"
    click Mipmap "https://github.com/dmayank297/gembot/tree/main/app/src/main/res/mipmap-*/"
    click ColorsXML "https://github.com/dmayank297/gembot/blob/main/app/src/main/res/values/colors.xml"
    click StringsXML "https://github.com/dmayank297/gembot/blob/main/app/src/main/res/values/strings.xml"
    click ThemesXML "https://github.com/dmayank297/gembot/blob/main/app/src/main/res/values/themes.xml"
    click UnitTest "https://github.com/dmayank297/gembot/blob/main/app/src/test/java/com/example/gembot/ExampleUnitTest.kt"
    click InstrumentedTest "https://github.com/dmayank297/gembot/blob/main/app/src/androidTest/java/com/example/gembot/ExampleInstrumentedTest.kt"

    classDef ui fill:#BBDEFB,stroke:#0D47A1,color:#0D47A1
    classDef presentation fill:#C8E6C9,stroke:#1B5E20,color:#1B5E20
    classDef data fill:#FFF9C4,stroke:#F57F17,color:#F57F17
    classDef network fill:#FFF176,stroke:#F9A825,color:#F9A825
    classDef external fill:#FFE0B2,stroke:#E65100,color:#E65100
    classDef resources fill:#E1BEE7,stroke:#6A1B9A,color:#6A1B9A
    classDef test fill:#CFD8DC,stroke:#455A64,color:#455A64
    classDef user fill:#ECEFF1,stroke:#37474F,color:#37474F
```
