# antoniozamora2002/panmovil architecture

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

- Interactive diagram: https://gitdiagram.com/antoniozamora2002/panmovil
- Repository: https://github.com/antoniozamora2002/panmovil

## Overview

##### Project Type and Purpose
- Project Type: A mobile Android application.
- Purpose: To provide users with an interactive catalog of bakery products, incorporating functionalities for reviews, promotions, and user account management.
- Key Features: Product catalog navigation, user reviews/comments, promotions display, and API connectivity for dynamic data.

##### And Represent the Main Components
a. Mobile Presentation Layer (UI):
- Activities: Represent each screen (e.g., LoginActivity, MainActivity, RegistroActivity, RecuperarCuentaActivity, etc.).
- Layouts: Included under the res/layout folder; these define the view structure that the activities use.
- RecyclerView Adapters: Components such as ProductoPanesAdapter, ProductoPostresAdapter, PromocionesAdapter, and ResenasAdapter, which handle the presentation of lists of products, reviews, and promotions.
- Resource Files: Drawable assets, animations, fonts, and themes that support the UI.

b. Business Logic and Domain Layer:
- Modules: Represent model classes under the “modulos” package (Products, Promociones, Resenas, Usuario). These encapsulate core business data.
- Activity-to-Module Relationships: Show how activities interact with these domain models to retrieve and display data.

c. Data Access Layer:
- API Connectivity: The “conexionApi” package (with ConexionApi.java) handles communication with the remote server or backend services that supply product, review, and promotion data.
- Network Interaction: Illustrate a pathway from the UI layer (activities) to the API connectivity component. You might also include network request/response handling if applicable.

d. Testing Components:
- Unit tests in the “app/src/test” directory and Android instrumented tests in “app/src/androidTest”. These can be noted as supporting components to ensure the robustness of various modules.

e. Build and Deployment:
- Gradle Scripts: The build.gradle.kts, settings.gradle.kts, and other configuration files are indicative of the build process managed by Gradle.
- Release Artifacts: The APK under app/release, which represents the deployable application.

##### Relationships and Data Flow
- Data flow between activities and the underlying model objects in the “modulos” folder.
- How adapters feed dynamic data into the RecyclerView components in the UI.
- Optionally, include testing as a support “cloud” or separate note that validates the layers.

##### Incorporate Architectural Patterns and Design Principles
- View: Activities, layouts, adapters.
- Model: Domain objects in the “modulos” folder.
- Controller/Logic: API connectivity (ConexionApi.java) and any business logic contained within activities.
- Modularity, with clear separation between UI, business logic, and data access.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Mobile Presentation Layer (UI)
    subgraph "Mobile Presentation Layer (UI)"
        subgraph "Activities"
            LA["LoginActivity"]:::activity
            MA["MainActivity"]:::activity
            RA["RegistroActivity"]:::activity
            RCA["RecuperarCuentaActivity"]:::activity
        end
        subgraph "Layouts"
            LYA["activity_login.xml"]:::layout
            LYM["activity_main.xml"]:::layout
            LYR["activity_registro.xml"]:::layout
        end
        subgraph "RecyclerView Adapters"
            AD1["ProductoPanesAdapter"]:::adapter
            AD2["ProductoPostresAdapter"]:::adapter
            AD3["PromocionesAdapter"]:::adapter
            AD4["ResenasAdapter"]:::adapter
        end
        UIR["UI Resources\n(Drawables/Fonts/Anim)"]:::resource
    end

    %% Business/Domain Layer
    subgraph "Business/Domain Layer"
        M1["Products"]:::domain
        M2["Promociones"]:::domain
        M3["Resenas"]:::domain
        M4["Usuario"]:::domain
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        API["ConexionApi"]:::api
    end

    %% Testing Components
    subgraph "Testing Components"
        TEST1["Unit Tests"]:::test
        TEST2["Instrumented Tests"]:::test
    end

    %% Build and Deployment
    subgraph "Build and Deployment"
        BD1["Gradle Build Scripts"]:::build
        BD2["Release Artifacts"]:::build
    end

    %% Connections between UI and Domain/Data Layers
    LA -->|"calls"| API
    MA -->|"fetches_products"| M1
    MA -->|"fetches_promos"| M2
    MA -->|"fetches_reviews"| M3
    RA -->|"registers_user"| M4
    RCA -->|"recovers_account"| M4

    %% Connections from Adapters to Domain Models
    AD1 -->|"displays"| M1
    AD2 -->|"displays"| M1
    AD3 -->|"displays"| M2
    AD4 -->|"displays"| M3

    %% Connections from Layouts to Activities (UI composition)
    LYA -->|"used_by"| LA
    LYM -->|"used_by"| MA
    LYR -->|"used_by"| RA

    %% UI Resources used by Activities and Adapters
    UIR --- LA
    UIR --- MA
    UIR --- RA
    UIR --- RCA
    UIR --- AD1
    UIR --- AD2
    UIR --- AD3
    UIR --- AD4

    %% Data Access interaction with Domain Models (backend response flow)
    API -->|"provides_data_for"| M1
    API -->|"provides_data_for"| M2
    API -->|"provides_data_for"| M3
    API -->|"provides_data_for"| M4

    %% Testing Components support all layers
    TEST1 --- M1
    TEST1 --- M2
    TEST1 --- M3
    TEST1 --- M4
    TEST2 --- LA
    TEST2 --- MA
    TEST2 --- RA
    TEST2 --- RCA

    %% Build and Deployment connections (CI/CD integration hint)
    BD1 --- LA
    BD1 --- MA
    BD1 --- RA
    BD1 --- RCA
    BD2 --- BD1

    %% Click Events for Mobile Presentation Layer (UI)
    click LA "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/java/com/example/panmovil_panitasproject/LoginActivity.java"
    click MA "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/java/com/example/panmovil_panitasproject/MainActivity.java"
    click RA "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/java/com/example/panmovil_panitasproject/RegistroActivity.java"
    click RCA "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/java/com/example/panmovil_panitasproject/RecuperarCuentaActivity.java"
    
    click LYA "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/res/layout/activity_login.xml"
    click LYM "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/res/layout/activity_main.xml"
    click LYR "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/res/layout/activity_registro.xml"
    
    click AD1 "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/java/com/example/panmovil_panitasproject/recycleadapter/ProductoPanesAdapter.java"
    click AD2 "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/java/com/example/panmovil_panitasproject/recycleadapter/ProductoPostresAdapter.java"
    click AD3 "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/java/com/example/panmovil_panitasproject/recycleadapter/PromocionesAdapter.java"
    click AD4 "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/java/com/example/panmovil_panitasproject/recycleadapter/ResenasAdapter.java"

    %% Click Events for Business/Domain Layer
    click M1 "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/java/com/example/panmovil_panitasproject/modulos/Products.java"
    click M2 "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/java/com/example/panmovil_panitasproject/modulos/Promociones.java"
    click M3 "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/java/com/example/panmovil_panitasproject/modulos/Resenas.java"
    click M4 "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/java/com/example/panmovil_panitasproject/modulos/Usuario.java"

    %% Click Event for Data Access Layer
    click API "https://github.com/antoniozamora2002/panmovil/blob/main/app/src/main/java/com/example/panmovil_panitasproject/conexionApi/ConexionApi.java"

    %% Click Events for Testing Components
    click TEST1 "https://github.com/antoniozamora2002/panmovil/tree/main/app/src/test/"
    click TEST2 "https://github.com/antoniozamora2002/panmovil/tree/main/app/src/androidTest/"

    %% Click Events for Build and Deployment
    click BD1 "https://github.com/antoniozamora2002/panmovil/blob/main/app/build.gradle.kts"
    click BD1 "https://github.com/antoniozamora2002/panmovil/blob/main/build.gradle.kts"
    click BD1 "https://github.com/antoniozamora2002/panmovil/blob/main/settings.gradle.kts"
    click BD1 "https://github.com/antoniozamora2002/panmovil/blob/main/gradle.properties"
    click BD2 "https://github.com/antoniozamora2002/panmovil/tree/main/app/release/"

    %% Styles
    classDef activity fill:#AED6F1,stroke:#1B4F72,stroke-width:2px;
    classDef layout fill:#F9E79F,stroke:#B9770E,stroke-width:2px;
    classDef adapter fill:#D2B4DE,stroke:#6C3483,stroke-width:2px;
    classDef resource fill:#A3E4D7,stroke:#117864,stroke-width:2px;
    classDef domain fill:#F5CBA7,stroke:#A04000,stroke-width:2px;
    classDef api fill:#F1948A,stroke:#922B21,stroke-width:2px;
    classDef test fill:#D5F5E3,stroke:#1E8449,stroke-width:2px;
    classDef build fill:#E8DAEF,stroke:#6C3483,stroke-width:2px;
```
