# dinakaran-k/fooddeliveryapp architecture

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

- Interactive diagram: https://gitdiagram.com/dinakaran-k/fooddeliveryapp
- Repository: https://github.com/dinakaran-k/fooddeliveryapp

## Overview

##### Main Components
- Mobile Application (Presentation Layer): This includes your UI packages and screens like the MainActivity, SplashScreenActivity, and various UI components for the Product Details screen. In particular, note folders such as “ui/screen” and “ui/screen/components,” which indicate modular, composable UI elements.
- Data Models and Domain Layer: The “data” package contains several data classes like OrderData, ProductDescriptionData, ProductFlavourState, ProductNutritionData, and ProductPreviewData. These represent the business entities or DTOs used across the application.
- Android Resources and Assets: Note the “res” folder containing drawable, font, mipmap, and XML resources that define the app’s visual assets, themes, and configuration files.
- Build and Configuration Infrastructure: Files like build.gradle.kts, settings.gradle.kts, and gradle wrapper files indicate the project’s build and dependency management system.

##### Relationship and Interactions
- Application Flow: Start at the SplashScreenActivity, which serves as the entry point to the app. After the splash, the MainActivity is loaded, presenting the main interface for browsing food items.
- User Interface Components: The UI is broken into individual screens and components (like FlavourSection, OrderActionBar, ProductDescriptionSection, etc.). Components should be shown separately to highlight their reusability and inter-component communication on the Product Details screen.
- System Configuration: Represent the AndroidManifest.xml and the resource files as part of the overall application configuration, ensuring the app is aware of all declared activities and permissions.

##### Architectural Patterns and Design Principles
- Layered Architecture: The project clearly separates concerns—presentation (activities and UI components) versus data (models) and resources.
- Modular UI Design: The breakdown of UI components into separate packages indicates a component-based design. This allows individual components (like the FlavourSection or OrderActionBar) to be developed and tested in isolation.

##### Relevant Technologies and Frameworks
- Kotlin & Android SDK: Indicate that the primary language is Kotlin and that the app uses Android SDK layers.
- Android Manifest and Resources: Highlight that these configurations and resources (XML files) are integral to the system setup.

##### Final Assembly
- Drill down into detail by expanding the UI block into individual activities and components, and the data layer into its constituent data classes.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        SS["Splash Screen Activity"]:::presentation
        MA["Main Activity"]:::presentation
        PD["Product Details Screen"]:::presentation
        subgraph "UI Components"
            FS["FlavourSection"]:::presentation
            OAB["OrderActionBar"]:::presentation
            PDS["ProductDescriptionSection"]:::presentation
            PH["ProductHighlights"]:::presentation
            PNS["ProductNutritionSection"]:::presentation
            PPS["ProductPreviewSection"]:::presentation
        end
    end

    %% Data Layer
    subgraph "Data Layer"
        DM["Data Models & Domain Layer"]:::data
    end

    %% Resources & Assets
    subgraph "Resources & Assets"
        RS["Android Resources & Assets"]:::resource
    end

    %% Build & Configuration
    subgraph "Build & Configuration"
        RG["Root Gradle Scripts"]:::config
        MG["Module Gradle Script"]:::config
        GW["Gradle Wrapper"]:::config
    end

    %% Application Flow
    SS -->|"navigates"| MA
    MA -->|"launches"| PD

    %% UI Composition
    PD -->|"composes"| FS
    PD -->|"composes"| OAB
    PD -->|"composes"| PDS
    PD -->|"composes"| PH
    PD -->|"composes"| PNS
    PD -->|"composes"| PPS

    %% Data Interaction
    PDS -->|"binds"| DM
    PD -->|"fetches"| DM

    %% Resource Usage
    PD -->|"rendersFrom"| RS

    %% Build Configuration Flow
    RG --> MG
    GW --> MG
    MG -->|"builds"| PD

    %% Click Events for Presentation Layer
    click SS "https://github.com/dinakaran-k/fooddeliveryapp/blob/master/app/src/main/java/com/example/fooddeliveryapp/splashScreen/SplashScreenActivity.kt"
    click MA "https://github.com/dinakaran-k/fooddeliveryapp/blob/master/app/src/main/java/com/example/fooddeliveryapp/MainActivity.kt"
    click PD "https://github.com/dinakaran-k/fooddeliveryapp/blob/master/app/src/main/java/com/example/fooddeliveryapp/ui/screen/ProductDetailsScreen.kt"
    click FS "https://github.com/dinakaran-k/fooddeliveryapp/blob/master/app/src/main/java/com/example/fooddeliveryapp/ui/screen/components/FlavourSection.kt"
    click OAB "https://github.com/dinakaran-k/fooddeliveryapp/blob/master/app/src/main/java/com/example/fooddeliveryapp/ui/screen/components/OrderActionBar.kt"
    click PDS "https://github.com/dinakaran-k/fooddeliveryapp/blob/master/app/src/main/java/com/example/fooddeliveryapp/ui/screen/components/ProductDescriptionSection.kt"
    click PH "https://github.com/dinakaran-k/fooddeliveryapp/blob/master/app/src/main/java/com/example/fooddeliveryapp/ui/screen/components/ProductHighlights.kt"
    click PNS "https://github.com/dinakaran-k/fooddeliveryapp/blob/master/app/src/main/java/com/example/fooddeliveryapp/ui/screen/components/ProductNutritionSection.kt"
    click PPS "https://github.com/dinakaran-k/fooddeliveryapp/blob/master/app/src/main/java/com/example/fooddeliveryapp/ui/screen/components/ProductPreviewSection.kt"

    %% Click Events for Data Layer
    click DM "https://github.com/dinakaran-k/fooddeliveryapp/tree/master/app/src/main/java/com/example/fooddeliveryapp/data"

    %% Click Events for Resources & Assets
    click RS "https://github.com/dinakaran-k/fooddeliveryapp/tree/master/app/src/main/res"

    %% Click Events for Build & Configuration
    click MG "https://github.com/dinakaran-k/fooddeliveryapp/blob/master/app/build.gradle.kts"
    click RG "https://github.com/dinakaran-k/fooddeliveryapp/blob/master/build.gradle.kts"
    click GW "https://github.com/dinakaran-k/fooddeliveryapp/tree/master/gradle/wrapper"

    %% Styles
    classDef presentation fill:#a2d2ff,stroke:#1d3557,stroke-width:2px;
    classDef data fill:#ffbf69,stroke:#d62828,stroke-width:2px;
    classDef resource fill:#caffbf,stroke:#2b9348,stroke-width:2px;
    classDef config fill:#e9c46a,stroke:#f4a261,stroke-width:2px;
```
