# haruple97/dodobot architecture

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

- Interactive diagram: https://gitdiagram.com/haruple97/dodobot
- Repository: https://github.com/haruple97/dodobot

## Overview

##### Project Type and Purpose
- This is a native Android mobile application.
- It is designed to serve as an AI chatbot application (using IBM Watson Assistant) with additional features like providing school-related information (academic schedules, campus maps, building details) for Daegu University.
- Other integrations include using the Naver Map API to show campus maps.

##### Analyzing the File Structure
- The top-level “app” folder shows that this is an Android Studio project with standard structure – AndroidManifest.xml, source Java files, resources (layouts, drawables, fonts, values), and tests.
- Under src/main/java/org/justice/dodobot, you see many Activity classes (e.g., IntroActivity, MainActivity, Chatbot_Activity, MapFragmentActivity) plus fragments/adapters (e.g., ChatAdapter, various pointAdapter files, MyAdapter) that are used to bind data to UI components.
- The resources directory contains layout files and drawable assets that represent the visual aspects of the UI (including the splash screen, chat item layouts, map screen layout, etc.).
- The inclusion of gradle files indicates standard build and dependency management.

##### Main Components of the System
a. User Interface Layer:
- Activities & Fragments: SplashActivity, IntroActivity, MainActivity, Chatbot_Activity, Chatbot_way, MapFragmentActivity.
- UI Components: Layout XMLs for chat views, campus map, introductory screens, card news, etc.
- Adapters: ChatAdapter, pointAdapter_X series and MyAdapter which bind data to UI components (likely for RecyclerViews or ListViews).

b. Integration/Service Layer:
- AI Chatbot Service: Integration with Watson Assistant API used within the Chatbot modules.
- Service: Integration with the Naver Map API for building location and mapping features.

c. Data and Business Logic:
- Data Models: Classes like Message encapsulate the information exchanged in chats.
- Utility Classes / Click Listeners: Classes like ClickListener and RecyclerTouchListener handle user interactions.

##### Relationships and Interactions
- User interactions are handled through Activities and Fragments.
- When a user starts the application (SplashActivity → IntroActivity → MainActivity), they can navigate to different features:
– Chat feature: Chatbot_Activity collects user input, sends it via an adapter/service to the Watson Assistant API, and then displays the response.
– Campus map: MapFragmentActivity leverages the Naver Map API; users select buildings (with pointAdapter binding the list of buildings/points) and the map view updates accordingly.
- The adapters (for instance, the series of pointAdapter files) indicate that there may be different representations or configurations for mapping points (perhaps varying by building or zoom level).

##### Architectural Patterns and Design Principles
- The structure hints at a separation of concerns between UI, adapters (data binding) and integration logic for external APIs.
- MVC or MVP-like patterns can be inferred; Views (Activities/Fragments and layouts), Controllers/Presenters (handling user input and API requests), and Models (e.g., Message class, data provided by Watson or Map APIs).
- Clear layering encourages reusability and ease of maintenance.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer"
        Splash["SplashActivity"]:::ui
        Intro["IntroActivity"]:::ui
        Main["MainActivity"]:::ui
        Chat["Chatbot_Activity"]:::ui
        ChatFlow["Chatbot_way"]:::ui
        Map["MapFragmentActivity"]:::ui
    end

    %% Adapters and Data Models
    subgraph "Adapters & Data Models"
        ChatAdpt["ChatAdapter"]:::adapter
        PointAdpt["Point Adapters"]:::adapter
        MyAdpt["MyAdapter"]:::adapter
        Model["Message"]:::adapter
    end

    %% Utilities
    subgraph "UI Utilities"
        Click["ClickListener"]:::utility
        Recycler["RecyclerTouchListener"]:::utility
    end

    %% Integration Services
    subgraph "Integration Services"
        Watson["Watson Assistant API"]:::service
        Naver["Naver Map API"]:::service
    end

    %% Build System
    subgraph "Build & Dependency Management"
        Gradle["Gradle Build System"]:::build
    end

    %% Relationships - Navigation Flow
    Splash -->|"navigatesTo"| Intro
    Intro  -->|"navigatesTo"| Main
    Main   -->|"opens"| Chat
    Main   -->|"opens"| Map

    %% Chat Module Interactions
    Chat   -->|"uses"| ChatFlow
    Chat   -->|"bindsUsing"| ChatAdpt
    ChatAdpt <-->|"dataExchange"| Model
    Chat   -->|"calls"| Watson

    %% Map Module Interactions
    Map    -->|"bindsUsing"| PointAdpt
    Map    -->|"bindsUsing"| MyAdpt
    Map    -->|"calls"| Naver

    %% UI Utility Usage
    Chat   -->|"triggers"| Click
    Chat   -->|"triggers"| Recycler
    Map    -->|"triggers"| Click
    Map    -->|"triggers"| Recycler

    %% Build System supports all modules
    Gradle -->|"builds"| Splash
    Gradle -->|"builds"| Intro
    Gradle -->|"builds"| Main
    Gradle -->|"builds"| Chat
    Gradle -->|"builds"| Map
    Gradle -->|"manages"| ChatAdpt
    Gradle -->|"manages"| PointAdpt
    Gradle -->|"manages"| MyAdpt

    %% Click Events
    click Splash "https://github.com/haruple97/dodobot/blob/master/app/src/main/java/org/justice/dodobot/SplashActivity.java"
    click Intro "https://github.com/haruple97/dodobot/blob/master/app/src/main/java/org/justice/dodobot/IntroActivity.java"
    click Main "https://github.com/haruple97/dodobot/blob/master/app/src/main/java/org/justice/dodobot/MainActivity.java"
    click Chat "https://github.com/haruple97/dodobot/blob/master/app/src/main/java/org/justice/dodobot/Chatbot_Activity.java"
    click ChatFlow "https://github.com/haruple97/dodobot/blob/master/app/src/main/java/org/justice/dodobot/Chatbot_way.java"
    click Map "https://github.com/haruple97/dodobot/blob/master/app/src/main/java/org/justice/dodobot/MapFragmentActivity.java"
    click ChatAdpt "https://github.com/haruple97/dodobot/blob/master/app/src/main/java/org/justice/dodobot/ChatAdapter.java"
    click PointAdpt "https://github.com/haruple97/dodobot/tree/master/app/src/main/java/org/justice/dodobot/Adapter/"
    click MyAdpt "https://github.com/haruple97/dodobot/blob/master/app/src/main/java/org/justice/dodobot/MyAdapter.java"
    click Model "https://github.com/haruple97/dodobot/blob/master/app/src/main/java/org/justice/dodobot/Message.java"
    click Click "https://github.com/haruple97/dodobot/blob/master/app/src/main/java/org/justice/dodobot/ClickListener.java"
    click Recycler "https://github.com/haruple97/dodobot/blob/master/app/src/main/java/org/justice/dodobot/RecyclerTouchListener.java"

    %% Styles
    classDef ui fill:#AED6F1,stroke:#3498DB,stroke-width:2px;
    classDef adapter fill:#A9DFBF,stroke:#1E8449,stroke-width:2px;
    classDef service fill:#F9E79F,stroke:#F1C40F,stroke-width:2px;
    classDef utility fill:#FADBD8,stroke:#E74C3C,stroke-width:2px;
    classDef build fill:#D2B4DE,stroke:#8E44AD,stroke-width:2px;
```
